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 listRequest parameters
| Field | Type | Required | Description |
|---|---|---|---|
image_task_id | string | Yes | Path parameter: GR image task ID returned by Create image task, such as imgtask_xxx. |
Request examples
curl "https://api.globalrouter.com/api/v1/image-tasks/imgtask_xxx" \ -H "Authorization: Bearer $GR_API_KEY"
Response fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | GR virtual image task ID. |
object | string | Yes | Always image.task. |
status | string | Yes | Status such as queued, submitting, submitted, in_progress, completed, failed, or expired. |
model | string | Yes | Model requested at task creation. |
provider | string | Yes | Provider fixed at task creation. |
polling_url | string | Yes | Relative URL for polling task status. |
created_at | integer | No | Task creation time in Unix seconds. |
updated_at | integer | No | Task update time in Unix seconds. |
completed_at | integer | No | Task completion time in Unix seconds. |
data | object[] | No | Image details returned after completed. |
data[].url | string | No | Image URL. |
data[].b64_json | string | No | Base64 image content. |
data[].media_type | string | No | Image MIME type. |
usage | object | No | Usage summary after the background polling worker finalizes billing. |
error | object | No | Failure reason. |
metadata | object | No | Client metadata saved at task creation. |
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
| HTTP | Code | Description |
|---|---|---|
| 401 | ROUTER_AUTHENTICATION_FAILED | Missing or invalid API key. |
| 404 | ROUTER_IMAGE_TASK_NOT_FOUND | The 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.