Skip to main content
POST
The Playground provides three named examples: raster PNG with complexity, SVG, and a two-frame GIF. Enter Bearer sk-xxx under Authorization, choose an example, edit the prompt, and send the request.
data[0].b64_json has no data: prefix, and SVG and GIF responses are also base64-encoded. The browser Playground may be unable to display a long base64 response even when the request succeeded. Use the Python example below to decode and save the result locally.

Model selection

GPT Image 2.6 was released on 2026-11-04. It retains /v1/images/generations and /v1/images/edits, and adds complexity control, SVG output, animated GIF output, and markup-guided editing. See the model pricing directory for current token rates. Actual cost depends on size, quality, output format, and token usage. SVG also incurs authoring-model charges, so its cost is not comparable to a standard PNG.

New capabilities

Complexity control

Controls planning before rendering, independently of the quality setting.

SVG vector output

Returns editable paths, shapes, and colors for icons, illustrations, and UI assets.

Animated GIF output

Produces a complete GIF in one request with frame count and frame duration controls.

Markup-guided edits

Uses a transparent annotation layer to identify the edit region while the prompt describes the change.

complexity: control planning

complexity controls how much the model plans before rendering. It is intended for dense text, complex layouts, and relationships between objects. quality controls rendering quality instead; the two settings serve different purposes. Complexity has no separate fee. Higher levels can increase latency and introduce unwanted changes. Compare results for your task instead of assuming that a higher level is always better.
APIYI passes this parameter through natively: the low / medium / high levels pass through as-is (defaulting to high when omitted), with no extra field or group configuration required.
The upstream error response in our test also listed none, xhigh, and max, and the current route accepted them. OpenAI’s public guide documents low / medium / high; production requests should use those official levels rather than relying on additional values as a long-term compatibility guarantee.

SVG: generate editable vector files

Set output_format: "svg". The current upstream also requires the nested svg.model field to select the text model that authors the vector code:
Vector rocket icon with red fins, a blue window, and a white body

A real SVG generated through APIYI's passthrough route: editable path and circle elements

Authoring model selection and billing

The client specifies svg.model; APIYI does not select it randomly. The supported set depends on the upstream and current group, so support is not guaranteed for every OpenAI text model. This page verifies gpt-5.6-terra, gpt-6-luna, and gpt-4.1-mini; test other models in your actual group. Authoring charges use the input and output token rates of the selected text model:
  • Authoring cost = svg_usage.input_tokens × input rate + svg_usage.output_tokens × output rate.
  • Total SVG cost = reference-image cost + authoring-model cost. The image model creates a reference image before the text model authors the SVG.
  • Successful responses include both usage and svg_usage: usage covers the reference image, while svg_usage covers the authoring model. Both contribute to cost.
  • svg_usage.reasoning_tokens is already included in svg_usage.output_tokens. Do not add it again.
In an APIYI passthrough test on 2026-11-05 using gpt-image-2.6-sunburst and gpt-5.6-terra, the response included these usage fields:
Using the current directory rates for gpt-5.6-terra of $2 per million input tokens and $12 per million output tokens, the estimated authoring charge is 1572 ÷ 1000000 × 2 + 850 ÷ 1000000 × 12 = \$0.013344, excluding the reference-image charge. The following authoring models were tested with the same prompt. All returned real SVG without scripts, embedded raster images, or external references: All three requests reported the same reference-image usage: 100 input, 824 output, and 924 total tokens, billed separately. The response model name for gpt-4.1-mini was gpt-4.1-mini-2025-04-14. Prices can change and tiered rates can vary by group. See the model pricing directory and your bill for actual charges. A single image per model is not a quality ranking.

Limitations

  • SVG is available only through /v1/images/generations with n=1. The edit endpoint does not support SVG output or SVG as a raster input.
  • Streaming, partial images, output_compression, and prompt_rewriter are unsupported.
  • The result is static vector XML without scripts, external resources, or embedded raster images. Decode and save it as .svg, not as a PNG.

GIF: generate looping animations

Set output_format: "gif" and describe the subject, motion, and loop in the prompt. Both /v1/images/generations and /v1/images/edits support GIF; for edits, pass reference images in images and the first image becomes the animated subject. This low-cost example should produce 2 frames at 100ms each, for a total duration of 0.2 seconds:
Two-frame looping animation of a yellow circle moving right and returning to its starting position

A real GIF generated through APIYI's passthrough route: 2 frames and 0.2 seconds

Size boundaries: every frame shares one sheet

GPT Image 2.6 draws all frames into a single sprite sheet and then cuts it into frames, so the limits apply to the sheet rather than to one frame: The sheet layout is fixed: 4×2 for 2–8 frames, 3×3 for 9, 4×3 for 10–12, and 4×4 for 13–16. Converted to the maximum square frame: Rules of thumb:
  • 512×512 works for all 2–16 frames — the safest choice
  • 768×768 works up to 12 frames; at 16 frames the sheet is 3072×3072 = 9,437,184, over budget
  • 960×960 works up to 9 frames
  • 1024×1024 and 2048×2048 never work. At 1024² the 2–8 frame sheet is 4096 wide, past the 3840 edge; 2048² needs 8192×4096 with only 2 frames
  • frame_count values of 1 or 17 do not return 400: this route drops frame_count and frame_duration_ms and falls back to the default 9 frames / 1.8 seconds. Use ffprobe below to confirm the real frame count
  • With n > 1, this route validates each image separately and does not add them up: 2 images × 16 frames × 512² (8,388,608 total) still succeeded. The official guide says multiple animations must fit the same budget; go by the actual response
  • For a wider picture, change the aspect ratio: 9 frames of 1280×720 produce exactly a 3840×2160 sheet
