Authorization: Bearer or x-api-key) and governed by the same
per-client rate limits as every other /v1 route. Requests are synchronous —
multi-image or high-quality generations can take tens of seconds, so set client timeouts
accordingly.
Request parameters
Response
The response follows the OpenAI images shape —created (unix seconds), a
data array with one entry per generated image, and an optional
usage object on token-priced models:
- With
response_format: "url"(the default), each image is stored by the gateway and returned as a signed download URL valid for ~24 hours — download promptly and persist on your side. - With
response_format: "b64_json", each entry carries the base64-encoded PNG bytes inline instead. revised_promptappears when the provider rewrites your prompt before generating.
Models & pricing
Token-based models report token counts in the response
usage object. Every
request’s cost is metered against your key exactly like chat traffic and counts toward
the same spend caps.
Reliability. Upstream image backends occasionally stall with a 503 for a
few minutes. There is deliberately no automatic fallback to a different
image model — silently swapping models would change output style and quality — so callers
should retry instead. The SDKs already retry 503s with jittered backoff
up to their configured retry budget.
Using the SDKs
All five SDKs ship an image-generation helper as of SDK v0.4.0, with the same auth, error mapping (401 →AccessDeniedException, 402 →
ServiceQuotaExceededException, 429 → ThrottlingException), and
retry policy as Converse:
invalid_request_error for a
malformed body, 401 invalid_api_key, 402 usage_cap_exceeded when
a spend cap is reached (never retried), and 429 rate_limit_exceeded with a
Retry-After header. See Errors & retries for the
full exception mapping in each SDK.