> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laozhang.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT Image 2.6 API: GIF, SVG and $0.03 VIP

> Call OpenAI's GPT Image 2.6 with a LaoZhang API key, no OpenAI account: GIF and SVG output via official forwarding, or $0.03 per call on the VIP and web routes.

GPT Image 2.6 is OpenAI's image model after GPT Image 2.5. It comes in the same two variants, **Flare** for speed and **Sunburst** for detail and steadier edits, and adds animated GIF and SVG vector output plus a `complexity` parameter. LaoZhang API serves it on three routes; pick one below.

## Choose a route

| Route | Model ID | Price | Output | Typical time |
| - | - | - | - | - |
| Official forwarding | `gpt-image-2.6-flare`, `gpt-image-2.6-sunburst` | Tokens | Still images, GIF, SVG; native 4K | Flare 8–12 s for a 1024 image |
| VIP per call | `gpt-image-2.6-flare-vip`, `gpt-image-2.6-sunburst-vip` | \$0.03 per image | PNG; native 4K | 25–55 s |
| Web route | `gpt-image-2.6-web` | \$0.03 per call | PNG, JPEG, WebP, GIF; native up to about 2K | 15–35 s |

* You pick the token group when you create the token; it never goes in the request:
  * Official forwarding uses `OpenAI Official` or `OpenAI Official Enterprise` with the Usage first or Usage-based billing mode.
  * The VIP and web routes use `default` or another image group with the Usage first or Per-call billing mode.
* All three routes use `/v1/images/generations` to generate and `/v1/images/edits` to edit, with the same request format as the OpenAI Images API.
* Which to use: official forwarding for SVG, GIFs straight from an edit, or the fastest images; VIP for native 4K PNGs at a fixed price; the web route for GIFs at a fixed price (1024×1024 and up).

## What changed from GPT Image 2.5

