建立影片
post/v1/videos
與 OpenAI 相容的影片生成端點。
參考:https://platform.openai.com/docs/api-reference/videos/create
驗證
把 OLETOKEN 的 API Key 作為 Bearer Token 放進 Authorization 請求標頭。金鑰在控制台的「API 金鑰」頁建立。
Authorization: Bearer $OLETOKEN_API_KEY請求主體
Content-Type:multipart/form-data
| 欄位 | 類型 | 必填 | 說明 |
|---|---|---|---|
| model | string | — | 模型名稱 |
| prompt | string | — | Prompt |
| seconds | string | — | 長度(秒) |
| input_reference | string | — | 參考圖片檔案 |
回應
200已建立影片工作
| 欄位 | 類型 | 必填 | 說明 |
|---|---|---|---|
| id | string | 影片 ID | |
| object | string | 物件類型 | |
| model | string | 實際使用的模型 | |
| status | string | 工作狀態 | |
| progress | integer | 進度百分比 | |
| created_at | integer | 建立時間戳記 | |
| seconds | string | 影片長度 | |
| completed_at | integer | — | 完成時間戳記 |
| expires_at | integer | — | 到期時間戳記 |
| size | string | — | 影片大小 |
| error | OpenAIVideoError | — | — |
| message | string | — | 錯誤訊息 |
| code | string | — | 錯誤代碼 |
| metadata | object | — | 額外中繼資料 |
400請求參數無效
| 欄位 | 類型 | 必填 | 說明 |
|---|---|---|---|
| error | object | — | — |
| message | string | — | 錯誤訊息 |
| type | string | — | 錯誤類型 |
| param | string | null | — | 相關的參數 |
| code | string | null | — | 錯誤代碼 |
請求範例
curl -X POST 'https://api.oletoken.ai/v1/videos' \
-H "Authorization: Bearer $OLETOKEN_API_KEY"
