OpenAI image model, April 2026 · checked 2026-10-20

GPT Image 2 Complete Guide

As of 2026-10-20, GPT Image 2 (gpt-image-2) is OpenAI's image generation and editing model, released on April 21, 2026, with flexible sizes and high-fidelity image inputs. Official billing is per image token: $8 image input / $2 cached input / $30 image output per 1M tokens, and $4 / $1 / $15 in Batch. QCode bills per output image at $0.30, the same for generations and edits; this is a separate basis from the official image-token prices.

#GPT-Image-2 #OpenAI #Image Generation #2026

What is GPT Image 2

GPT Image 2 is an image generation and editing model that OpenAI released on April 21, 2026, with the model ID gpt-image-2 and default snapshot gpt-image-2-2026-04-21. OpenAI says it supports flexible image sizes and high-fidelity image inputs, and it is called through the generations and edits endpoints of the Images API. DALL·E 2 and DALL·E 3 were removed from the API on May 12, 2026, and OpenAI recommends models such as gpt-image-2 instead. As of 2026-10-20, OpenAI has also released the follow-up GPT Image 2.5 Sunburst and Flare, on September 8, 2026; the official guide recommends the 2.5 models for new integrations.

Key Capabilities

Text-to-image, image-to-image, inpainting, in-image text, multiple resolutions (1024×1024 / 1024×1536 / 1536×1024, and up to 4K on the official API) and quality levels (low / medium / high / auto). OpenAI bills per image token, so size, quality and the number of input images change the token count and therefore the total cost.

Billing: $0.30 per image

GPT Image 2 is billed per output image, at the same rate for generations and edits: $0.30 for each image, so n images cost n × $0.30. size, quality, the number of input images, mask and prompt length do not affect the price. Failed requests (4xx including content-moderation rejections, 5xx, timeouts, client disconnects) are never billed. As of 2026-10-06, billing changed from per-token (with a per-request minimum) to a flat $0.30 per image.

  • Per output image — $0.30
  • size / quality / input images / mask / prompt length do not affect the price
  • Failed requests (4xx / 5xx / timeouts / client disconnects) are never billed

The price is independent of size / quality and of how many images you send in — only the number of output images counts.

Access via QCode

GPT Image 2 is listed in the /models catalog; to judge whether it is callable right now, check the /models catalog and the status page rather than the wording of any static page. Billing is per output image at $0.30, the same for generations and edits. The same QCode plan quota covers multiple CLI tools such as Claude Code and OpenAI Codex.

Per output image
$0.30 / image

generations and edits cost the same; n images = n × $0.30.

Failed requests
Not billed

4xx (incl. content-moderation rejections) / 5xx / timeouts / client disconnects are never billed.

API Setup Example

Use OpenAI-compatible API. Just point BASE_URL to QCode endpoint, use QCode Key as API Key — everything else identical to official SDK.

from openai import OpenAI
import base64

# Note: image generation uses the dedicated endpoint /qcode-img/v1 (separate from text /openai/v1)
client = OpenAI(
    api_key="$QCODE_KEY",
    base_url="https://api.qcode.cc/qcode-img/v1",
    timeout=180.0,  # OpenAI SDK default is short, recommend 180s
)

response = client.images.generate(
    model="gpt-image-2",
    prompt="A serene Japanese garden with a koi pond",
    size="1024x1024",
    quality="medium",
)

img = base64.b64decode(response.data[0].b64_json)   # Only b64_json is returned; response_format=url is rejected with 400
open("out.png", "wb").write(img)

# Full endpoint path: POST https://api.qcode.cc/qcode-img/v1/images/generations

Use Cases

Marketing assets, social media posters, e-commerce product shots, book illustrations, concept design drafts, slide graphics, UI mockups, prototype designs. For local changes, use the edits endpoint with a mask, or combine several reference images into a new one.

Moving off DALL·E 3, and vs Midjourney / Stable Diffusion

DALL·E 3: OpenAI's official changelog says dall-e-2 and dall-e-3 were removed from the API on May 12, 2026, with gpt-image-2 among the recommended replacements, so integrations still calling DALL·E 3 need to migrate. vs Midjourney: API-first design suits programmatic integration; Midjourney leans Discord creator workflow. vs Stable Diffusion: closed-source but more stable quality and controllability, no self-hosted GPU needed. As of 2026-10-15, OpenAI's official guide recommends the GPT Image 2.5 models for new integrations; choose between gpt-image-2 and the 2.5 models by quality, size and editing needs.

One Plan, Three Platforms

QCode also powers OpenAI Codex / GPT-5.6

Your QCode quota works across Claude Code and OpenAI Codex CLI — one shared balance, zero duplicate spend.

FAQ

Can I still use DALL·E 3, or should I switch to GPT Image 2?

