Endpoints
Use
capabilities.endpoint from GET /v1/models to know which endpoint to call:"/v1/images/generations"→POST /v1/images/generations(text-to-image)"/v1/images/edits"→POST /v1/images/edits(image-to-image)
POST /v1/images/generations
Synchronous text-to-image. Returns the image URL directly with HTTP 200.Request
string
required
Bearer <your-token>string
required
application/jsonBody
string
required
Model ID. Accepted:
gpt-image-2, gpt-image-2/text-to-image, gpt-image-1, gpt-image-1/text-to-image, dall-e-3, dall-e-3/text-to-image, gpt-image-2.5-flare, gpt-image-2.5-flare/text-to-image, gpt-image-2.5-sunburst, gpt-image-2.5-sunburst/text-to-image. If you omit the /text-to-image suffix it is added automatically.string
required
Text description of the image to generate.
string
Output dimensions. Examples:
1024x1024, 1536x1024, 1024x1536, auto. gpt-image-2.5-flare/gpt-image-2.5-sunburst also support resolutions up to 3840x2160.string
Image quality. gpt-image-2/gpt-image-1:
low, medium, high, auto. dall-e-3: standard, hd. gpt-image-2.5-flare/gpt-image-2.5-sunburst: auto, low, medium, high, plus xhigh and max (higher cost per image).string
Image style for dall-e-3. Values:
vivid, natural.Example
Response 200
POST /v1/images/edits
Synchronous image-to-image editing. Returns the result URL directly with HTTP 200.Request
string
required
Bearer <your-token>string
required
application/jsonBody
string
required
Model ID. Accepted:
gpt-image-2, gpt-image-2/image-to-image, gpt-image-1, gpt-image-1/image-to-image, gpt-image-2.5-flare, gpt-image-2.5-flare/image-to-image, gpt-image-2.5-sunburst, gpt-image-2.5-sunburst/image-to-image. If you omit the /image-to-image suffix it is added automatically.string
required
Editing instruction or description.
string
required
Input image URL (publicly accessible).
string
Output dimensions. Examples:
1024x1024, 1536x1024, 1024x1536, auto.string
Image quality:
low, medium, high, auto.Example
Response 200
POST /v1/images (legacy)
Legacy alias forPOST /v1/images/generations. Returns HTTP 202 asynchronously — poll GET /v1/images/{id} for the result.