Skip to main content
On LaoZhang API, the token’s group and billing mode, not the 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. gpt-image-2-vip costs $0.03 per image from 1K to 4K and from low to high. 4K output is generated natively at the requested size, not upscaled. No group has a concurrency cap or rate limit, and requests fail over automatically across several upstream routes.
Seeing more failed images? Check whether the model is healthy first. Image model status shows GPT Image and Nano Banana success rates every 5 minutes, with what to do when a rate drops.

Choose a token group

Route behind each row:
  • gpt-image-2 in default: standard per-call route
  • gpt-image-2-vip in default: VIP route
  • OpenAI Official: official API forwarding at OpenAI’s price
  • OpenAI Official Enterprise: official API forwarding at OpenAI’s price plus 20%
  • GPT Image VIP (since November 6, 2026): the official model name gpt-image-2 runs on the VIP route and is identical to gpt-image-2-vip, with native 4K at $0.03 per call; parameters are in gpt-image-2-vip in the default group. Use it when your code or tool only accepts official model names.
Web, VIP, or official forwarding (times from recent successful calls through the gateway on November 5, 2026): For native 4K with shorter waits in a new integration, use the GPT Image 2.5 -vip models (Flare VIP about 25 s at the median). In every group, a single key has no RPM (requests per minute), IPM (images per minute), or concurrency cap; a 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.
Don’t put a group name in the model field. You choose the group when you create the token, and the request body still uses model="gpt-image-2". Changing model can’t turn a Per-call token into a Usage-based one.

Which route should you use?

Official-forward pricing

In OpenAI Official, gpt-image-2 is billed for actual token usage at OpenAI’s official rates: The OpenAI Official 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 accept size or quality, so omit both. Without response_format it usually returns Base64 in data[0].b64_json. Send response_format: "url" to get an image link instead. Links expire, so download the image right away and copy it to your own storage.

gpt-image-2-vip in the default group

Use it for per-call billing with control over image size and quality:
  • size: common values include 1024x1024 and 2048x2048.
  • 4K sizes: 3840x2160 (landscape), 2160x3840 (portrait), or 2880x2880 (square). 2K and 4K are generated natively.
  • quality: low, medium, or high.
  • Size and quality don’t change the price of $0.03 per call.
  • The response usually contains data[0].b64_json and occasionally an image link. Send response_format: "b64_json" to always get Base64, or url for a link that expires.
  • For edits, repeat the image[] field to send several reference images in one request.
  • mask isn’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 -vip models.
Higher quality takes longer, so use 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

OpenAI Official is an official-forward group billed at OpenAI’s official price. OpenAI Official Enterprise is the enterprise official-forward group at the official price plus 20% (a 1.2× group multiplier). OpenAI Official is served by a mix of OpenAI keys and Azure OpenAI, and OpenAI Official Enterprise by OpenAI keys only.
  1. Create a new Usage-based token in token management.
  2. Select OpenAI Official or OpenAI Official Enterprise.
  3. Keep model="gpt-image-2" and your official request body. Replace only the base URL and API key.
Use OpenAI’s parameters, and check every field you send on the route you chose. Common values:

Set up

Export the key whose group matches your route, and the OpenAI-compatible base URL:
Keep the base URL at /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 send size or quality:

Generate with gpt-image-2-vip

Pass size and quality in the request body:

Generate with official-forward gpt-image-2

Use a Usage-based token from OpenAI Official or OpenAI Official Enterprise:

Save the image

An Images API response returns each image in data[] in one of two fields:
  • b64_json: Base64 image data, which can start with a data:image/...;base64, prefix or be missing its = padding.
  • url: a download link for the image.
This script handles all of these cases; save it as save_images.py:
save_images.py
Run it on any of the responses above:
The script prints a line such as 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 local source.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:
Check both the requested change and the details that should stay the same in the saved image.

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 OpenAI Official and OpenAI Official 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. Use gpt-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, and the 4K is native: the image is generated directly at the requested size, not rendered small and then upscaled. Use 3840x2160 for landscape, 2160x3840 for portrait, or 2880x2880 for a square image. 4K at high quality costs the same $0.03 per call as 1K. The web route gpt-image-2-web is different: a 4K size comes back at the requested dimensions, but upscaled from about 2K. It is faster, so use it when 1K or 2K is enough.

How many reference images can gpt-image-2-web take?

The edit endpoint /v1/images/edits takes up to 16 reference images per request, sent as repeated image[] fields. A request with more than 16 may return 400 with code too_many_images. It isn’t charged, so cut the set to 16 or fewer and send it again. gpt-image-2.5-web and gpt-image-2.6-web have the same limit.

Where can I get the GPT Image 2 API cheaply?

Use gpt-image-2-vip on LaoZhang API: $0.03 per call with no surcharge for 4K or high, no OpenAI account, and no concurrency cap or rate limit. If you need parameters identical to OpenAI’s API, use gpt-image-2 in an official-forward group, billed by tokens at OpenAI’s prices. New integrations can also start with the GPT Image 2.5 -vip models at the same $0.03.

How do I migrate official OpenAI code?

Keep the official request body and swap only the token and base URL:
  1. Create a Usage-based token in OpenAI Official or OpenAI Official Enterprise.
  2. Keep model="gpt-image-2" and change the base URL to https://api.laozhang.ai/v1.
  3. 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 support response_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 a data: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.

Sources