Async Jobs
Get Task Status
Retrieve the status and result of any async task using the poll_url returned by create endpoints
Overview
Use this endpoint for unified async polling across task types such as video, image, music, and 3D generation.
If a create response includes poll_url, call that exact path. Some image models may return task-based responses under either an image-specific status path or /v1/tasks/{id}.
Path Parameters
The task ID returned by the create request.
Response
Fields describing results, errors, timestamps, and the model are returned when available for the task.
Canonical async task identifier.
Async task identifier alias.
Preferred polling URL when the create response supplies one.
Task status such as pending, processing, completed, or failed. Cancelled tasks are represented as failed with cancelled: true.
true when a queued async task was cancelled before execution.
Cancellation marker. Present as cancelled when cancellation succeeds.
For completed image tasks, generated image results are returned here. Image tasks return URLs in data[].url.
Optional progress value. Returned only when a real progress value is available; use status to determine completion.
Result asset URL when the task completes and produces a video.
Single video payload with url, duration, width, and height when available.
Multiple video payloads when more than one output is available.
Error message when the task fails.
Creation timestamp when available.
Last update timestamp when available.
Model used by the task when available.
Error Behavior
An expired or unavailable public task can return 404 async_task_not_found. If task ownership cannot be established for the current API key, the response is 403 task_not_owned.
{
"error": {
"message": "Task not found or no longer available.",
"type": "invalid_request_error",
"code": "async_task_not_found"
}
}Examples
Request
curl "https://api.tokenlab.sh/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-H "Authorization: Bearer sk-your-api-key"import requests
poll_url = "/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
response = requests.get(
f"https://api.tokenlab.sh{poll_url}",
headers={"Authorization": "Bearer sk-your-api-key"},
)
print(response.json())const pollUrl = '/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
const response = await fetch(`https://api.tokenlab.sh${pollUrl}`, {
headers: { Authorization: 'Bearer sk-your-api-key' },
});
console.log(await response.json());{ "id": "string", "status": "pending", "progress": 0, "created": 0, "updated": 0, "model": "string", "video": { "url": "string", "duration": 0, "width": 0, "height": 0 }, "error": "string", "error_details": { "projection_version": 0, "status": 400, "message": "string", "type": "string", "code": "string", "param": "string", "retryable": true, "upstream": { "source": "string", "code": "string", "message": "string", "param": "string" } }, "task_id": "string", "poll_url": "string", "cancelled": true, "cancellation_status": "cancelled", "billing_transaction_id": "string", "video_url": "string", "videos": [ {} ], "data": [ {} ], "audio_url": "string", "title": "string", "lyrics": "string", "model_url": "string", "glb_url": "string", "fbx_url": "string"}Authorization
BearerAuth API Key authentication. Create or manage API keys in Dashboard > API > API Keys.
In: header
Path Parameters
The async task ID returned by id / task_id, or embedded in poll_url
Response
application/json
application/json
application/json
application/json