curl --request POST \
--url https://api.aiid.edu.kg/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size": "1280x720",
"images": [
"https://example.png"
],
"model": "sora-2",
"prompt": "this is an example",
"duration": 12,
"fps": "24",
"seed": "20231024",
"mode": "i2v"
}
'{
"id": "video_abc123",
"object": "video",
"model": "sora-2",
"status": "queued",
"progress": 0,
"created_at": 1764347090922,
"seconds": "8"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}创建视频
OpenAI Sora 兼容格式的视频生成接口。支持文生视频与图/视频参考生成模式。
POST /v1/videos:创建视频任务GET /v1/videos/{video_id}:查询任务状态GET /v1/videos/{video_id}/content:获取视频二进制内容
当前对外不提供:
GET /v1/videosPOST /v1/videos/{video_id}/remix
标准鉴权头:
Content-Type: application/json
POST /v1/videos创建任务,获取id- 轮询
GET /v1/videos/{id}直到completed或failed - 完成后优先使用返回中的
video_url - 如需统一下载,调用
GET /v1/videos/{id}/content
核心参数:
model: string:必填,对外模型名prompt: string:推荐,视频生成描述seconds: number|string:可选,目标时长duration: number|string:可选,时长别名size: string:可选,输出尺寸mode: string:可选,常见值t2vi2vi2v_first_lastreference_material
常用兼容参数:
aspect_ratioratioqualityresolutionfpsimageimage_urlimage_urlsimagesreference_imagesinput_referenceend_image_urllast_image_urlvideo_urlsaudio_urlsfunction_modecontentcallback_urlexternal_task_id
Kling 常用扩展参数:
model_namenegative_promptcfg_scalesoundcamera_controlimage_listvideo_idtask_idwatermark_info
4.1 Veo 系列
说明:stable、official 等表示不同分组,不是对外 model 后缀;调用时请保持 model 为基础模型名,由账户或令牌分组决定实际走哪个分组。
Veo 3.x 主模型
veo3veo3-fastveo3-fast-framesveo3-framesveo3-proveo3-pro-framesveo3.1veo3.1-fastveo3.1-proveo3.1-componentsveo3.1-4kveo3.1-pro-4k
建议:
- 纯文生视频优先使用
veo3*/veo3.1*主模型 - 图生或参考生视频场景,建议显式传
mode + image_url/reference_images
4.2 Sora 系列
基础模型:
sora-2sora-2-pro
建议:
sora-2*适合通用调用- 如需使用
stable/official等分组,请保持model为基础模型名,不要在模型名后追加后缀。
请求示例:
{
"size": "1280x720",
"images": [
"https://example.png"
],
"model": "sora-2",
"prompt": "this is an example",
"duration": 12,
"fps": "24",
"seed": "20231024",
"mode": "i2v"
}
4.3 HappyHorse 系列
对外模型:
happyhorse-1.0
建议:
happyhorse-1.0通过mode区分t2v、i2v、r2v、video_edit。- Sora 兼容格式中参考图建议使用
content数组传递媒体项。 - 文本项使用
type=text,媒体项使用type=image_url并可配合role、name标识素材用途。
请求示例:
{
"size": "720x1280",
"model": "happyhorse-1.0",
"mode": "r2v",
"prompt": "this is an example",
"duration": 15,
"content": [
{
"type": "text",
"text": "this is an example"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.png"
},
"role": "reference_image",
"name": "image1"
}
],
"parameters": {
"resolution": "720P",
"ratio": "9:16",
"duration": 15,
"seed": 1
}
}
4.4 Seedance 系列
对外模型:
doubao-seedance-1-0-lite-t2v-250428doubao-seedance-1-0-lite-i2v-250428doubao-seedance-1-0-pro-250528doubao-seedance-1-0-pro-fast-251015doubao-seedance-1-5-pro-251215doubao-seedance-2-0-260128doubao-seedance-2-0-fast-260128
建议:
- 文生视频优先
*-t2v-*或pro / fast - 图生视频优先
*-i2v-* - 复杂参考素材场景优先使用
content
请求示例:
{
"size": "1280x720",
"model": "doubao-seedance-2-0-fast-260128",
"prompt": "this is an example",
"duration": 15,
"fps": "24",
"seed": "20231024",
"mode": "reference_material",
"content": [
{
"type": "text",
"text": "this is an example"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.png"
},
"role": "reference_image",
"name": "image1"
},
{
"type": "audio_url",
"audio_url": {
"url": "https://example.mp3"
},
"role": "reference_audio",
"name": "audio1"
}
]
}
4.5 Grok 视频系列
对外模型:
grok-imagine-1.0-videogrok-imagine-video-1.5-previewgrok-video-3
常用参数:
promptratio/aspect_ratioresolution/sizeseconds/durationimage/image_url/input_referencereference_images
示例:
{
"model": "grok-imagine-1.0-video",
"prompt": "雨夜霓虹街道上的电影感推镜,光影丰富,运动自然",
"reference_images": [
"https://example.com/ref-1.jpg"
],
"seconds": 10,
"aspect_ratio": "16:9",
"resolution": "720P"
}
4.6 Kling 视频主模型
对外主模型:
kling-video
必填:
modelmodel_name
支持的 model_name:
kling-v1kling-v1-5kling-v1-6kling-v2-masterkling-v2-1kling-v2-1-masterkling-v2-5-turbokling-v2-6kling-v3
常见 mode:
t2vi2vmulti_i2vextend
最小入参:
- 文生视频:
model + model_name + prompt + mode=t2v - 图生视频:
model + model_name + prompt + mode=i2v + image - 多图参考:
model + model_name + prompt + mode=multi_i2v + image_list - 视频延长:
model + model_name + mode=extend + video_id
示例:
{
"model": "kling-video",
"model_name": "kling-v2-6",
"mode": "t2v",
"prompt": "海边日落镜头,电影感,风吹长发",
"duration": 5,
"aspect_ratio": "16:9"
}
4.7 MiniMax / Hailuo 视频系列
对外模型:
minimax-h3hailuo-2.3
建议:
minimax-h3支持文生视频、图片参考和音频参考,推荐通过content混排文本与素材;也可使用image_urls、audio_urls等兼容字段。hailuo-2.3需要首帧图片,推荐在content中传role=first_frame的image_url项,或使用image_urls传首帧图片。minimax-h3常用duration=5~15、resolution=1440p;hailuo-2.3常用duration=6或10、resolution=768p。
minimax-h3 示例:
{
"model": "minimax-h3",
"prompt": "A cinematic product video with smooth camera motion",
"content": [
{
"type": "text",
"text": "Use the product image as reference and match the rhythm of the audio."
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/product.jpg"
},
"role": "reference_image",
"name": "product"
},
{
"type": "audio_url",
"audio_url": {
"url": "https://example.com/music.mp3"
},
"role": "reference_audio",
"name": "music"
}
],
"duration": 8,
"resolution": "1440p",
"aspect_ratio": "16:9",
"generate_audio": true
}
hailuo-2.3 示例:
{
"model": "hailuo-2.3",
"prompt": "The camera slowly pushes in, natural motion and cinematic lighting.",
"content": [
{
"type": "text",
"text": "The camera slowly pushes in, natural motion and cinematic lighting."
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/first-frame.jpg"
},
"role": "first_frame",
"name": "first"
}
],
"duration": 10,
"resolution": "768p",
"aspect_ratio": "16:9"
}
-
mode=t2v -
最小入参:
model + prompt -
mode=i2v -
最小入参:
model + prompt + image_url -
mode=i2v_first_last -
最小入参:
model + prompt + image_url + end_image_url -
mode=reference_images -
最小入参:
model + prompt + reference_images -
mode=reference_material -
最小入参:
model + prompt + (image_urls/video_urls/audio_urls 至少一种)
Gemini Omni 调用说明
gemini-omni是 new-api 对外公开的视频模型名,可直接走POST /v1/videos。mode=t2v:文生视频,最小入参为model + prompt。mode=r2v:参考图/参考素材生成,图片可放在image、image_url、images、image_urls、reference_images、input_reference或content中。mode=edit:视频编辑,视频可放在video、video_url、videos或content中,也可同时传参考图。- 时长字段可用
seconds或duration,会自动匹配到 4 / 6 / 8 / 10 秒档。
Kling 4.0
对外模型:kling-4.0(720p)、kling-4.0-1080p。原生格式可使用 POST /text-to-video/kling-4.0、POST /image-to-video/kling-4.0、POST /omni-video/kling-4.0,并通过 GET /tasks?task_ids=任务ID 查询。原生请求无需 model,由 settings.resolution 选择清晰度,默认1080p;原生参考图/视频类型为 refer_image、feature_video,创建返回 data 对象,查询返回 data 数组。可通过 POST /api/v3/contents/generations/tasks 或 POST /v1/videos 提交,分别通过对应路径的 GET /{task_id} 查询。OpenAI/Sora 直接使用 prompt、seconds、size 和 input_reference;Seedance 直接使用 content 与顶层 duration/resolution/ratio/mode,两者都无需额外 contents/settings/options。旧信封仍兼容:contents 中 type=prompt 为文本,type=reference_image、reference_video 为参考素材,first_frame、last_frame 为首尾帧。kling-4.0 对应 720p,kling-4.0-1080p 对应 1080p;请让 settings.resolution 与模型名一致。settings 中使用 duration(4–30 秒)、resolution(720p/1080p)、aspect_ratio(21:9、16:9、9:16、1:1)。audio 仅普通参考素材的全能模式可选;文生与首尾帧模式请省略音频开关。当前接口最多支持 10 张参考图、5 段参考视频,不支持参考音频。旧 kling-video 与 model_name 模式仍是历史兼容接口。
{
"model": "kling-4.0",
"prompt": "A cinematic product shot",
"seconds": "4",
"size": "1280x720",
"input_reference": "https://example.com/product.jpg"
}
Kling 4.0 可直接使用 Seedance 格式 content/duration/resolution/ratio/mode,或 OpenAI 视频格式 prompt/seconds/size/input_reference;两者都无需额外的 contents/settings/options。旧 contents/settings/options 信封仅作兼容。mode 可选 t2v(纯文本)、i2v(单张首帧)、i2v_first_last(首尾两帧)、reference_images(普通参考图)、reference_material(图片或视频参考)。省略 mode 且没有显式工具时,有参考素材默认 reference_material,无任何参考素材默认 t2v。参考模式使用普通参考图角色,不把明确的首尾帧静默改成参考图;首尾帧请显式选择 i2v 或 i2v_first_last,并省略画幅参数。当前不支持参考音频。settings.audio 仅参考图片/参考素材的全能模式可选;t2v、i2v、i2v_first_last 请省略音频开关。
Vidu Q4
Vidu Q4:vidu-q4 固定 720p,vidu-q4-540p 固定 540p,支持生成 3~16 秒视频。至少需要 1 张图片,最多支持 15 张参考图;参考生成可附带最多 3 段 MP3 音频,每段 3~12 秒、最大 50MB。不支持纯文生、指定首尾帧或参考视频。多张图片用于共同参考,不表示首尾位置。可通过 POST /v1/videos、POST /api/v3/contents/generations/tasks,或 Vidu 格式 POST /ent/v2/img2video、POST /ent/v2/reference2video 创建任务。统一入口推荐使用 mode=reference_images;带音频时使用 mode=reference_material。参考音频可用 audio_urls,Seedance 格式也可用标准 content 的 audio_url 项;audio 布尔字段表示生成音频开关,与参考音频 URL 列表分别使用。分辨率须与模型名一致。
curl --request POST \
--url https://api.aiid.edu.kg/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size": "1280x720",
"images": [
"https://example.png"
],
"model": "sora-2",
"prompt": "this is an example",
"duration": 12,
"fps": "24",
"seed": "20231024",
"mode": "i2v"
}
'{
"id": "video_abc123",
"object": "video",
"model": "sora-2",
"status": "queued",
"progress": 0,
"created_at": 1764347090922,
"seconds": "8"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}授权
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
请求体
- Option 1
- Kling 4.0
必填,对外模型名。 gemini-omni 可通过 /v1/videos 调用。
sora-2, sora-2-pro, gemini-omni, happyhorse-1.0, happyhorse-1.0-i2v, happyhorse-1.0-t2v, happyhorse-1.0-r2v, happyhorse-1.0-video-edit, doubao-seedance-1-0-lite-i2v-250428, doubao-seedance-1-0-lite-t2v-250428, doubao-seedance-1-0-pro-250528, doubao-seedance-1-0-pro-fast-251015, doubao-seedance-1-5-pro-251215, doubao-seedance-2-0-260128, doubao-seedance-2-0-fast-260128, sd-2-5, veo3, veo3-fast, veo3-fast-frames, veo3-frames, veo3-pro, veo3-pro-frames, veo3.1, veo3.1-4k, veo3.1-components, veo3.1-fast, veo3.1-pro, veo3.1-pro-4k, grok-imagine-1.0-video, grok-imagine-video-1.5-preview, grok-video-3, minimax-h3, hailuo-2.3, viduq3-turbo, vidu-q4, vidu-q4-540p "sora-2"
统一提示词入口。大多数模型必填。
单图入口,部分兼容模式会映射到 images。
统一时长入口,部分模型也接受 seconds。
Video width
512
Video height
512
Video frame rate
30
Random seed
20231234
Number of videos to generate
1
Response format
"url"
User identifier
"user-1234"
动态扩展字段容器。大量模型特有字段从这里反序列化。
可选,视频生成模式。 gemini-omni 支持 t2v、r2v、edit。
统一多图入口。Vidu、Seedance、Veo 等会使用。
统一尺寸入口,会映射为 resolution/aspect_ratio 等。
Sora 兼容入口,运行时会回退到 duration。
Sora/Veo 兼容参考图入口,可为 multipart 文件或兼容对象。
Vidu Q4 参考音频,最多 3 段 MP3,每段 3~12 秒、最大 50MB;与 audio 布尔开关分开。
输出分辨率,常见值 540p、720p、1080p。
响应
成功创建视频任务
Should use VideoStatus constants: VideoStatusQueued, VideoStatusInProgress, VideoStatusCompleted, VideoStatusFailed
queued, in_progress, completed, failed, video_url, url, completed_at 兼容旧接口 待废弃
