GRGlobalRouter Docs
Console

Images / GET

Get image task

Query asynchronous image task status, artifacts, and billing summary.

GET /api/v1/image-tasks/{image_task_id}

Poll the image.task returned by Create image task. Queries only read persisted state, do not poll the provider, and do not add charges. Ownership is checked against the API key tenant.

Back to Images endpoint list

Request parameters

FieldTypeRequiredDescription
image_task_idstringYesPath parameter: GR image task ID returned by Create image task, such as imgtask_xxx.

Request examples

Get image task request examples
curl "https://api.globalrouter.com/api/v1/image-tasks/imgtask_xxx" \
  -H "Authorization: Bearer $GR_API_KEY"

Response fields

FieldTypeRequiredDescription
idstringYesGR virtual image task ID.
objectstringYesAlways image.task.
statusstringYesStatus such as queued, submitting, submitted, in_progress, completed, failed, or expired.
modelstringYesModel requested at task creation.
providerstringYesProvider fixed at task creation.
polling_urlstringYesRelative URL for polling task status.
created_atintegerNoTask creation time in Unix seconds.
updated_atintegerNoTask update time in Unix seconds.
completed_atintegerNoTask completion time in Unix seconds.
dataobject[]NoImage details returned after completed.
data[].urlstringNoImage URL.
data[].b64_jsonstringNoBase64 image content.
data[].media_typestringNoImage MIME type.
usageobjectNoUsage summary after the background polling worker finalizes billing.
errorobjectNoFailure reason.
metadataobjectNoClient metadata saved at task creation.

Response example

Response example
{
  "id": "imgtask_xxx",
  "object": "image.task",
  "status": "completed",
  "model": "jimeng_t2i_v31",
  "provider": "doubao_gr",
  "polling_url": "/api/v1/image-tasks/imgtask_xxx",
  "created_at": 1770000000,
  "updated_at": 1770000042,
  "completed_at": 1770000042,
  "data": [
    {
      "index": 0,
      "url": "https://example.com/generated.png",
      "b64_json": null,
      "media_type": "image/png",
      "width": null,
      "height": null,
      "expires_at": null
    }
  ],
  "usage": {
    "image_count": 1,
    "billing_status": "finalized",
    "cost_usd": 0,
    "usage_record_id": "usage_xxx",
    "details": {
      "quantity": 1,
      "image_count": 1,
      "usage_source": "provider"
    }
  },
  "error": null,
  "metadata": {
    "client_request_id": "client-001"
  }
}

Errors

HTTPCodeDescription
401ROUTER_AUTHENTICATION_FAILEDMissing or invalid API key.
404ROUTER_IMAGE_TASK_NOT_FOUNDThe task does not exist or belongs to a different tenant than the current API key.

Notes

  • GET queries only read persisted state; they do not poll the provider or add charges.
  • If the task is queued, submitted, or in_progress, continue polling polling_url.
  • After completed, data contains image URLs or b64_json; check error for failed/expired tasks.