Poll a video generation task
Retrieve the status and result of a video generation task.
Call with the `taskId` returned by the submit endpoint and poll
periodically (e.g. every 5-10 seconds) until `status` is terminal. On
`succeeded`, `output.video_url` holds the generated video; on `failed`,
`error` holds the reason.
Available to CONTRACT-tier API keys only. The first poll that observes
`succeeded` charges the task cost in USD from the account wallet and
returns the provider token usage in `meta.tokensUsage`. Polls of an
already-terminal task return the cached result and are not charged. The
per-call response carries no USD amount — derive cost from
`meta.tokensUsage` and the published video pricing, or call
`GET /openapi/v2/account/balance`.
Path parameter:
- `task_id` (string, required): the `taskId` from the submit call.
Returns 404 if it does not exist or belongs to another account.
Response `data`:
- `taskId` (string): the polled task id.
- `status` (string): one of `pending`, `running`, `succeeded`,
`failed`, `cancelled`. The last three are terminal.
- `output` (object | null): on `succeeded`, an object with
`video_url` plus any additional provider fields; `null` otherwise.
- `error` (object | null): on `failed`, a `{code, message}` object
with the provider failure reason; `null` otherwise.
Response `meta`:
- `tokensUsage` (object | null): provider token usage
(`completionTokens`, `totalTokens`, ...) on any terminal poll;
`null` while `pending` / `running`.
### Responses:
**200**: Successful Response (Success Response)
Content-Type: application/json
**Example Response:**
```json
{
"success": true,
"meta": {
"requestId": "Requestid",
"timestamp": "Timestamp"
}
}
```
**Output Schema:**
```json
{
"properties": {
"success": {
"type": "boolean",
"title": "Success",
"description": "Whether the request was successful",
"default": true
},
"data": {
"description": "Response data payload"
},
"error": {
"description": "Error details if request failed"
},
"meta": {
"description": "Metadata for API responses.\n\nCredit fields follow the ADR-0003 parallel-fields strategy (Option 3):\n- `credits_remaining` / `credits_consumed` (int): legacy fields, rounded\n to whole credits, kept for zero-breaking-change to existing SDK clients.\n- `credits_remaining_exact` / `credits_consumed_exact` (float): new\n precision-aware fields for clients that opt in to decimal credits.\n\nSee ADR-0003 decision 5 and the \u00a78 deprecation timeline.\n\nTODO(2026-11, ADR-0003 \u00a78 +6mo): mark `credits_remaining` /\n`credits_consumed` as `deprecated=True` in their Field() definitions\nand announce in customer changelog.\nTODO(2027-05, ADR-0003 \u00a78 +12mo): remove the legacy int fields via a\nmajor-version bump of the OpenAPI surface.",
"properties": {
"requestId": {
"type": "string",
"title": "Requestid",
"description": "Unique request identifier"
},
"timestamp": {
"type": "string",
"title": "Timestamp",
"description": "Response timestamp in ISO 8601 format"
},
"total": {
"title": "Total",
"description": "Total number of records"
},
"page": {
"title": "Page",
"description": "Current page number"
},
"pageSize": {
"title": "Pagesize",
"description": "Number of records per page"
},
"totalPages": {
"title": "Totalpages",
"description": "Total number of pages"
},
"creditsRemaining": {
"title": "Creditsremaining",
"description": "Remaining API credits (rounded to whole credits; see creditsRemainingExact for precise value)"
},
"creditsConsumed": {
"title": "Creditsconsumed",
"description": "Credits consumed by this request (rounded; see creditsConsumedExact for precise value)"
},
"creditsRemainingExact": {
"title": "Creditsremainingexact",
"description": "Remaining API credits, precise to 1 decimal place"
},
"creditsConsumedExact": {
"title": "Creditsconsumedexact",
"description": "Credits consumed by this request, precise to 1 decimal place"
},
"tokensUsage": {
"description": "Provider token-usage block \u2014 populated on terminal video polls only, null on every non-video endpoint. See TokensUsage for its fields."
}
},
"type": "object",
"required": [
"requestId",
"timestamp"
],
"title": "ResponseMeta"
}
},
"type": "object",
"required": [
"meta"
],
"title": "OpenApiResponse[VideoTaskData]",
"examples": []
}
```
**422**: Validation Error
Content-Type: application/json
**Example Response:**
```json
{
"detail": [
{
"loc": [],
"msg": "Message",
"type": "Error Type",
"ctx": {}
}
]
}
```
**Output Schema:**
```json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
},
"input": {
"title": "Input"
},
"ctx": {
"type": "object",
"title": "Context"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}
```