Skip to main content
Generate and edit images with OpenAI GPT image models through the OpenAI-compatible interface. This document covers both the gpt-image-2 and gpt-image-2.5 series, which share the same generation, editing, and async endpoints but differ in model names, quality tiers, and resolution behavior.

Model Overview

gpt-image-2 also ships per-image SKU channels gpt-image-2-low / gpt-image-2-medium / gpt-image-2-high; gpt-image-2.5 does not use per-image SKUs. Enable the model on the OpenAI official or compatible channel first, then replace model in the examples with the exact model name. Actual model availability and parameter support are subject to channel validation.

Quickstart

Python SDK:

gpt-image-2

Supported quality tiers

low / medium / high. gpt-image-2 does not expose input_fidelity; output is high fidelity by default.

Parameters

stream and partial_images are official OpenAI fields, but gpt-image-2 does not support streaming image generation. Passing them yields no usable image stream events.

Resolution rules

gpt-image-2 accepts a size of widthxheight or auto. Any resolution is valid as long as all of these constraints hold: Sizes exceeding 2560x1440 (~2K) are experimental and may produce more variable results. Common values: Actual available sizes remain subject to the channel your account routes to.

Transparent backgrounds (preview)

gpt-image-2 supports transparent backgrounds:
  • Set background="transparent".
  • Use output_format="png" (default) or "webp"; jpeg does not support transparency.
  • Omit output_compression for PNG; WebP supports optional compression.

gpt-image-2.5

Model names

gpt-image-2.5-sunburst (precision editing) and gpt-image-2.5-flare (low latency).

Supported quality tiers

low / medium / high / xhigh / max / auto. xhigh / max are higher-fidelity tiers, and auto defers to the upstream selection — usage depends on what upstream actually chooses.

Parameters

Notes

  • The 2.5 series uses resolution tiers (1K / 2K / 4K) with aspect_ratio, rather than gpt-image-2’s exact pixel sizes.
  • Returning URLs requires platform object storage configuration.
  • Billing is token-based by default: text input 5/M,cachedtext5/M, cached text 1.25/M, image input 8/M,cachedimage8/M, cached image 2/M, image output $30/M (M = million tokens; account pricing prevails). 2.5 does not use the gpt-image-2-low-* per-image SKUs. Rate source: OpenAI pricing.

Text-to-image /v1/images/generations

Both series share this endpoint; the model field selects the model. Example request:

Response

URL output

Set response_format=url to obtain an image URL:
The platform applies a local fallback strategy for URL output:
  1. Request the image result.
  2. Transfer the image to platform object storage.
  3. Return an accessible URL in data[].url.
The behavior is deterministic:
  • If object storage is configured, data[].url is returned.
  • If not, image_url_not_available is returned.
  • It never silently degrades to b64_json.

Image editing /v1/images/edits

JSON request body

Specify the base image via images[].image_url or images[].file_id:
Multiple-reference example:

Multipart upload

Edit parameters

images[].image_url and images[].file_id are mutually exclusive. Some compatible channels are internally rewritten to multipart by the platform to guarantee execution, which does not change the externally exposed interface.

Async image tasks

The platform offers managed async image task endpoints. This is not OpenAI’s backend task protocol; the platform first creates an image_<ULID> task, a background worker runs the synchronous image request, and the polling endpoint returns the hosted image URL.

Text-to-image task

Query the task:

Edit task

Async tasks require publicly accessible object storage. Without it, creating a task returns storage_not_configured.

Billing

Token-billed channels settle by recorded or upstream token usage: With upstream usage, billing follows that usage; otherwise it is estimated from the number of successfully returned images, sizes, and the 2.5 quality coefficient. For auto, usage depends on upstream selection; results without usage represent only a platform estimate. Per-image estimates are for cost estimation only — actual bills follow consumption logs and the platform’s “Model Pricing” page. Per-image and token billing differ in discounts, unit prices, and billing fields. Reconcile against actual amounts in consumption logs; do not treat the display token bucket as an extra billing line.

Error codes