Query a Task
GET /v1/tasks/{id}
curl https://api.llmapi.site/v1/tasks/8b17fd33b0e947a08cb417e81e9ea9da \
-H 'Authorization: Bearer YOUR_TASK_API_KEY'SSE and polling are both supported. When polling, start at one second, exponentially back off to ten seconds, add a small random jitter, and stop when status is succeeded, failed, timeout, or canceled.
Response — 200 OK
{
"id": "8b17fd33b0e947a08cb417e81e9ea9da",
"status": "succeeded",
"modality": "image",
"model": "gpt-image-2",
"created_at": "2026-06-22T03:10:00Z",
"started_at": "2026-06-22T03:10:02Z",
"finished_at": "2026-06-22T03:10:42Z",
"estimated_cost": 0.1,
"actual_cost": 0.1,
"timeline": [
{ "status": "queued", "at": "2026-06-22T03:10:00Z" },
{ "status": "running", "at": "2026-06-22T03:10:02Z" },
{ "status": "succeeded", "at": "2026-06-22T03:10:42Z" }
],
"diagnostics": {
"requested_image_count": 2,
"actual_image_count": 1,
"image_count_mismatch": true,
"requested_image_size": "1K",
"actual_image_size": "2K",
"image_size_mismatch": true,
"size_capability": "upscaled",
"size_source": "requested",
"mismatch_reason": "image_count_and_size_mismatch",
"recorded_at": "2026-06-22T03:10:42Z"
},
"result": {
"data": [
{
"index": 0,
"kind": "image",
"url": "https://api.llmapi.site/api/v1/task-assets/8b17fd33b0e947a08cb417e81e9ea9da/0?expires=...",
"content_type": "image/png",
"size_bytes": 1048576
}
]
},
"assets": [
{
"index": 0,
"kind": "image",
"content_type": "image/png",
"size_bytes": 1048576,
"url": "https://api.llmapi.site/api/v1/task-assets/8b17fd33b0e947a08cb417e81e9ea9da/0?expires=..."
}
]
}| Field | Description |
|---|---|
status | Current task status. |
actual_cost | Final charge in USD. Present after successful settlement when non-zero; failed, timed-out, and canceled tasks are not charged. |
timeline | Ordered list of status transitions with timestamps. |
diagnostics | Image result diagnostics. If upstream returns a different count or size, the task can still be succeeded; mismatch details are recorded here. |
processing_error | Optional result-processing summary. Asset persistence failures move the task to failed or timeout; inspect code and message and do not rely on assets. |
result | Platform-standard result. data contains transferred assets while other standard fields are preserved. Raw provider responses are not returned to regular users. |
result.data | Compatibility mirror of assets for clients that only read result. |
assets | Common result asset list for images, video, audio, and 3D models. |
Video Result Example
A successful video uses the same platform assets and preserves the standardized duration:
{
"id": "75d9fb6592f64a75a4bd8f868db31752",
"status": "succeeded",
"modality": "video",
"model": "seedance-2-0-fast",
"estimated_cost": 0.75,
"actual_cost": 0.75,
"result": {
"duration": 5,
"data": [
{
"index": 0,
"kind": "video",
"content_type": "video/mp4",
"size_bytes": 8388608,
"url": "https://api.llmapi.site/api/v1/task-assets/75d9fb6592f64a75a4bd8f868db31752/0?expires=..."
}
]
},
"assets": [
{
"index": 0,
"kind": "video",
"content_type": "video/mp4",
"size_bytes": 8388608,
"url": "https://api.llmapi.site/api/v1/task-assets/75d9fb6592f64a75a4bd8f868db31752/0?expires=..."
}
]
}The server stores a redacted upstream terminal response with large inline fields removed for administrator troubleshooting. Regular Task API responses expose only the platform-standard result. Token usage in an upstream response does not currently affect video billing.
Common Asset Fields
| Field | Description |
|---|---|
index | Stable zero-based asset index within the task. |
kind | Asset type such as image, video, audio, or model. |
content_type | Actual MIME type after server-side download and validation. |
size_bytes | Actual file size. |
url | Signed, time-limited download URL. |
metadata | Optional sparse media fields from the server's public allowlist; arbitrary upstream responses are not exposed. |
expires_at | Expiration time for the current signed URL. |
Configured video routes return one transferred video file through the same assets field. The stable fields are index, kind, content_type, size_bytes, and the download URL. The current video transfer path does not derive a portable width, height, duration, frame-rate, or audio metadata schema. No 3D adapter is available yet.
Asset URLs are signed and time-limited. Use Download Assets with the Task API key for a stable authenticated download. Internal object keys are not public asset fields. Do not depend on optional metadata for routing or billing.
Result-processing error example:
{
"status": "failed",
"processing_error": {
"code": "processing_failed",
"message": "Result asset processing failed"
}
}When result processing exceeds its allowed window, processing_error.code may be timeout.
Errors
| Status | Cause |
|---|---|
401 | Missing or invalid API key. |
403 | API key is not enabled for Task API. |
404 | Task not found, or belongs to a different API key. |
503 | Task API is disabled or temporarily unavailable. |