Skip to content

Query a Task

GET /v1/tasks/{id}

bash
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

json
{
  "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=..."
    }
  ]
}
FieldDescription
statusCurrent task status.
actual_costFinal charge in USD. Present after successful settlement when non-zero; failed, timed-out, and canceled tasks are not charged.
timelineOrdered list of status transitions with timestamps.
diagnosticsImage result diagnostics. If upstream returns a different count or size, the task can still be succeeded; mismatch details are recorded here.
processing_errorOptional result-processing summary. Asset persistence failures move the task to failed or timeout; inspect code and message and do not rely on assets.
resultPlatform-standard result. data contains transferred assets while other standard fields are preserved. Raw provider responses are not returned to regular users.
result.dataCompatibility mirror of assets for clients that only read result.
assetsCommon 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:

json
{
  "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

FieldDescription
indexStable zero-based asset index within the task.
kindAsset type such as image, video, audio, or model.
content_typeActual MIME type after server-side download and validation.
size_bytesActual file size.
urlSigned, time-limited download URL.
metadataOptional sparse media fields from the server's public allowlist; arbitrary upstream responses are not exposed.
expires_atExpiration 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:

json
{
  "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

StatusCause
401Missing or invalid API key.
403API key is not enabled for Task API.
404Task not found, or belongs to a different API key.
503Task API is disabled or temporarily unavailable.