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/imagesSend 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_referencesto guide the result with existing images. - Shape the output -
aspect_ratioon every model, plusqualityorresolutionto control how much detail the model spends.
Browse available models at Models.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/images | Create 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": "..." } }| Status | error.type | Meaning |
|---|---|---|
400 | invalid_request_error | Schema violation, unsupported parameter value, or content policy rejection. |
401 | authentication_error | Missing or invalid API key. |
402 | billing_error | Account out of credit or hit a spend limit. |
429 | rate_limit_error | RPM exceeded. Respect Retry-After. |
500 | internal_server_error | Unexpected gateway failure. |