Skip to main content
GET
  • Query async image generation task execution status and results
  • Real-time status updates and progress tracking
  • Get generated images when task completes
  • Multi-language support (zh/en/ko/ja)
All image generation tasks are executed asynchronously. After submitting a task, you need to query the status and results via the query endpoint.

Authorizations

string
required
All endpoints require Bearer Token authenticationGet your API Key:Visit the API Key Management Page to get your API KeyAdd it to the request header:

Path Parameters

string
required
Task ID returned by the image generation API

Response

string
Unique task identifier
string
Object type, always generation.task
string
Task status
  • queued - Queued for processing
  • in_progress - Processing
  • completed - Successfully completed
  • failed - Failed
string
Image generation model used
integer
Task creation time (Unix timestamp)
integer
Task completion time (Unix timestamp, only returned when completed)
string
Generated image URL (only returned on success)
integer
Image URL expiration time (Unix timestamp, only returned on completion)
object
Task result (only returned on success)
object
Error information (only returned on failure)

Task Status Reference

Polling Strategy

Python Polling Example

Resource Expiration

Generated image URLs are valid for 24 hours
  • Please download and save images within the validity period
  • expires_at field indicates image expiration time (Unix timestamp)
  • Expired images cannot be accessed; to regenerate, submit a new task

Error Codes

ToAPIs provides a unified Task Webhook. Prefer callbacks and use polling as fallback. Poll every 5–10 seconds or slower with jitter and honor Retry-After on 429. Batch queries accept at most 100 task IDs; see rate limits.