* New output formats: official forwarding returns animated GIFs and SVG vector images, and the web route returns GIFs.
* A new `complexity` parameter (`low`, `medium`, `high`) sets how busy the image is, at no extra charge.
* Via official forwarding, `low` and `medium` use 3–4 times the tokens of 2.5, while `high` and above cost the same; for large batches of drafts, [GPT Image 2.5](https://docs.laozhang.ai/en/api-capabilities/gpt-image-2-5.md) stays cheaper.
* The 2.6 VIP models don't accept `xhigh` or `max`; for those tiers at a fixed price, keep using 2.5 VIP.

## Before you call

**1. Create a token**

Create a token in [Token management](https://api.laozhang.ai/token) and choose the group for your route from the table above. You don't need an OpenAI account.

**2. Set environment variables**

```bash theme={null}
export LAOZHANG_API_KEY="your LaoZhang API key"
export BASE_URL="https://api.laozhang.ai/v1"
```

**3. Add a save script**

`data[]` in the response holds Base64 (`b64_json`) or a download link (`url`). Save this as `save_images.py`; it detects PNG, JPEG, WebP, GIF, and SVG from the file header and writes each file with the matching extension:

```python theme={null}
import base64
import json
import sys
import urllib.request
from pathlib import Path

if len(sys.argv) != 3:
    raise SystemExit("usage: python save_images.py response.json output_prefix")


def decode_b64(value):
    # Strip a data:...;base64, prefix if present and restore missing = padding
    if value.startswith("data:"):
        value = value.split(",", 1)[1]
    value = "".join(value.split())
    value += "=" * (-len(value) % 4)
    return base64.b64decode(value, validate=True)


def extension_of(raw):
    # Detect the format from the file header: PNG, JPEG, WebP, GIF, or SVG
    if raw.startswith(b"\x89PNG"):
        return "png"
    if raw.startswith(b"\xff\xd8"):
        return "jpg"
    if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP":
        return "webp"
    if raw.startswith(b"GIF8"):
        return "gif"
    if b"<svg" in raw[:2048]:
        return "svg"
    raise RuntimeError("Unrecognized image format")


payload = json.loads(Path(sys.argv[1]).read_text(encoding="utf-8"))
if payload.get("error"):
    raise RuntimeError(payload["error"])
items = payload.get("data") or []
if not items:
    raise RuntimeError("No image in the response; check the error message and call logs")

for index, item in enumerate(items, start=1):
    if item.get("b64_json"):
        raw = decode_b64(item["b64_json"])
    elif item.get("url"):
        with urllib.request.urlopen(item["url"], timeout=60) as download:
            raw = download.read()
    else:
        raise RuntimeError(f"Item {index} has neither image data nor a URL")
    output = Path(f"{sys.argv[2]}-{index}.{extension_of(raw)}")
    output.write_bytes(raw)
    print(f"Saved {output} ({len(raw)} bytes)")
```

Run it as `python save_images.py response.json output_prefix`.

## GPT Image 2.6 via official forwarding

GPT Image 2.6 is OpenAI's newer image model, again in two variants: Flare (fast) and Sunburst (more detail, steadier edits). The official-forward groups bill it by tokens, with the same tokens, endpoints and request bodies as 2.5 official forwarding; change only `model`. For per-call billing with a `default`-group token, see [GPT Image 2.6 VIP per image](#gpt-image-2-6-vip-per-image).

| Item | Details |
| - | - |
| Model IDs | `gpt-image-2.6-flare`, `gpt-image-2.6-sunburst` |
| Token group | `OpenAI Official` or `OpenAI Official Enterprise`, billing mode **Usage first** or **Usage-based** |
| Endpoints | `/v1/images/generations`, `/v1/images/edits` |
| Rates | Same as [GPT Image 2.5 official-forward billing](https://docs.laozhang.ai/en/api-capabilities/gpt-image-2-5.md#official-forward-billing): text input \$5, image input \$8, image output \$30 per 1M tokens |
| New parameters | `output_format: "gif"` returns a looping animation; `output_format: "svg"` returns an SVG vector image (the text model that writes it defaults to `gpt-6.1-terra` at no extra cost; change it with `svg.model`); `complexity` (`low`, `medium`, `high`; default `high`) controls scene complexity at no extra cost |
| Per-call route | `gpt-image-2.6-flare-vip`, `gpt-image-2.6-sunburst-vip` at \$0.03 per image, without GIF, SVG, `xhigh` or `max`; see [GPT Image 2.6 VIP per image](#gpt-image-2-6-vip-per-image). `gpt-image-2.6-web` at \$0.03 per call returns GIFs but not SVG; see [GPT Image 2.6 web route](#gpt-image-2-6-web-route) |

Image output tokens and cost for one 1024×1024 image in `OpenAI Official`, measured on November 5, 2026. Times are single runs against OpenAI:

| `quality` | Output tokens | Per image | Flare time | Sunburst time |
| - | -: | -: | -: | -: |
| `low` | 824 | \$0.025 | 8 s | 34 s |
| `medium` | 1,449 | \$0.043 | 11 s | 42 s |
| `high` | 1,756 | \$0.053 | 12 s | 59 s |
| `xhigh` | 3,122 | \$0.094 | 23 s | 86 s |
| `max` | 7,024 | \$0.211 | 39 s | 157 s |

* From `high` up, 2.6 costs the same as 2.5. At `low` and `medium` it uses 3–4 times the tokens, so 2.5 stays cheaper for large batches of drafts.
* Landscape 1536×1024 uses fewer tokens: 664 at `low`, 1,353 at `high`.
* Native 4K (3840×2160) at `high` uses about 3,337 tokens, about \$0.10.
* Always send `quality`. Without it, Flare picks a level from the prompt, and a detailed prompt can use about 5,800 tokens for one 1024 image. Sunburst defaults to `high`.

Generate a GIF:

```bash theme={null}
curl --fail-with-body "$BASE_URL/images/generations" \
  -H "Authorization: Bearer $LAOZHANG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6-flare",
    "prompt": "An orange cat stretches on a windowsill, then yawns while light rain falls outside, flat illustration style, looping animation",
    "output_format": "gif",
    "size": "512x512",
    "frame_count": 9,
    "frame_duration_ms": 200,
    "quality": "medium"
  }' -o gif.json
```

Save it as a `.gif` with `python save_images.py gif.json animation`. GIF rules:

* `frame_count` defaults to 9 frames. `frame_duration_ms` defaults to 200 and must be at least 20.
* All frames are rendered on one sheet, so a small `size` with many frames fails with `No supported sheet fits`. `512x512` with 4–9 frames works as is; nine frames at `medium` use about 2,073 tokens (about \$0.06).
* `stream` is not supported.

![Looping GIF from GPT Image 2.6 Flare: an orange cat stretching and yawning on a rainy windowsill](https://mintcdn.com/laozhangai-edd05f2c/12rpJOJJXqwT-_gR/images/samples/gpt26-en-gif.gif?s=b94485a5edd8435f6f655b736b977e39)

GIF returned by gpt-image-2.6-flare: 512×512, 9 frames, about 11 s

### Generate SVG vector images

GPT Image 2.6 on official forwarding can return SVG vector images, which suit icons, logos and simple illustrations: they scale without blurring, and you can edit colors and shapes directly. With default settings the SVG writing is free, so a 1024×1024 icon costs only the reference image: about \$0.025 at `low` and \$0.044 at `medium`. Set `output_format` to `svg`:

```bash theme={null}
curl --fail-with-body "$BASE_URL/images/generations" \
  -H "Authorization: Bearer $LAOZHANG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6-flare",
    "prompt": "A flat coffee cup icon with rising steam and a green leaf on the cup, warm brown and cream colors",
    "output_format": "svg",
    "quality": "medium",
    "size": "1024x1024"
  }' -o svg.json
```

Save it as a `.svg` with `python save_images.py svg.json icon`. OpenAI does this in two steps within one request. The image model first renders a reference image at your `quality`, then a GPT text model writes it out as SVG code.

* `svg.model` picks the text model that writes the SVG. Leave it out to use `gpt-6.1-terra`.
* To choose another, send for example `"svg": {"model": "gpt-5.5"}` (`gpt-5.5` adds a writing charge; see billing below). It must be a text model; an image model returns `model_not_found`.

Billing has two parts:

* Reference image: billed from `usage` at the official rate, like any other image.
* SVG writing is free with the default `gpt-6.1-terra` and with eight low-cost text models:
  * `gpt-5.4-mini`, `gpt-5.4-nano`, `gpt-5-mini`, `gpt-5-nano`
  * `gpt-4.1-mini`, `gpt-4o-mini`, `gpt-5.6-luna`, `gpt-6-luna`
* Any other writing model, such as `gpt-5.5` or `gpt-6-sol`, is billed at its official rate and reported in `svg_usage`. Usage logs convert that cost at equal value into text input tokens, shown in `svg_usage.billed_as_text_input_tokens`; with a free model the value is 0.

How the writing models compare (measured November 5, 2026, same 1024 icon prompt, at least 3 runs per model):

| `svg.model` | Success rate | SVG writing cost | Time | Result |
| - | - | -: | -: | - |
| `gpt-6.1-terra` (default) | 7/7 | Free | 33–43 s | Clean lines, close to gpt-5.5 |
| `gpt-5.5` | 3/3 | about \$0.09–0.16 | 42–70 s | Best detail |
| `gpt-6-sol`, `gpt-6.1-sol` | 2/3 each | about \$0.02–0.04 | 33–49 s | Good |
| `gpt-5.4-mini` | 3/3 | Free | 16 s | Rough shapes |
| `gpt-5.6-terra` | 0/3 | — | — | Not recommended |

Every failure was a 502 from OpenAI, not from the gateway. Unless you need something specific, leave out `svg.model` and use the default.

* Supported writing models: GPT text models such as GPT-5.x, GPT-6.x, GPT-4.1, GPT-4o and o3. Others return `unsupported_svg_model`, with no charge.
* Optional `svg.reasoning.effort` (low, medium, high and so on) sets how much the model thinks while writing. High measured 2.6–14 times the default's tokens; the default is enough for icons.
* Busier pictures mean longer SVG code, higher cost and longer waits.
* Detailed full scenes, such as a whole coffee-shop interior, mostly failed in our tests, each after 2–3 minutes. Use SVG for icons, logos and simple graphics.
* Only `/v1/images/generations` supports SVG. Edits and `stream` are not supported, and `n` must be 1.
* When OpenAI returns a 502, the gateway retries or switches to another route. If every attempt fails, you get an error, usually `svg_generation_failed`, with no charge and no reference image. Retry later or simplify the prompt.

![SVG vector icon from GPT Image 2.6: a steaming cream coffee cup with a green leaf, on a brown saucer](https://mintcdn.com/laozhangai-edd05f2c/opsNeKybSpGGbpi9/images/samples/gpt26-svg-coffee.svg?fit=max\&auto=format\&n=opsNeKybSpGGbpi9\&q=85\&s=21bb7f4e2c881bb9d48f640a48804353)

SVG icon from gpt-image-2.6-flare with default settings: 4 KB, about 42 s, about \\\$0.044 (only the medium reference image is billed; writing with gpt-6.1-terra is free)

## GPT Image 2.6 VIP per image

If you'd rather not pay by the token and mostly need PNGs at `high` quality or below, use the 2.6 VIP models: \$0.03 per image, with the same tokens as 2.5 VIP.

| Item | Details |
| - | - |
| Model IDs | `gpt-image-2.6-flare-vip`, `gpt-image-2.6-sunburst-vip`; same price, similar speed |
| Token group | `default` or another image group, billing mode **Usage first** or **Per-call** |
| Endpoints | `/v1/images/generations`, `/v1/images/edits` |
| Price | \$0.03 per image; size, quality, and generate vs. edit don't change it |
| `quality` | `low`, `medium`, `high`; `xhigh` and `max` return `400` with no charge |
| `size` | Same rules as 2.5 VIP, 1K to 4K generated natively; see [Size and quality in the GPT Image 2.5 guide](https://docs.laozhang.ai/en/api-capabilities/gpt-image-2-5.md#size-and-quality) |
| Output | PNG with transparent background support; `output_format: "jpeg"` still returns PNG |
| Not supported | GIF and SVG: `output_format` set to `gif` or `svg` returns `400` with no charge; use [2.6 official forwarding](#gpt-image-2-6-via-official-forwarding) instead |
| Time | Measured November 5, 2026: 1024×1024 about 25–55 s, 3840×2160 about 25–45 s, edits about 30–40 s |

```bash theme={null}
export LAOZHANG_API_KEY="YOUR_DEFAULT_GROUP_KEY"

curl --fail-with-body "https://api.laozhang.ai/v1/images/generations" \
  -H "Authorization: Bearer $LAOZHANG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6-flare-vip",
    "prompt": "A product photo of a white ceramic mug on a gray desk in soft natural light",
    "size": "2048x2048",
    "quality": "high"
  }' \
  -o generation.json

python3 save_images.py generation.json generation
```

Edits and transparent backgrounds work like the [GPT Image 2.5 VIP examples](https://docs.laozhang.ai/en/api-capabilities/gpt-image-2-5.md#per-call-vip-models): swap in a 2.6 `-vip` model ID and save results with the `save_images.py` script on this page.

Choosing between routes:

* **2.6 official forwarding**: a `high` 1024×1024 image costs about \$0.053 there, against \$0.03 on VIP. Use it for GIF, SVG, or faster output (Flare takes 8–12 s).
* **2.5 VIP**: also \$0.03 per image, with `xhigh` and `max`. Stay on 2.5 VIP when you need those tiers.
* **2.6 web route**: also \$0.03 per call and faster (usually 20–35 s), returns animated GIFs. It renders natively at up to about 2K and upscales 4K, so use it when 1K or 2K is enough; see [GPT Image 2.6 web route](#gpt-image-2-6-web-route).

## GPT Image 2.6 web route

Use `gpt-image-2.6-web` when you want animated GIFs at a flat \$0.03 per call, with your own frame count and frame duration. It takes the same token as the 2.5 web route and the VIP models.

| Item | Details |
| - | - |
| Model ID | `gpt-image-2.6-web`; you can't choose Flare or Sunburst |
| Token group | `default` or another image group, billing mode **Usage first** or **Per-call** |
| Endpoints | `/v1/images/generations` for generation (including GIF), `/v1/images/edits` for editing |
| Price | \$0.03 per call; size, frame count, and generate vs. edit don't change it |
| `size` | Same rules as VIP; see [Size and quality in the GPT Image 2.5 guide](https://docs.laozhang.ai/en/api-capabilities/gpt-image-2-5.md#size-and-quality). The image needs at least 655,360 pixels, so `512x512` is rejected; the smallest square is `816x816` |
| Output | PNG (default), `jpeg`, `webp`, `gif`. Native output is up to about 2K: a 4K `size` comes back at the requested dimensions with roughly 2K-level detail scaled up |
| Not supported | SVG: `output_format: "svg"` returns `400` right away with no charge. The edit endpoint can't return GIFs |
| Time | Measured November 5, 2026: PNG 1024×1024 about 15–35 s, edits about 20–30 s |

Generate an animated GIF:

```bash theme={null}
export LAOZHANG_API_KEY="YOUR_DEFAULT_GROUP_KEY"

curl --fail-with-body "https://api.laozhang.ai/v1/images/generations" \
  -H "Authorization: Bearer $LAOZHANG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6-web",
    "prompt": "A cute orange cat sitting and waving at the camera, flat cartoon style, plain light blue background, seamless loop",
    "size": "1024x1024",
    "output_format": "gif",
    "frame_count": 8,
    "frame_duration_ms": 120
  }' \
  -o gif.json
```

Save it as a `.gif` with `python save_images.py gif.json animation`. The file has exactly the frame count and frame duration you asked for, and it loops forever.

GIF rules:

* `frame_count` is 2–64 (default 9); `frame_duration_ms` is 20–2000 (default 200).
* Always pass `size`. Without it, the GIF comes back small and oddly sized (for example 439×390). `1024x1024` is a good default.
* `n` must be 1.
* `stream: true` doesn't stream: the whole GIF arrives once it's done.
* More frames take longer and make bigger files. At 1024×1024: 4–9 frames about 35–42 s and 1–2.5 MB; 16 frames about 100 s and about 5 MB; 64 frames about 2 min and about 18 MB, with softer frames. 2048×2048 with 9 frames takes about 54 s and is about 11 MB. Set your client timeout to at least 300 s.
* At busy times, large or many-frame GIFs can return `429` after about 2 minutes, with no charge. Retry later, or use fewer frames or a smaller size.

When a parameter is out of range you get `400` with no charge, but `message` only says the upstream didn't accept the request. Read `param` and `code` to find the cause:

| Case | `param` / `code` |
| - | - |
| Invalid size, such as `512x512` | `"param": "size"`, `"code": "invalid_value"` |
| `n` greater than 1 | `"param": "n"`, `"code": "invalid_value"` |
| `frame_count` or `frame_duration_ms` out of range | `"code": "invalid_image_request"` |
| GIF requested from the edit endpoint | `"code": "invalid_image_request"` |

Which route for GIFs:

* **2.6 web route**: 1024×1024 or larger, flat \$0.03 per call, frame control.
* **2.6 official forwarding**: small GIFs such as `512x512`, GIFs straight from an edit, or SVG. Billed by tokens; 512×512 with 9 frames at `medium` is about \$0.06. See [GPT Image 2.6 via official forwarding](#gpt-image-2-6-via-official-forwarding).
* **2.6 VIP**: no GIFs; use it for native 4K PNGs.

## Frequently asked questions

### Can I call GPT Image 2.6 without an OpenAI account?

Yes. You need only a LaoZhang API key, not an OpenAI account. All three routes use the OpenAI-compatible Images endpoints, so existing OpenAI SDK code needs only a new `base_url` and key, plus a 2.6 model ID.

### How much does the GPT Image 2.6 API cost per image?

The VIP models (`gpt-image-2.6-flare-vip`, `gpt-image-2.6-sunburst-vip`) cost \$0.03 per image, and the web route `gpt-image-2.6-web` costs \$0.03 per call; size and quality don't change the price.

Official forwarding bills by tokens: a 1024×1024 image costs about \$0.025 at `low` and \$0.053 at `high`, and a native 4K image at `high` about \$0.10; see [GPT Image 2.6 via official forwarding](#gpt-image-2-6-via-official-forwarding) for every tier. Non-200 responses aren't charged; see [Billing and failure rules](https://docs.laozhang.ai/en/api-capabilities/image-billing-and-failures.md).

## Related documentation

* [GPT Image 2.5 API](https://docs.laozhang.ai/en/api-capabilities/gpt-image-2-5.md): the previous model, whose VIP route supports `xhigh` and `max`
* [GPT Image 2.6 launch announcement](https://docs.laozhang.ai/en/announcements/gpt-image-2-6-2026-11.md)
* [Images API reference](https://docs.laozhang.ai/en/api-reference/images.md)
* [Choose an image generation API](https://docs.laozhang.ai/en/api-capabilities/image-generation-guide.md)
* [Call logs](https://docs.laozhang.ai/en/faq/call-logs.md)
* [Model and pricing catalog](https://docs.laozhang.ai/en/models.md)

## Sources

* [OpenAI image generation guide](https://developers.openai.com/api/docs/guides/image-generation)
* [OpenAI Images API reference](https://developers.openai.com/api/reference/resources/images)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.