GPT Image 2 API (October 2026): Pricing per Image, GPT Image 2.5 Flare vs Sunburst, Python Examples and Parameters
On this page
Short answer: OpenAI's image API now has three main models: gpt-image-2.5-flare (fastest, for everyday images), gpt-image-2.5-sunburst (most precise editing) and gpt-image-2. All are billed by tokens, at $30 per million image output tokens. For gpt-image-2, a 1024×1024 image costs about $0.006 at low quality, $0.053 at medium and $0.211 at high. The Batch API halves image output cost. Call POST /v1/images/generations and you get back base64 image data.
Prices and parameters below are from OpenAI's pricing page, image generation guide and model pages on October 17, 2026, unchanged since October 15. We ran the Python examples against a test endpoint to confirm the request format.
Which model to use
| Model | Model ID | Use it for | Quality settings |
|---|---|---|---|
| GPT Image 2.5 Flare | gpt-image-2.5-flare |
Fast, high-quality everyday generation | low, medium, high, xhigh, max, auto |
| GPT Image 2.5 Sunburst | gpt-image-2.5-sunburst |
Workflows where editing precision matters most | Same as Flare |
| GPT Image 2 | gpt-image-2 |
The previous model; fast, many supported sizes | low, medium, high |
OpenAI's image generation guide now leads with the two 2.5 models (snapshots dated September 8, 2026) and recommends them for new integrations. gpt-image-1.5, gpt-image-1 and gpt-image-1-mini still work but are older.
Pricing
Token rates
All three models share the same rates, per million tokens:
| Image input | Cached image input | Image output | Text input | Cached text input | |
|---|---|---|---|---|---|
| Standard | $8 | $2 | $30 | $5 | $1.25 |
| Batch | $15 |
Image output is almost all of the cost. Prompts are cheap, and reference images for edits are billed as image input. Cached input pricing only applies to the image generation tool in the Responses API, not to direct Images API calls, including edits.
Cost per image for GPT Image 2
OpenAI publishes these output costs per image for gpt-image-2:
| Quality | 1024 × 1024 | 1024 × 1536 | 1536 × 1024 |
|---|---|---|---|
| low | $0.006 | $0.005 | $0.005 |
| medium | $0.053 | $0.041 | $0.041 |
| high | $0.211 | $0.165 | $0.165 |
Two things that surprise people:
- Portrait and landscape are slightly cheaper than square at the same quality. OpenAI notes that a larger non-square size can use fewer output tokens than a smaller square one.
- High quality costs 30 to 35 times low quality. Draft at
low, then render the final image athigh.
For the 2.5 models, OpenAI provides an interactive token calculator instead of a fixed table. They use the same token rates, but "equal token rates don't mean equal cost per image", so read usage in the response to see what each image actually cost. Streaming previews (partial_images) add 100 image output tokens per preview.
GPT Image 2 cost calculator
Image output cost only, at OpenAI's October 2026 per-image prices for gpt-image-2. Add a little for prompt and reference-image input.
Generate an image in Python
Install the SDK with pip install openai and set OPENAI_API_KEY.
import base64
from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY
result = client.images.generate(
model="gpt-image-2.5-flare",
prompt="An orange cat watching the rain from a windowsill, 35mm film look",
size="1024x1024",
quality="medium",
)
with open("cat.png", "wb") as f:
f.write(base64.b64decode(result.data[0].b64_json))
print(result.usage) # tokens actually used for this image
With curl:
curl https://api.openai.com/v1/images/generations \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-image-2", "prompt": "An orange cat watching the rain", "size": "1024x1024", "quality": "low"}'
Two practical points:
- The Images API returns base64, not a URL. Decode and save it, as above.
- Complex prompts can take up to two minutes. Set your HTTP client timeout above that, and check that any proxy in between doesn't cut requests off sooner.
Edit an image
Send the source image, and optionally a mask, to /v1/images/edits (client.images.edit(...) in Python) with an instruction. The image and mask must be the same format and size, and under 50 MB. For several rounds of edits on the same image, use the Responses API with the image_generation tool, which supports multi-turn editing and file IDs as inputs. In that case you pick a regular model at the top level and set gpt-image-2.5-sunburst or gpt-image-2.5-flare in the tool's model field.
Parameters
| Parameter | Values | Notes |
|---|---|---|
size |
1024x1024, 1536x1024, 1024x1536, auto |
The 2.5 models also accept custom sizes (below) |
quality |
2.5: low to max, plus auto; gpt-image-2: low, medium, high |
Defaults to auto |
n |
1 to 10 | Images per request |
background |
transparent, opaque, auto |
Transparent needs png or webp output |
output_format |
png (default), jpeg, webp |
JPEG is faster |
output_compression |
0 to 100 | JPEG and WebP only |
moderation |
auto (default), low |
low filters less strictly |
partial_images |
0 to 3 | Streaming previews, 100 extra output tokens each |
Custom sizes on the 2.5 models: use a WIDTHxHEIGHT string such as 1536x864. Both dimensions must be multiples of 16, the aspect ratio between 1:3 and 3:1, neither edge over 3,840 pixels, and the total between 655,360 and 8,294,400 pixels (4K).
Prompting within the model's limits
OpenAI lists a few limitations worth designing around:
- Text in images is much better than before but can still miss on small or precisely placed text. Quote the exact words and keep them short.
- Recurring characters or brand elements can drift between separate generations. Edit one image instead of regenerating.
- Precise layouts aren't always followed. Expect to iterate on structured compositions.
Before you start
- Organization verification: OpenAI says you may need to complete API Organization Verification before using GPT Image models.
- No free allowance: usage is billed from prepaid API credits. See How to get an OpenAI API key.
- Supported countries: OpenAI warns that using the API outside its supported countries and territories may get your account blocked.
Errors
| Error | Cause | Fix |
|---|---|---|
401 Incorrect API key provided: sk-proj-… (invalid_api_key) |
Wrong or revoked key | Re-copy the key; the message shows a masked version to compare |
| Organization verification required | Your organization isn't verified for GPT Image | Complete verification in the developer console |
| The model isn't supported on this endpoint | gpt-image-2 used as the model in Chat Completions or Responses |
Use the Images API, or the image_generation tool in Responses |
| Timeout | Long renders on complex prompts | Raise the client timeout above two minutes |
429 with credit_balance_exhausted |
No prepaid credit left | Add credit; retrying won't help |
Using GPT Image through a gateway
Gateways that support OpenAI's Images API work with the same code: change base_url and the key. api.foo, the service that publishes these docs, serves GPT Image models at https://api.foo/v1/images/generations. We confirmed the path with a test key using the Python example above. Its image models are billed per image rather than per token; model names and prices are on the api.foo pricing page. For long renders, its direct route https://dc.api.foo/v1 has no 100-second proxy timeout.
Related
- Nano Banana API: Gemini image generation
- Grok API, including Grok Imagine
- OpenAI API pricing and calculator
- How to get an OpenAI API key
Sources
OpenAI documentation, checked October 17, 2026: Image generation guide, Pricing, model pages for gpt-image-2, gpt-image-2.5-flare and gpt-image-2.5-sunburst, the Images API reference, Supported countries and Organization verification.
FAQ
How much does the GPT Image 2 API cost per image?
OpenAI bills image output at $30 per million tokens. For gpt-image-2 that works out to about $0.006 (low), $0.053 (medium) or $0.211 (high) for a 1024x1024 image, and $0.005, $0.041 or $0.165 for 1024x1536 or 1536x1024. The Batch API halves image output to $15 per million tokens.
What's the difference between GPT Image 2 and GPT Image 2.5?
GPT Image 2.5 (snapshots dated September 8, 2026) comes as gpt-image-2.5-flare, the fastest model for everyday generation, and gpt-image-2.5-sunburst, for edits that need the most precision. Both add xhigh and max quality settings and custom sizes up to 4K. All three share the same token prices, but they can use different numbers of tokens for the same settings.
Is the GPT Image 2 API free?
No. Image generation is billed per token from your OpenAI API credits, and the pricing page has no free allowance for image models. Image generation inside ChatGPT follows your ChatGPT plan, which is separate from the API.
Does the GPT Image API return a URL or base64?
The Images API returns base64-encoded image data, PNG by default, with JPEG and WebP available. Decode it and save it to a file, as in the examples on this page.
Do I need organization verification to use GPT Image?
You may. OpenAI says you may need to complete API Organization Verification in the developer console before using GPT Image models.
Can I use gpt-image-2 in the Chat Completions or Responses API?
Not as the model. The image models work with /v1/images/generations, /v1/images/edits and the Batch API. In the Responses API you call them through the image_generation tool from a regular model.
Found a mistake? Email [email protected].