Skip to main content
Create Gemini image-generation tasks via the async API, then poll with GET to obtain image URLs valid for 24 hours. Ideal for time-consuming 2K / 4K high-resolution generation.

Prerequisite: Object Storage (required)

Async image tasks require configured object storage (S3 or AliOSS) to upload generated images and return 24-hour signed URLs. Without it, the API returns error.code=storage_not_configured.

Endpoints

Base URL: https://api.gregapi.com

Authentication

Task ID format

  • Format: image_<ULID>, e.g. image_01KCRVET35FAVZME1CEEED9VBS
  • task_id is an alias, equal to id

Text-to-image: Create task

Create response:
Poll:

Text-to-image: Query result

Completed response:
Failed response:
no-image billed failure (with usage):

Edit: Create task

Request style: multipart/form-data
Or pass URLs:
Edit async tasks support Gemini image models only. Responses match text-to-image task queries.

Task Status

Polling Strategy

  • interval: 3–10 seconds
  • timeout: 5–15 minutes (depends on server load and resolution)

Sync vs Async