Skip to main content
POST
cURL
使用此端點建立 Wan 文字轉影片任務。API 會立即回傳任務 ID,因此請儲存回傳的 id,並持續輪詢任務直到其進入終態狀態。 POST /v1/videos 使用 multipart/form-data;請將純量控制項作為表單欄位傳遞。

選擇模型

設定時長與尺寸

size 設定為下方目標模型支援的其中一個 WxH 值。

Wan 2.7 尺寸值

Wan 2.6 尺寸值

任務流程

1

建立任務

傳送 multipart 表單請求並儲存回傳的 id
2

輪詢任務

呼叫 擷取 Wan 影片,直到 statuscompletedfailederror
3

下載結果

當任務為 completed 時,呼叫 擷取 Wan 影片內容 以下載 MP4 檔案。

授權

Authorization
string
header
必填

Bearer authentication. Use your CometAPI API key.

主體

multipart/form-data
model
enum<string>
必填

Wan model ID for this endpoint.

可用選項:
wan2.6,
wan2.7
範例:

"wan2.6"

prompt
string
必填

Text prompt that describes the video to generate.

範例:

"A small robot walks through a bright greenhouse with smooth camera movement."

seconds
string

Requested clip duration in seconds. For wan2.6, use 5, 10, or 15. For wan2.7, use an integer from 2 through 15. Default is 5.

範例:

"5"

size
string

Supported WxH size values. For wan2.6: 1280x720, 720x1280, 1088x832, 832x1088, 1920x1080, 1080x1920, 1440x1440, 1632x1248, 1248x1632. For wan2.7: 1280x720, 720x1280, 1920x1080, 1080x1920, 1440x1440. Default is 1920x1080.

範例:

"1280x720"

回應

Task created. Store the returned id and poll GET /v1/videos/{task_id}.

id
string
必填

Task ID. Use this value with retrieve and content endpoints.

範例:

"task_example"

object
string
必填

Object type. Video tasks return video.

範例:

"video"

model
string
必填

Model ID used for the task.

範例:

"wan2.6"

status
enum<string>
必填

Task lifecycle status. Poll until the value is completed, failed, or error.

可用選項:
queued,
in_progress,
completed,
failed,
error
範例:

"queued"

progress
integer
必填

Task progress as a coarse percentage.

必填範圍: 0 <= x <= 100
範例:

0

created_at
integer
必填

Task creation time as a Unix timestamp in seconds.

範例:

1779938152

task_id
string

Compatibility alias for id when present.

範例:

"task_example"

completed_at
integer

Task completion time as a Unix timestamp in seconds. This field appears on completed tasks.

範例:

1779938219

video_url
string

Temporary video delivery URL. This field appears on completed tasks.

範例:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.