Skip to main content
GET
Get an asynchronous image task
Poll this endpoint while status is queued or in_progress. Responses use Cache-Control: no-store; a missing task and a task owned by another account both return HTTP 404. On completed, select the parser from model:
  • Nano Banana: scan result.candidates[].content.parts[] for inlineData, then use the byte-corrected mimeType and Base64 data.
  • GPT Image: decode result.data[].b64_json from the native ImagesResponse. No gateway-specific mime_type is added.
Successful responses include result_expires_at. Image results remain retrievable for 24 hours after completion. After cleanup, the task reports expired with error.code=result_expired and no old Base64 payload. On failed, use error.code to classify the failure, show the safe error.message, and retry only when error.retryable is true and your own deadline still allows another task.

Use the polling implementation

Apply a deadline, Retry-After, bounded backoff, and model-specific parsing.

Review asynchronous submission

Add idempotency and understand multi-image input and expiry.

Submit an image task

Use the supported generation or editing request branch.

Diagnose task failures

Map structured errors to safe retry decisions.

Authorizations

Authorization
string
header
required

YingTu API key.

Path Parameters

task_id
string
required

Task ID returned by POST /v1/images/tasks.

Response

Current task state

task_id
string
required
model
enum<string>
required
Available options:
gemini-2.5-flash-image,
gemini-3.1-flash-lite-image,
gemini-3.1-flash-image,
gemini-3-pro-image,
gpt-image-2-web,
gpt-image-2-vip
action
enum<string>
required

Requested image task action.

Available options:
generate,
edit
status
enum<string>
required
Available options:
queued,
in_progress,
completed,
failed,
expired
progress
string
required
Example:

"100%"

created_at
integer<int64>
required
started_at
integer<int64>
completed_at
integer<int64>
result_expires_at
integer<int64>

Unix timestamp when a successful result expires, normally 24 hours after completion.

result
object

Provider-native result: GenerateContentResponse for Nano Banana or ImagesResponse for GPT Image.

error
object
Last modified on September 3, 2026