跳轉到主要內容
POST

授權

Authorization
string
header
必填

使用 Bearer Token 認證。 格式: Authorization: Bearer sk-xxxxxx

主體

application/json
model
enum<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"

prompt
string

影片描述。Kling 4.0 的標準 OpenAI/Sora 請求直接使用 prompt;使用標準 Seedance 格式時,可在 content 的 text 項目中提供文字,無需 contents/settings/options。其他模型請依各自格式要求提供文字。

image
file

單圖進入點,部分相容模式會映射至 images。

duration
integer

統一時長入口,部分模型也接受 seconds。

width
integer

Video width

範例:

512

height
integer

Video height

範例:

512

fps
integer

Video frame rate

範例:

30

seed
integer

Random seed

範例:

20231234

n
integer

Number of videos to generate

範例:

1

response_format
string

Response format

範例:

"url"

user
string

User identifier

範例:

"user-1234"

metadata
object

動態擴充欄位容器。大量模型特定欄位由此進行還原序列化。

tool
string
mode
string

選填,影片生成模式。 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"

images
string[]

統一多圖入口。Vidu、Seedance、Veo 等會使用。

content
object[]

Seedance 格式也可呼叫 Kling 4.0;文字使用 text,圖片/影片/音訊使用 image_url/video_url/audio_url 物件。圖片 role 為 first_frame、last_frame 或 reference_image,影片為 reference_video,音訊為 reference_audio。參考音訊必須使用支援此功能的全能參考路由,不能因輸出音軌而推定所有路由皆可輸入音訊。使用 mode 區分生成情境。

contents
object[]

Kling 4.0 舊信封相容欄位;標準 OpenAI/Sora、Seedance 請求無需提供。

Minimum array length: 1
settings
object

舊信封相容設定;標準格式直接使用 seconds/size 或 duration/resolution/ratio。

options
object

舊信封相容欄位;標準格式無需提供。

size
string

統一尺寸入口,會映射為 resolution/aspect_ratio 等。

seconds
string

Sora 相容入口,執行時會回退到 duration。

input_reference
string

Sora/Veo 相容參考圖入口,可為 multipart 檔案或相容物件。

parameters
object
audio_urls
string<uri>[]

標準 OpenAI/Sora、Seedance 的參考音訊 URL 清單;僅用於支援音訊參考的全能參考路由,與生成輸出音軌開關不同。

resolution
string

輸出解析度,常見值 540p、720p、1080p。

回應

成功建立影片任務

id
string
必填
object
string
必填
model
string
必填
status
enum<string>
必填

Should use VideoStatus constants: VideoStatusQueued, VideoStatusInProgress, VideoStatusCompleted, VideoStatusFailed

可用選項:
queued,
in_progress,
completed,
failed,
video_url,
url,
completed_at
progress
integer
必填
created_at
integer
必填
task_id
string

相容舊介面 待廢棄

completed_at
integer
expires_at
integer
seconds
string
size
string
remixed_from_video_id
string
error
object
metadata
object
output
object
request_id
string