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 秒檔。
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
主體
必填,對外模型名稱。 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, 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, kling-video, grok-imagine-1.0-video, grok-imagine-video-1.5-preview, grok-video-3, minimax-h3, hailuo-2.3, viduq3-turbo "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 檔案或相容物件。
回應
成功建立影片任務
Should use VideoStatus constants: VideoStatusQueued, VideoStatusInProgress, VideoStatusCompleted, VideoStatusFailed
queued, in_progress, completed, failed, video_url, url, completed_at 相容舊介面 待廢棄
