generations (JSON) creates an
image from a prompt, and edits (multipart) edits a source image. Both are translated to the unified
contract and served through the same routing and metering as the other endpoints.
This is the only images surface. There is no native
/v1/images endpoint on the data plane.Authentication
Authenticated with a secret key (rd_sk_…) or a client token
(carrying the ai.images scope). A publishable key is rejected 403.
Shared parameters
Both endpoints accept these fields (the enum values are validated; an unsupported value fails400
unsupported_parameter):
POST /openai/v1/images/generations
POST /openai/v1/images/edits
Each uploaded file is capped at 20 MiB (over which the upload is rejected
413); a maximum of two
file parts are read.
Response
200 OK — an OpenAI Images response. The image bytes are always returned as base64 (b64_json),
never a URL:
created is fixed by the gateway at request start (it never leaks a provider timestamp). data
always holds exactly one image (n is capped at 1). The gateway request id is on the X-Request-Id
response header.
Errors
Errors use the OpenAI envelope; see the error mapping on the chat-completions page. A model that does not support image generation returns404 invalid_request_error
(images_not_supported).