Generate AI image

Generate an image from a text prompt using your choice of AI model. Async — returns 202 with a pending job; poll GET /tool_jobs/{uid} until status is completed or failed.

post/tools/generate_ai_image

Request body

promptstring required

What to generate — describe the subject, style and composition

model'flux_schnell' | 'flux_1_1_pro' | 'nano_banana' | 'gpt_image_2' required

Costs vary by model — see the credit cost shown for each

aspect_ratio'1:1' | '16:9' | '9:16' | '4:3' | '3:4'

Defaults to square

reference_image_urlstring uri

Optional starting point — only some models accept one

metadatastring

Arbitrary metadata string stored with the tool run

Response

Tool run accepted

uidstring
tool'generate_ai_image'
status'pending' | 'running' | 'completed' | 'failed'

pending → running → completed / failed

progressinteger

0-100 job progress, 100 once completed

inputsobject

Inputs the job was created with

metadatastring nullable

Arbitrary metadata string round-tripped from the create request

selfstring uri
created_atstring date-time
completed_atstring date-time nullable
error_messagestring nullable

Human-readable failure reason (only present on failed jobs)

Changes

No recorded changes to this endpoint across all 1 revision of this API.