GPT Image Series
GPT Image 2 Official
Text-to-image, reference editing and masked inpainting, billed from token usage
POST
GPT Image 2 Official
gpt-image-2 is the official API line for GPT Image 2. Use it for product imagery, posters, illustration, and edits based on visual references. Every operation uses the unified POST /v1/tasks endpoint.
For fixed per-image pricing, see
gpt-image-2-rev. Both lines use the same task endpoint, but have separate model IDs, parameters, and billing. QWave never switches between them automatically.Quick start
task_id. Retrieve the result with GET /v1/tasks/{task_id}, wait inline with Prefer: wait, or configure a webhook.
Request parameters
string
required
Must be
gpt-image-2.string
default:"generate"
generate: create an image from textedit: edit reference images; requiresimage_urls
string
required
The image description or editing instruction.
string[]
Reference image URLs. Required for
edit; up to 16 images.string
URL of an inpainting mask. Requires
image_urls and must match the first reference image dimensions.string
default:"1:1"
One of
1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 2:1, 1:2, 3:1, 1:3, 21:9, or 9:21.string
default:"1k"
Output resolution:
1k, 2k, or 4k.string
default:"low"
low, medium, or high. Higher quality usually consumes more output tokens.integer
default:"1"
Number of images to generate. Value:
1. Each request returns one image.string
default:"auto"
auto, opaque, or transparent. Transparent output requires png or webp.string
default:"png"
png, jpeg, or webp.integer
JPEG/WebP compression from
0 to 100. Set output_format to jpeg or webp when using it.string
default:"auto"
Moderation level:
auto or low.callback_url, callback_events, Prefer: wait, Idempotency-Key, and the maximum-cost header.
The official line does not support seed. Any other parameter returns 400 and is not billed.
Limits
Pricing
The official line is billed from actual token usage across five dimensions: text input, cached text input, image input, cached image input and image output. Rates are inprice_config on GET /v1/models and in the console’s Model Market. What a single call actually cost is the cost field on the task response — an integer quota at 500,000 quota = 1 USD, not dollars.
Image input includes reference images and masks. Cached rates apply only when the upstream response reports cache usage that can be settled. Otherwise, billing uses ordinary input and image-output usage.
Holds and settlement
Submitting a task places a hold for the estimated usage; the task then settles from actual usage and the difference is released. The estimate is built from:- Output — expected output tokens, looked up by aspect ratio, resolution and quality
- Text input — a floor of 32 tokens
- Reference images — 4,096 tokens each; masks count as image input too
high is estimated at roughly 36× the tokens of low, and 4k is several times 1k again — combined, per-image cost spans two orders of magnitude. quality is the parameter with the largest effect on cost on this line, and it defaults to low. Aspect ratio matters too: at the same quality, 16:9 uses fewer output tokens than 1:1.
The estimated output tokens for every aspect-ratio / resolution / quality combination are in price_config.image_usage_reservation on GET /v1/models.
You are only billed for a successfully generated image. Failed and cancelled tasks, and tasks that return no usable image, are refunded in full. See Task status for the billing fields.
Response
Completed task
result.images. Failed and cancelled tasks release the hold in full. If an upstream success response contains no deliverable image, QWave marks the task as failed and refunds it.