Not on the OpenAI API: the official changelog says dall-e-2 and dall-e-3 were removed from the API on May 12, 2026, and OpenAI recommended gpt-image-2, gpt-image-1 or gpt-image-1-mini instead. gpt-image-2 supports flexible sizes and high-fidelity image inputs and can make local changes through the edits endpoint; per OpenAI's deprecations page, gpt-image-1 is scheduled to shut down on October 23, 2026, with the GPT Image 2.5 models as the substitute (as of 2026-10-15).

How is GPT Image 2 billed?

Per output image, at $0.30 each — the same rate for generations and edits, so n images cost n × $0.30. size, quality, the number of input images, mask and prompt length do not affect the price, and failed requests are never billed. OpenAI's official price is a separate basis: billed per image token at $8 image input, $2 cached input and $30 image output per 1M tokens, and $4 / $1 / $15 in Batch (official pricing page, 2026-10-20).

How do users in mainland China connect to GPT Image 2?

The QCode docs list https://api.qcode.cc/qcode-img/v1 as the default endpoint for mainland China, https://asia.qcode.cc/qcode-img/v1 for Hong Kong and Southeast Asia, and https://us.qcode.cc/qcode-img/v1 (Los Angeles) for North America and Europe. gpt-image-2 is listed in the /models catalog; current availability is governed by the /models catalog and the status page, and this page makes no real-time promise.

Can my QCode plan quota be used for GPT Image 2?

QCode plan quota works across multiple CLI tools (Claude Code, OpenAI Codex, etc.) with a single API Key. gpt-image-2 is listed in the /models catalog — check /models and the status page for availability; image requests count toward dailyCostLimit at $0.30 per image.

gpt-image-2 in practice: specs, setup, edits and errors

gpt-image-2 official specs at a glance

As of 2026-10-15, OpenAI's official changelog lists GPT Image 2 as released on April 21, 2026, with the model ID gpt-image-2 and the default snapshot gpt-image-2-2026-04-21. On the official model page, image generation (v1/images/generations), image edit (v1/images/edits) and Batch (v1/batch) are all marked as supported; inputs can be text and images, and the output is an image.

For sizes, OpenAI lists 1024x1024, 1536x1024, 1024x1536, 2048x2048, 2048x1152, 3840x2160, 2160x3840 and the default auto as popular values. Custom sizes must meet all of these rules: the longest edge is at most 3840px, both edges are multiples of 16px, the long-to-short edge ratio is no more than 3:1, and the total pixel count is between 655,360 and 8,294,400. Quality can be low, medium, high or the default auto.

  • Output format: the Image API returns base64-encoded image data, png by default, with jpeg or webp on request; for jpeg and webp, output_compression (0–100) sets the compression level.
  • Input fidelity: OpenAI says gpt-image-2 processes every image input at high fidelity automatically and does not allow changing input_fidelity, so simply omit that parameter.
  • Transparent backgrounds: according to the official changelog, gpt-image-2 has supported background=transparent in preview since August 20, 2026, with png or webp output; jpeg does not support transparency.
  • Latency: OpenAI's limitations section notes that complex prompts may take up to 2 minutes.
  • Moderation: all prompts and generated images are filtered under OpenAI's content policy, and the moderation parameter accepts auto (default) or low.

Calling gpt-image-2 through QCode in three steps

The QCode docs describe a dedicated image path whose requests and responses follow the OpenAI Images API format: keep the official OpenAI SDK, set base_url to https://api.qcode.cc/qcode-img/v1, use your QCode API key as api_key and gpt-image-2 as the model name, and leave the rest of your code unchanged. Whether it can be called right now is governed by the /models catalog and the status page.

If you would rather try it before writing code, the QCode docs point to an online Playground at https://api.qcode.cc/qcode-img/, where you enter your API key and a prompt to test generation and editing in the browser.

  • Step 1: sign up for QCode and create an API key in the dashboard (it starts with cr_); the same key also works for Claude Code, Codex and other tools.
  • Step 2: write the request as you would for OpenAI. Set model to gpt-image-2; n accepts 1 to 4 images per call, and anything above 4 returns a 400 instead of being silently truncated; if you omit size and quality, the generations endpoint defaults to 1024x1024 and medium. The returned image is occasionally a different size from the one requested, so go by the image itself.
  • Step 3: set the client timeout explicitly to 180 seconds or more. The QCode docs warn that the OpenAI SDK default is too short, and any reverse proxy or gateway you run in between also needs a read timeout of at least 180 seconds.
  • Reading the result: data[0].b64_json in the response is the base64 image, so decode it and write it to a file; revised_prompt is the prompt as rewritten by the model and can be shown if you like.
  • Default limits: the QCode docs state 100 images per day and at most 2 in-flight requests per API key, shared by generations and edits; contact support if you need more.

Editing with edits: inpainting and multi-image blends

Edit requests go to POST /qcode-img/v1/images/edits and must upload files as multipart/form-data rather than JSON. The QCode docs allow 1 to 8 source images (PNG, JPEG or WebP) per request, repeating the image field for each one; the optional mask is a PNG with an alpha channel, and its transparent area is what gets redrawn.

