GPT Image 2 — Image generation API
| Item | Value |
|---|---|
| Model | gpt-image-2 |
| Alias | openai/gpt-image-2 |
| Endpoint | POST https://api.quotaflow.ai/openai/v1/images/generations |
| Execution | Synchronous V3 runtime |
| Billing | Immutable token-based Image2 BillingFact |
curl https://api.quotaflow.ai/openai/v1/images/generations \
-H "Authorization: Bearer $QUOTAFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A clean editorial illustration of an AI workflow.",
"size": "1024x1024",
"quality": "medium",
"response_format": "b64_json"
}'
Generation, editing and streaming
gpt-image-2 supports /openai/v1/images/generations and /openai/v1/images/edits, including reference images and masks. An edit accepts multipart image files or JSON image references; OpenAI account file_id references are not accessible here. Asynchronous image jobs and the Responses image_generation tool are not this interface.
stream: true with n: 1 returns SSE. Generation ends with image_generation.completed; editing ends with image_edit.completed. partial_images (0–3) requires streaming. Partial generation frames require matching capacity and can be fewer than requested; edits can complete without partial frames.
Request parameters
- Explicit raster
size: both dimensions divisible by 16, neither edge above 3840, aspect ratio 1:3 to 3:1, and 655,360–8,294,400 total pixels. This is not a fixed 3840x2160 bounding box. quality:auto,low,medium,high. Omittedquality/sizestay omitted; explicitautostaysauto. Read reported size/quality when present instead of assuming a forced default.background: "transparent"requiresoutput_format: "png"or"webp"; raster formats arepng,jpeg,webp.response_format:b64_json, or temporaryurloutput for non-streaming calls. Streaming carries Base64 image frames, not URL results.n: 1–10 subject to response-size/pixel limits; streaming requires 1.
The public response's usage is the request's billable usage, from validated reporting or supported estimates. It is not a raw supplier token-count contract. Prices depend on the model and account terms.
For edit and streaming cURL examples, request-size limits and error handling, read the Images API guide. GPT Image 2.5/2.6 have separate model IDs and additional quality/output options; see their own guides rather than copying those fields to GPT Image 2.