ToAPIsToAPIs
GPT-Image-2.6

GPT-Image-2.6 Official Image Generation

Async Sunburst and Flare image tasks through the official channel, with markup-guided editing, GIF and SVG output, R2 delivery and token pricing

POST
/v1/images/generations

Access both GPT-Image-2.6 models through the official channel. Submission returns an asynchronous task ID immediately. Images are generated in the background and stored in R2 before delivery.

Modelmodel
Sunburst Officialgpt-image-2.6-sunburst-official
Flare Officialgpt-image-2.6-flare-official

You must use the full model name from the table. gpt-image-2.6-official is only the series name and cannot be used as model.

Users in mainland China can replace https://api.toapis.com in the examples with https://api.toapis.cn. Create an API Key in the console and set the TOAPIS_API_KEY environment variable.

Submit and poll

Submit a Flare image. Swap model to call Sunburst:

curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare-official",
    "prompt": "A small blue circle on a plain white background",
    "size": "1:1",
    "resolution": "1k",
    "quality": "medium",
    "n": 1
  }'
{
  "id": "tsk_img_example",
  "object": "generation.task",
  "model": "gpt-image-2.6-flare-official",
  "status": "pending",
  "progress": 0,
  "created_at": 1789099098,
  "metadata": {}
}

Keep the id from the submit response and replace TASK_ID below:

curl --fail-with-body \
  --url https://api.toapis.com/v1/images/generations/TASK_ID \
  --header "Authorization: Bearer $TOAPIS_API_KEY"

The submit response is pending. Polling may show queued or in_progress, ending in completed or failed. On completed read the R2-delivered result URL from result.data[].url; on failed read error. Poll the same task ID every few seconds; high-quality generation can take several minutes, so do not resubmit while waiting. See the image task status API for all fields.

Request parameters

Authorizationstringheaderrequired

Use a ToAPIs API Key in the form Bearer YOUR_API_KEY.

modelstringbodyrequired

gpt-image-2.6-sunburst-official / gpt-image-2.6-flare-official.

promptstringbodyrequired

Image description. With reference or markup images, describe what to keep and what to change.

sizestringbodydefault: auto

Aspect-ratio names (such as 1:1, 3:2, 2:3, 16:9, 9:16) or pixel sizes (such as 1024x1024, 1536x1024). For GIF output see the GIF section for size semantics. Pixel dimensions must be multiples of 16 on both sides (minimum 16), each side must not exceed 3840, and the long-to-short side ratio must not exceed 3:1; sizes beyond 2560x1440 are experimental.

resolutionstringbody

Resolution tier 1k / 2k / 4k. When set explicitly it takes precedence over the tier inferred from size. The tier affects actual token usage and latency.

qualitystringbodydefault: medium

Six tiers: auto, low, medium, high, xhigh, max. auto lets the model pick the tier per request. Quality affects actual token usage and latency.

nintegerbodydefault: 1

Generates 1 to 4 images per request. n must be 1 when output_format is svg.

output_formatstringbody

Output format png / jpeg / webp / gif / svg. Uses the upstream default when omitted. See the GIF and SVG sections for their extra parameters and restrictions.

output_compressionintegerbody

Compression level 0-100, applies to jpeg and webp output only.

backgroundstringbody

transparent / opaque / auto. Explicit transparency only applies to png / webp output; svg is transparent by default.

moderationstringbody

Content moderation level auto / low.

complexitystringbody

Generation complexity low / medium / high; defaults to high when omitted. Not billed separately.

Reference images and masks

For image-to-image editing, add image_urls to the same JSON request, up to 16 images. URLs must be reachable by the server. You can get URLs through the image upload API first. Reference images are billed as image input tokens.

mask_url points to a PNG alpha mask whose size must match the first reference image, and it requires image_urls.

curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-sunburst-official",
    "prompt": "Keep the subject and replace the masked area with a snowy forest",
    "image_urls": ["https://example.com/reference.png"],
    "mask_url": "https://example.com/mask.png",
    "quality": "high",
    "size": "1024x1024",
    "n": 1
  }'

Markup-guided editing

markup_url points to an annotated reference image (or pass an inline annotation object via markup). Together with image_urls for the source image, the model edits according to the annotations. markup_url and mask_url are mutually exclusive; each request can use only one.

curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-sunburst-official",
    "prompt": "Follow the markup annotations to adjust the layout",
    "image_urls": ["https://example.com/reference.png"],
    "markup_url": "https://example.com/markup.png",
    "quality": "high",
    "n": 1
  }'

GIF output

Set output_format to gif to generate an animation. frame_count sets the frame count (2-16) and frame_duration_ms sets the per-frame duration. GIF is text-to-image only and cannot be combined with image_urls, mask_url, markup_url, markup, or output_compression. Pass size as an exact pixel size (for example 512x512) or omit it to use the upstream default frame dimensions; aspect-ratio values such as 1:1 are rejected for GIF.

curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare-official",
    "prompt": "A paper airplane looping across a blue sky, flat illustration",
    "output_format": "gif",
    "frame_count": 8,
    "frame_duration_ms": 200,
    "size": "512x512",
    "n": 1
  }'

SVG output

Set output_format to svg to generate vector graphics. You must also pass the svg object with svg.model inside. SVG is text-to-image only, n must be 1, and it cannot be combined with image_urls, mask_url, markup_url, markup, or output_compression. SVG generation additionally invokes the text model named by svg.model and bills that call at the corresponding text-model rate.

curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare-official",
    "prompt": "A minimalist mountain logo, flat vector style",
    "output_format": "svg",
    "svg": { "model": "gpt-5" },
    "n": 1
  }'

Token pricing

Both official models bill per token category: text input, cached text input, image input, cached image input, and image output are priced separately. Quota is reserved on submission, then settled against actual token usage with refunds or top-ups.

Cost formula in USD:

USD = (
  uncached_text_input_tokens * text_input_price
  + cached_text_input_tokens * cached_text_input_price
  + uncached_image_input_tokens * image_input_price
  + cached_image_input_tokens * cached_image_input_price
  + image_output_tokens * image_output_price
) / 1,000,000

GIF is billed on the output tokens of the whole animation. SVG output additionally produces one text-model call at the svg.model rate on top of image tokens.

Account-specific pricing or discounts still apply. Final charges can be verified in usage logs; the latest prices are on the pricing page and in your account configuration.

GPT-Image-2.5 Official, standard, and VIP editions use their own full model names. Use the -official suffix when calling this official channel.