OpenAI's official guide sets these mask requirements: the image and the mask must share the same format and size and be under 50MB, and the mask must contain an alpha channel. It also explains that masking with GPT Image is entirely prompt-based, so the model uses the mask as guidance and may not follow its exact shape; with multiple input images, the mask applies to the first one.

  • The mask says where to change; the prompt says what to change it into. Without a mask, any part of the image may be redrawn according to the prompt.
  • For multi-image blends, spell out each image's role in the prompt, for example that the first image is the scene and the second is the product to place in it.
  • Upload size: the QCode docs cap a single file at 25 MB and all files together at 50 MB; larger uploads return 413 image_too_large.
  • No need to send input_fidelity: gpt-image-2 always handles input images at high fidelity, QCode ignores low and high, and any other value returns 400.

Common errors and what to do

Errors from QCode's image endpoints follow OpenAI's standard error schema (error.type, error.code, error.message), so check the HTTP status and the code.

  • 400 unsupported_response_format: you sent response_format=url. This endpoint returns b64_json only.
  • 400 unsupported_background: you sent background=transparent. The official OpenAI API supports transparent backgrounds in preview, but as of 2026-10-15 the QCode docs state that /qcode-img/v1 accepts only auto and opaque.
  • 400 stream_not_supported: you sent stream=true or partial_images; incremental output is not supported yet.
  • 422 unsupported_size: size is not one of auto, 1024x1024, 1024x1536, 1536x1024 or 2048x2048; custom sizes such as 4K that the official API accepts are not offered on this endpoint.
  • 429 image_daily_limit or concurrency_exhausted: you hit the per-key daily image count or concurrency limit, so wait for the time in the Retry-After header before retrying.
  • 503 image_provider_unavailable, 504 or a client timeout: retry with exponential backoff based on Retry-After (the docs suggest starting at 30 seconds, at most 3 times); if timeouts keep happening, shorten the prompt or send fewer input images.

More gpt-image-2 questions

When was gpt-image-2 released?

OpenAI's official changelog lists GPT Image 2 as released on April 21, 2026, with the default snapshot gpt-image-2-2026-04-21. OpenAI then released GPT Image 2.5 Sunburst and GPT Image 2.5 Flare on September 8, 2026 (as of 2026-10-15).

Which sizes and quality levels does gpt-image-2 support?

On the official OpenAI API, popular sizes are 1024x1024, 1536x1024, 1024x1536, 2048x2048, 2048x1152, 3840x2160, 2160x3840 and auto, and quality is low, medium, high or auto. Through QCode's /qcode-img/v1, size can be auto, 1024x1024, 1024x1536, 1536x1024 or 2048x2048 and quality low, medium or high; other sizes return 422.

Can gpt-image-2 return an image URL?

No. The official Image API returns base64-encoded image data, and the QCode endpoint likewise returns b64_json only; response_format=url returns 400. Decode b64_json and save it as a file, or show it on a web page as a data URL.

Can gpt-image-2 create PNGs with a transparent background?

On the official OpenAI API, yes: the changelog says gpt-image-2 has supported background=transparent in preview since August 20, 2026, with png or webp output. Through QCode's /qcode-img/v1 it is not supported as of 2026-10-15; transparent returns 400, and background must be auto or opaque.

What should I do if gpt-image-2 requests keep timing out?

Raise the client timeout to 180 seconds or more first. OpenAI notes that complex prompts may take up to 2 minutes, and the QCode docs require an explicit SDK timeout of at least 180 seconds, including the read timeout of any reverse proxy in between. A 504 or client timeout can be retried as is; if it keeps happening, shorten the prompt or send fewer input images.

How does gpt-image-2 differ from GPT Image 2.5?

According to OpenAI's image generation guide (as of 2026-10-20), GPT Image 2.5 Sunburst and Flare add the xhigh and max quality settings, while gpt-image-2 goes up to high. OpenAI recommends the 2.5 models for new integrations, with Sunburst for editing precision and Flare for fast, high-quality everyday generation. Which image models QCode can call, and their current billing, are listed on /models.

How do I pay and get started with QCode for gpt-image-2?

Sign up, top up your balance, pick a plan, then create an API key in the dashboard. In CNY you can pay with Alipay or WeChat Pay; in USD with Visa / Mastercard / AMEX credit cards, Apple Pay or Google Pay; crypto is accepted across many coins and networks, and the whole process is self-service. Not ready for a monthly plan? Pay-as-you-go Packs start at $4 for a one-time quota you use within 7 days; if you already have a Personal Plan, add a booster pack when you need more quota. gpt-image-2 is billed per output image at $0.30 each; see /models.

Learn about GPT Image 2

QCode plans share quota across multiple CLIs — flexible subscription

Not sure where to start?

Try it for a week

Small Pack: $4 for $30 of quota, valid 7 days

Use it every day

Starter: $9.00/month, about half the price per $1 of quota compared with the Medium Pack ($5 of quota per day)