建立影片生成工作

post/v1/video/generations

提交影片生成工作。支援文字轉影片與圖片轉影片。

回傳工作 ID,可透過 GET 端點輪詢。

驗證

把 OLETOKEN 的 API Key 作為 Bearer Token 放進 Authorization 請求標頭。金鑰在控制台的「API 金鑰」頁建立。

Authorization: Bearer $OLETOKEN_API_KEY

請求主體

Content-Type:application/json

欄位類型必填說明
modelstring—模型或風格 ID
promptstring—文字 Prompt
imagestring—圖片輸入(URL 或 Base64)
durationnumber—影片長度(秒)
widthinteger—影片寬度
heightinteger—影片高度
fpsinteger—影片影格率
seedinteger—隨機種子
ninteger—要生成的影片數量
response_formatstring—回應格式
userstring—使用者識別碼
metadataobject—額外參數(例如 negative_prompt、style、quality_level)

回應

200已建立影片生成工作

欄位類型必填說明
task_idstring—工作 ID
statusstring—工作狀態

400請求參數無效

欄位類型必填說明
errorobject——
messagestring—錯誤訊息
typestring—錯誤類型
paramstring | null—相關的參數
codestring | null—錯誤代碼

請求範例

curl -X POST 'https://api.oletoken.ai/v1/video/generations' \
  -H "Authorization: Bearer $OLETOKEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "kling-v1",
    "prompt": "宇航员在月球上漫步",
    "duration": 5,
    "width": 1280,
    "height": 720
  }'