Exceeding the boundary returns 400 with param: "size". The two common errors:
GIF output does not support streaming, partial images, custom output_compression, or prompt_rewriter. frame_count and frame_duration_ms apply to GIF only — do not send them with PNG, JPEG, WebP, or SVG.

GIF through the edit endpoint

/v1/images/edits also accepts output_format: "gif". The first input image becomes the animated subject; the remaining fields match the generation endpoint:
The sheet budget was measured on the official relay on 2026-11-09: 8,294,400 passes at the exact limit, while 12 frames of 832² (only 12,288 pixels over) is rejected. The model side can change it; the 400 error you actually receive is authoritative.

Verify the actual frame count

Do not rely only on HTTP 200 or the response’s output_format. If a route drops the frame fields, it can still return a default 9-frame, 1.8-second GIF. Inspect the actual file with ffprobe:
For this example, expect nb_read_frames=2 and duration=0.200000.

Markup-guided edits

GPT Image 2.6 also supports markup-guided edits through the markup field on /v1/images/edits:
  1. Keep the original image as the first input.
  2. Create a transparent PNG at the same dimensions and add circles, arrows, or sketches around the region to change.
  3. Upload that annotation layer as markup, then describe the change and the details to preserve in prompt.
  4. Markup applies to the first input image and cannot be combined with mask or prompt_rewriter.
For ordinary editing, multi-image fusion, and masks, see the Image Edit API. Markup forwarding must be verified separately on the target route; this page does not present it as a tested interactive example.

Client-side decoding

All output formats use data[0].b64_json; only the file extension changes:
SVG decodes to UTF-8 XML, while GIF and raster formats decode to binary files. Production code should also check the HTTP status, error field, and actual file signature rather than trusting the extension alone.

Route compatibility and troubleshooting

New 2.6 fields require native JSON passthrough. Compatibility can vary across upstream routes, and these public examples do not guarantee identical behavior in every group. Verify them in the group your account actually uses.

Authorizations

Authorization
string
header
required

API Key obtained from the APIYI Console

Body

application/json
model
enum<string>
default:gpt-image-2.6-sunburst
required

Flare is optimized for fast iteration; Sunburst is intended for detailed visual work

Available options:
gpt-image-2.6-flare,
gpt-image-2.6-sunburst
prompt
string
required

Prompt text in English or Chinese. For GIF, describe the subject, motion, and loop

Maximum string length: 32000
Example:

"A minimal flat vector icon of a rocket, three solid colors, no text"

complexity
enum<string>
default:high

Planning complexity before rendering, independent of quality. Official levels are low / medium / high, with high as the default when omitted. No separate fee

Available options:
low,
medium,
high
size
string
default:auto

Output size as a preset or a valid WIDTHxHEIGHT string. For GIF this is the size of each frame and both dimensions must be multiples of 16; n × frame_count × frame pixels must fit the total pixel budget (sheet edge ≤3840, total ≤8,294,400, ≥655,360)

Example:

"1024x1024"

quality
enum<string>
default:auto

Rendering quality, independent of complexity. For SVG, controls the reference image quality

Available options:
auto,
low,
medium,
high,
xhigh,
max
output_format
enum<string>
default:png

Output format. SVG and GIF are generation-only and do not support edits, streaming, partial images, or output_compression

Available options:
png,
jpeg,
webp,
svg,
gif
output_compression
integer

Compression level for jpeg / webp only; do not use with SVG or GIF

Required range: 0 <= x <= 100
Example:

85

background
enum<string>
default:auto

Background mode. transparent requires a compatible output format; JPEG does not support transparency

Available options:
auto,
opaque,
transparent
moderation
enum<string>
default:auto

Moderation strength

Available options:
auto,
low
n
enum<integer>
default:1

Number of results. The examples and SVG output use 1

Available options:
1
svg
object

SVG-specific configuration. The current upstream requires svg.model when output_format=svg

frame_count
integer
default:9

GIF frame count. Official range: 2–16; default: 9. Only valid when output_format=gif. Out-of-range values fall back to the 9-frame default on the gateway. Sheet layout: 4×2 for 2–8 frames, 3×3 for 9, 4×3 for 10–12, 4×4 for 13–16; max square frame is 960 / 816 / 720

Required range: 2 <= x <= 16
Example:

2

frame_duration_ms
integer
default:200

Duration of each GIF frame in milliseconds, 20–2000, rounded to 10ms; default 200. Only valid when output_format=gif

Required range: 20 <= x <= 2000
Example:

100

Response

Generation succeeded; returns base64-encoded PNG, JPEG, WebP, SVG, or GIF

created
integer

Unix timestamp

background
string

Effective background mode

Example:

"opaque"

data
object[]

Generated results

output_format
string
Example:

"gif"

quality
string
Example:

"low"

size
string
Example:

"512x512"

usage
object

Token usage for the image model

svg_usage
object

Authoring-model usage returned for SVG output. The client selects the model through svg.model, and charges use that text model's input and output token rates. reasoning_tokens is already included in output_tokens and must not be added again