建立影片生成工作
post/v1/video/generations
提交影片生成工作。支援文字轉影片與圖片轉影片。
回傳工作 ID,可透過 GET 端點輪詢。
驗證
把 OLETOKEN 的 API Key 作為 Bearer Token 放進 Authorization 請求標頭。金鑰在控制台的「API 金鑰」頁建立。
Authorization: Bearer $OLETOKEN_API_KEY請求主體
Content-Type:application/json
| 欄位 | 類型 | 必填 | 說明 |
|---|---|---|---|
| model | string | — | 模型或風格 ID |
| prompt | string | — | 文字 Prompt |
| image | string | — | 圖片輸入(URL 或 Base64) |
| duration | number | — | 影片長度(秒) |
| width | integer | — | 影片寬度 |
| height | integer | — | 影片高度 |
| fps | integer | — | 影片影格率 |
| seed | integer | — | 隨機種子 |
| n | integer | — | 要生成的影片數量 |
| response_format | string | — | 回應格式 |
| user | string | — | 使用者識別碼 |
| metadata | object | — | 額外參數(例如 negative_prompt、style、quality_level) |
回應
200已建立影片生成工作
| 欄位 | 類型 | 必填 | 說明 |
|---|---|---|---|
| task_id | string | — | 工作 ID |
| status | string | — | 工作狀態 |
400請求參數無效
| 欄位 | 類型 | 必填 | 說明 |
|---|---|---|---|
| error | object | — | — |
| message | string | — | 錯誤訊息 |
| type | string | — | 錯誤類型 |
| param | string | null | — | 相關的參數 |
| code | string | 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
}'
