Create async image task
/v1/async/images/tasksCreate a durable asynchronous image-generation task. The endpoint returns HTTP 202 immediately; poll Retrieve async image task for the result.
The synchronous POST /v1/images/generations endpoint is unchanged. See Async Image Generation for the complete workflow.
Authentication
Authorization Bearer
API key as bearer token in the Authorization header.
Headers
Idempotency-KeystringRecommended retry key, scoped to the authenticated owner. Maximum 200 characters.
Request Body
modelstringrequiredPublic image model name.
promptstringImage prompt. Requirements depend on the selected model.
executionenum<string>Execution preference.
nintegerNumber of images.
sizestringRequested image size, for example 1024x1024.
qualitystringRequested image quality when supported by the model.
output_formatstringRequested output format when supported by the model.
streambooleanMust be false or omitted.
partial_imagesintegerNot supported; omit this field.
Additional model-specific image fields accepted by the synchronous image API may be supplied.
Response
idstringTask ID with img_task_ prefix.
objectstringimage_generation.task
modelstringPublic model name.
statusstringInitial status, normally queued.
executionenum<string>Requested preference, then resolved execution mode when available.
versionintegerMonotonically increasing task version.
resultobjectImage response when an idempotent replay returns an already completed task.
errorobjectError details when an idempotent replay returns a failed or needs_attention task.
error.messagestringHuman-readable error message.
error.codestringMachine-readable error code.
error.typestringError category when returned.
error.stagestringProcessing stage where the error occurred.
error.upstream_http_statusintegerProvider HTTP status when the error came from upstream.
error.upstream_messagestringProvider error message when available.
created_atstringISO-8601 creation time.
updated_atstringISO-8601 last update time.
completed_atstringISO-8601 completion time when terminal.