curl --request POST \
--url https://api.newapi.si/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 4.0 直接使用標準影片參數;具體請求格式請見第 4.6 節。
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 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。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)。目前介面最多支援 10 張參考圖、5 段參考影片。Kling 4.0 預設音畫同步生成。全能參考模式支援公開網路音訊 URL:/v1/videos 使用 audio_urls,Seedance 使用 content 中的 audio_url 項目;必須使用支援音訊素材的路由。目前三個原生專用入口不接收參考音訊欄位。
{
"model": "kling-4.0",
"prompt": "A cinematic product shot",
"seconds": "4",
"size": "1280x720",
"input_reference": "https://example.com/product.jpg"
}
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 可直接使用 Seedance 格式的 content/duration/resolution/ratio/mode,或 OpenAI 影片格式的 prompt/seconds/size/input_reference;兩者都無需額外的 contents/settings/options。mode 可選 t2v(純文字)、i2v(單張首幀)、i2v_first_last(首尾兩幀)、reference_images(一般參考圖)、reference_material(全能素材參考;音訊須使用支援此功能的路由)。省略 mode 且未指定工具時,有參考素材則預設為 reference_material,沒有任何參考素材則預設為 t2v。參考模式使用一般參考圖的角色,不會將明確指定的首尾幀默默改為參考圖;首尾幀請明確選擇 i2v 或 i2v_first_last,並省略畫面比例參數。Kling 4.0 預設音畫同步生成。全能參考模式支援公開網路音訊 URL:/v1/videos 使用 audio_urls,Seedance 使用 content 中的 audio_url 項目;必須使用支援音訊素材的路由。目前三個原生專用入口不接收參考音訊欄位。
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 清單分別使用。解析度須與模型名稱一致。
Magi-2 1080p
magi-2-1080p 支援 OpenAI /v1/videos 和 Ark /api/v3/contents/generations/tasks 兩種格式,分別透過對應路徑的 GET /{task_id} 查詢。固定為 1080p,生成時長為 4~30 秒。支援 16:9、9:16、1:1、4:3、3:4、21:9;1:1 輸出為 1440×1440。參考模式最多支援 10 張圖片、5 段影片、5 段音訊,共 20 份素材。每段影片和音訊長度為 2~30 秒,所有影片總長度不得超過 30 秒,所有音訊總長度不得超過 30 秒。圖片大小上限為 30 MB,影片為 200 MB,音訊為 15 MB。首尾影格模式不得混入其他圖片、影片或音訊參考。提示詞可依各類素材的輸入順序,使用 <<<image_1>>>、<<<video_1>>>、<<<audio_1>>> 引用。目前未提供獨立的 sand.ai 官方格式入口。
{
"model": "magi-2-1080p",
"prompt": "以 <<<image_1>>> 的彩色积木为主体,参考 <<<video_1>>> 的缓慢转动及 <<<audio_1>>> 的轻柔节奏。",
"seconds": "4",
"size": "1440x1440",
"image_urls": [
"https://example.com/blocks.png"
],
"video_urls": [
"https://example.com/rotation.mp4"
],
"audio_urls": [
"https://example.com/rhythm.wav"
]
}
curl --request POST \
--url https://api.newapi.si/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>"
}
}主體
必填,對外模型名稱。 gemini-omni 可透過 /v1/videos 呼叫。
sora-2, sora-2-pro, gemini-omni, happyhorse-1.1, happyhorse-1.1-1080p, wan-3.0-prime, wan-3.0-prime-1080p, sd-2-5-4k, sd-2-5-flash, sd-2-5-flash-480p, 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, kling-4.0, kling-4.0-1080p, grok-imagine-1.0-video, grok-imagine-video-1.5-preview, grok-video-3, minimax-h3, hailuo-2.3, viduq3-turbo, viduq2, vidu2.0, vidu-q4, vidu-q4-540p, magi-2-1080p "sora-2"
選填,影片生成模式。 gemini-omni 支援 t2v、r2v、edit。
Kling 4.0 可直接使用 Seedance 格式的 content/duration/resolution/ratio/mode,或 OpenAI 影片格式的 prompt/seconds/size/input_reference;兩者都無需額外的 contents/settings/options。mode 可選 t2v(純文字)、i2v(單張首幀)、i2v_first_last(首尾兩幀)、reference_images(一般參考圖)、reference_material(全能素材參考;音訊須使用支援此功能的路由)。省略 mode 且未指定工具時,有參考素材則預設為 reference_material,沒有任何參考素材則預設為 t2v。參考模式使用一般參考圖的角色,不會將明確指定的首尾幀默默改為參考圖;首尾幀請明確選擇 i2v 或 i2v_first_last,並省略畫面比例參數。Kling 4.0 預設音畫同步生成。全能參考模式支援公開網路音訊 URL:/v1/videos 使用 audio_urls,Seedance 使用 content 中的 audio_url 項目;必須使用支援音訊素材的路由。目前三個原生專用入口不接收參考音訊欄位。
"reference_material"
回應
成功建立影片任務
