OpenAI: GPT Image 2

GPT Image 2 is OpenAI's image generation model, released 2026-06, built for high-fidelity generation and editing through the Images API.

Modalities
inTextinImageoutImage
Price / 1M−34%
$1.50 / $9.00$8.00 / $8.00
Context
400K
Released
Jun 24, 2026

Channels

Every channel serves the same model, but they differ in price and stability. On each API key in the Platform, you pick a primary and a backup channel per vendor, and each billing line shows which channel served the request.

Provider
Discount
Input /M
Output /M
Cache read /M
Cache write 5m /M
Cache write 1h /M
Codexcheap
−34%
$1.50
$9.00
$0.38
—
—
Defaultstable
+53%
$3.50
$21.00
$0.88
—
—

Context pricing

This model’s price depends on how much input context a request carries. The headline price is the cheapest band, and a longer prompt moves the whole request into a higher one.

Input context
Input /M
Output /M
Cache read /M
Codexcheap
standardBase
$1.50
$9.00
$0.38
Defaultstable
standardBase
$3.50
$21.00
$0.88

Capabilities

VisionLong contextPrompt cachingStructured output

Parameters

Request parameters this model accepts through the API.

max_tokensresponse_formatseedstructured_outputs

Quick start

POST /v1/images/generations/
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.mirapi.ai/v1",   # changed
    api_key=os.environ["MIRAPI_API_KEY"],   # changed
)

img = client.images.generate(
    model="gpt-image-2",
    prompt="A red bicycle leaning on a white wall",
    n=1,
    size="1024x1024",
)
# img.data[0].b64_json — or .url, depending on the model
Wire GPT Image 2 into your product

1M free tokens to start, no card required. It’s OpenAI-compatible, so you only change the base URL.

Start free