v1 preview
API REFERENCE/Query a task
API PREVIEWv1

Query a task

Read each result as it finishes, with its own status and cost.

Platform preview. Real model providers are not connected yet. Requests and prices below describe the intended contract; examples are not live generation results.

GET/v1/tasks/YOUR_TASK_ID

Follow the whole lifecycle

StateMeaning
queued / runningWaiting for capacity or generating.
falling_backAn eligible failed item is switching routes.
reconciliation_requiredThe upstream result is unknown; do not resubmit.
succeededAll target items succeeded.
partially_succeededAll items are final, and some succeeded.
failed / cancelledFinal failure, or a confirmed cancellation where supported.

Read individual items

The same parent can contain low-cost and official successes. Never assume the final item’s channel applies to every result. This simplified example omits output URLs, errors, and timestamps.

Illustrative final response / 示例终态
{
  "task_id": "task_example",
  "status": "partially_succeeded",
  "output_count": 4,
  "counts": {
    "succeeded": 3,
    "failed": 1,
    "cancelled": 0,
    "pending": 0
  },
  "billing": {
    "initial_reserved_credits": 240,
    "charged_credits": 100,
    "released_credits": 140,
    "remaining_reserved_credits": 0
  },
  "items": [
    {
      "index": 0,
      "item_id": "item_1",
      "status": "succeeded",
      "final_channel_type": "third_party",
      "charged_credits": 20
    },
    {
      "index": 1,
      "item_id": "item_2",
      "status": "succeeded",
      "final_channel_type": "third_party",
      "charged_credits": 20
    },
    {
      "index": 2,
      "item_id": "item_3",
      "status": "succeeded",
      "final_channel_type": "official",
      "charged_credits": 60
    },
    {
      "index": 3,
      "item_id": "item_4",
      "status": "failed",
      "final_channel_type": null,
      "charged_credits": 0
    }
  ]
}

Poll without creating extra work

Query the existing task ID at intervals, honor Retry-After, and add backoff when a task takes longer. Read already completed items while other items are running. Do not hold a new generation request open as a polling mechanism.

Download before the returned expires_at. File expiry does not change the historical success state or automatically refund credits.

Was this page useful?Something unclear?