model field, decide whether gpt-image-2 is billed per call or by tokens. This guide covers existing GPT Image 2 integrations; new projects should start with GPT Image 2.5.
Choose a token group
Route behind each row:
gpt-image-2indefault: standard per-call routegpt-image-2-vipindefault: VIP routeSora2Official: official API forwarding, Azure OpenAI and OpenAI keysGPTImage2 Sora2 Enterprise: official API forwarding, official keys only
429 comes from upstream capacity, see Concurrency and 429. Non-200 upstream responses aren’t charged.
You set the billing mode when you create the token: Per-call (按次计费) or Usage-based (按量计费). Prices are public pricing as of September 24, 2026; see the model and pricing catalog.
All four routes use POST /v1/images/generations for text-to-image and POST /v1/images/edits for image-to-image. Both models are also available in another image group (see the console for its name). GPT Image 2.5 adds the Flare and Sunburst variants and the xhigh and max quality tiers.
Which route should you use?
Official-forward pricing
InSora2Official, gpt-image-2 is billed for actual token usage at OpenAI’s official rates:
The
GPTImage2 Sora2 Enterprise group costs the official price plus 20% (a 1.2× group multiplier on these rates). Check the multiplier for your token in the console, and contact support for enterprise quotes.
Parameters by route
gpt-image-2 in the default group
The standard per-call route and the simplest integration. It doesn’t acceptsize or quality, so omit both.
gpt-image-2-vip in the default group
Use it for per-call billing with control over image size and quality:size: common values include1024x1024,2048x2048, and3840x2160.- For portrait 4K, test
sizeas2160x3840with your production prompt. quality:low,medium, orhigh.- The response usually contains
data[0].b64_jsonand occasionally an image link. Sendresponse_format: "b64_json"to always get Base64, orurlfor a link that expires. - For edits, repeat the
image[]field to send several reference images in one request. maskisn’t supported: the model doesn’t reliably limit the edit to the masked area.- Transparent backgrounds aren’t supported, and
background="transparent"returns a 400. For a transparent PNG, use the GPT Image 2.5-vipmodels.
low or medium for previews and batch tests and high for final assets.
For official-key routing and OpenAI’s full set of options, use an official-forward group instead.
gpt-image-2 in the official-forward groups
Sora2Official is an official-forward group billed at OpenAI’s official price, served by a mix of Azure OpenAI and OpenAI keys. GPTImage2 Sora2 Enterprise uses official keys only, costs the official price plus 20%, and suits production workloads that need higher route stability.
- Create a new Usage-based token in token management.
- Select
Sora2Official, orGPTImage2 Sora2 Enterprisefor official-key-only routing. - Keep
model="gpt-image-2"and your official request body. Replace only the base URL and API key.
Set up
Export the key whose group matches your route, and the OpenAI-compatible base URL:/v1; don’t append a model-specific path. The examples save each response to a JSON file and then extract the image with a small Python script.
Generate an image
Generate with gpt-image-2 (default group)
Don’t sendsize or quality:
Generate with gpt-image-2-vip
Passsize and quality in the request body:
Generate with official-forward gpt-image-2
Use a Usage-based token fromSora2Official or GPTImage2 Sora2 Enterprise:
Save the image
An Images API response returns each image indata[] in one of two fields:
b64_json: Base64 image data, which can start with adata:image/...;base64,prefix or be missing its=padding.url: a download link for the image.
save_images.py:
save_images.py
Saved mug-1.png. Open the image and check its dimensions, then confirm the model, group, and charge in call logs.
Edit an image
Put a localsource.png in the current directory. Edits are multipart uploads: pass the file with -F and let cURL set the content type.
Edit with gpt-image-2 (default group)
Edit with gpt-image-2-vip
Edit with official-forward gpt-image-2
Official-forward edits use/v1/images/edits with OpenAI’s parameters:
Frequently asked questions
Why does gpt-image-2 behave differently across groups?
The token’s group decides the route:gpt-image-2 is billed per call in default and by tokens through official API forwarding in Sora2Official and GPTImage2 Sora2 Enterprise. Choose a token group compares the routes. If a charge doesn’t match what you expected, check the group and charge of each request in call logs.
Can gpt-image-2 in the default group accept size?
No. Usegpt-image-2-vip for per-call billing with size control, or gpt-image-2 in an official-forward group for OpenAI’s size options.
Can gpt-image-2-vip output 4K images?
Yes. Landscape 4K sizes such as3840x2160 work. For portrait 4K, test 2160x3840 with your production prompt and check the dimensions of the returned image.
How do I migrate official OpenAI code?
Keep the official request body and swap only the token and base URL:- Create a Usage-based token in
Sora2Official, or inGPTImage2 Sora2 Enterprisewhen you need official-key-only routing. - Keep
model="gpt-image-2"and change the base URL tohttps://api.laozhang.ai/v1. - Use your LaoZhang API key.
Why do response_format and input_fidelity fail on official forwarding?
Remove both fields. Under OpenAI’s rules, GPT Image models always return Base64 image data and don’t supportresponse_format, and gpt-image-2 processes every input image at high fidelity automatically, so input_fidelity can’t be changed. Code migrated from DALL·E or earlier GPT Image models often still sends them.
If you need a link to the image, decode b64_json and upload the file to your own storage instead of expecting a URL from the API.
Why do official-forward edits cost more than generation?
Reference images are billed too.gpt-image-2 always processes input images at high fidelity and bills them as image input tokens, so an edit with reference images can use noticeably more input tokens than text-to-image, and each extra reference adds more. Size and quality still set the output tokens.
Estimate your budget from usage in a few representative edit requests, and check the actual charge in call logs. Per-call routes aren’t affected by reference images and keep their per-call price.
Why does b64_json decoding fail?
The value often starts with adata:image/png;base64, prefix or is missing its = padding. The script in Save the image handles both. If decoding still fails, check whether the response is actually an error JSON.
Should I move to GPT Image 2.5?
Existing GPT Image 2 integrations can keep running. For new work, use GPT Image 2.5: the-vip models use the same per-call integration as gpt-image-2-vip, and the official-forward models use the same groups and Images API requests as official-forward gpt-image-2.
On the official-forward route, the same quality value can use a different number of tokens and take a different time on 2.5, so test your production prompts before switching. See the GPT Image 2.5 guide and its FAQ for model IDs and options.
Related documentation
- GPT Image 2.5 guide: recommended for new integrations
- Images API reference: shared request and response format
- Choose an image generation API: compare all image models
- Model and pricing catalog: current prices and groups
- Call logs: check the model, group, and charge for each request