Images

Generate and edit images with one endpoint for every image model.

One endpoint covers every image model, whether it is generating from scratch or working from images you supply.

POST /v1/images

Send a prompt on its own to generate. Attach input_references and the same request becomes reference-guided, so editing, remixing and style transfer are all the same call with the same parameters.

What you can do

  • Generate images - create images from text descriptions.
  • Edit and remix - pass input_references to guide the result with existing images.
  • Shape the output - aspect_ratio on every model, plus quality or resolution to control how much detail the model spends.

Browse available models at Models.

Endpoints

MethodEndpointDescription
POST/v1/imagesCreate image

Every endpoint expects a bearer token in the Authorization header. Create keys at Manage API Keys.

Errors

All errors follow the OpenAI structured shape:

{ "error": { "type": "invalid_request_error", "message": "..." } }
Statuserror.typeMeaning
400invalid_request_errorSchema violation, unsupported parameter value, or content policy rejection.
401authentication_errorMissing or invalid API key.
402billing_errorAccount out of credit or hit a spend limit.
429rate_limit_errorRPM exceeded. Respect Retry-After.
500internal_server_errorUnexpected gateway failure.