Generate an AI video clip
generate_video_clipCosts the model's per-second price for the chosen resolution and audio, charged only after confirm_cents matches the quote: starts one AI video clip.
Args: prompt: 1-4000 chars. model: a video model id from list_models. seconds: 1-60. Snapped to the nearest length the model allows (the durations listed by list_models; a tie takes the shorter); the answer says the real length. resolution: e.g. 720p (required: it changes the price). generate_audio: true or false (required: it changes the price). aspect: e.g. 9:16. first_frame_library_id: an image id to start the clip from (optional). reference_library_ids: up to 4 image ids (optional; each can add to the price). confirm_cents: the price the user agreed to (from tool_cost_estimate); 0 with quote_only. idempotency_key: unique per purchase; a retry with the same key never buys twice. Idempotency is keyed on (this token, this tool, idempotency_key), not on the arguments: reusing an idempotency_key with different arguments returns the first result. quote_only: true returns the price and buys nothing.
Returns: {ok, job_id, kind:'video', poll_after_s, model, duration, resolution, cents}: poll with wait_for_job; the finished clip lands in your Library A job that fails is refunded to the balance, but it still counts toward this token's daily limit until midnight UTC.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>",
"model": "<model>",
"seconds": "<seconds>",
"resolution": "<resolution>",
"generate_audio": "<generate_audio>",
"confirm_cents": "<confirm_cents>"
},
"name": "generate_video_clip"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| aspect | No | ||
| prompt | Yes | ||
| seconds | Yes | ||
| quote_only | No | true: return the price and buy nothing. | |
| resolution | Yes | ||
| confirm_cents | Yes | The price in cents the user agreed to, from tool_cost_estimate or a quote_only call. Pass 0 with quote_only. | |
| generate_audio | Yes | ||
| idempotency_key | No | Any unique string per purchase; a retry with the same key never buys twice. | |
| reference_library_ids | No | ||
| first_frame_library_id | No | The generationId from library_list. |