Generate an image
POST/v1/images/generations
Draws one image from a description, optionally after reference images. Answers 202 with the queued generation; poll GET /v1/images/{image_id} until it has completed (its files then hold the result) or failed. Starting one needs a spendable balance on the project's billing account, and an end user may have 3 generations unfinished at a time.
Request
Responses
- 202
- 401
- 404
- 409
- 413
- 422
- 429
- 500
Successful Response
Authentication failed: the credential is missing, malformed, expired, or revoked.
invalid_token— The access token is invalid.project_disabled— This project is not active.token_expired— The access token has expired.user_disabled— This user is not active.
The requested resource does not exist, or is not visible to the caller.
file_not_found— The requested file was not found.file_expired— The requested file has expired.
The request conflicts with the current state of the resource.
idempotency_conflict— This Idempotency-Key belongs to a different request.idempotency_in_progress— The first request with this Idempotency-Key is still in progress. Retry it with the same key shortly.
The request body is larger than the allowed limit.
payload_too_large— The request body is too large.
A request value failed validation; the details array names each offending field.
validation_failed— The request payload failed validation.
Either too many requests (a Retry-After header says when to retry) or the billing account is out of credits (no Retry-After — top up to continue); the code field tells the two apart.
insufficient_credits— The billing account has insufficient credits.rate_limited— Too many requests. Please slow down.
An unexpected server-side error occurred.
internal— An unexpected error occurred.