Choose Auto, TokenLab Verified, or Official for each request, with prices shown up front. See what's new

OpenAI: GPT Image 2

GPT Image 2 creates and edits images from written directions and image references. Flexible sizing and detailed visual input make it useful for refining artwork, adjusting a product scene, or developing a composition through several edits.
Compare models
gpt-image-2
AvailableOpenAIImageSync / AsyncCached input 75% less
Input / Output-30%
$5.00 / $30.00$3.50 / $21.00
Modalities
Image

About GPT Image 2

gpt-image-2 is OpenAI's image model for generating and editing pictures from written directions and reference images. It accepts text and images and returns images through the image generation and image edit endpoints. It supports inpainting, flexible output sizes, and high-fidelity image inputs. GPT Image 2.5 Flare and Sunburst now succeed it, so it is mainly the established option.

Where it works well

  • Generates from text and edits from reference images in the same model.
  • Supports inpainting, so a masked region can change while the rest stays put.
  • Offers flexible image sizes, which helps when a layout needs a particular shape.
  • Takes high-fidelity image input, useful for keeping a product or subject recognizable across edits.

When to choose another model

  • GPT Image 2.5 Flare produces higher-quality images with lower latency, per OpenAI, so it is the better default for new work.
  • Sunburst gives tighter control across edits, which gpt-image-2 does not match on premium revisions.

Getting started

  1. Create API key

    Create a key in Console, then use it with every model on the platform.

  2. Send your first request

    Copy the example for your language and run it against the endpoint.

    Image editingText to imageTokenLab endpoint
    POST/v1/images/generations
    curl -X POST "https://api.tokenlab.sh/v1/images/generations" \
      -H "Authorization: Bearer sk-xxx" \
      -H "Content-Type: application/json" \
      -d '{
      "background": "auto",
      "operation": "text-to-image",
      "quality": "auto",
      "size": "auto",
      "model": "gpt-image-2",
      "prompt": "A minimalist product photo of matte black headphones on a soft blue background."
    }'

Parameters

Image editing

ParameterValues and limitsDefaultNotes
asyncNot providedNot providedNot provided
backgroundauto, opaqueNot providedNot provided
compressionNot providedNot providedNot provided
file_idNot providedNot providedNot provided
imageInputs: ≥ 1, ≤ 16Not providedUse at least one and at most 16 source images in total across URL, upload and file references. A mask applies to the first image.
image_urlInputs: ≥ 1, ≤ 1Not providedNot provided
image_urlsInputs: ≥ 1, ≤ 16Not providedNot provided
imagesInputs: ≥ 1, ≤ 16Not providedNot provided
maskNot providedNot providedNot provided
moderationNot providedNot providedNot provided
nNot provided1Defaults to one output image. The model-specific maximum is not yet verified for this public operation.
operationNot providedNot providedNot provided
output_compressionNot providedNot providedNot provided
output_formatpng, jpeg, webpNot providedNot provided
promptNot providedNot providedNot provided
qualityauto, low, medium, highNot providedNot provided
response_formatNot providedNot providedThe public image response selector accepts url or b64_json. A URL-only supply rejects b64_json before upstream execution. Omit this field to keep the selected supply response representation; no uniform omitted-field default is declared here.
sizeNot providedNot providedSize accepts auto or WIDTHxHEIGHT. Both dimensions must be multiples of 16; the longest edge is at most 3840 pixels, the long-to-short ratio is at most 3:1, and total pixels range from 655360 through 8294400.
userNot providedNot providedNot provided

GPT Image 2 accepts `background=auto` or `background=opaque`; transparent backgrounds are not supported by the model.

Image edits accept multipart image uploads, JSON image_url, JSON image_urls, or a JSON images array with image_url/file_id references. Create file IDs through TokenLab /v1/files. Up to 16 source images are supported; a supplied mask applies to the first image.

Text to image

ParameterValues and limitsDefaultNotes
asyncNot providedNot providedNot provided
backgroundauto, opaqueNot providedNot provided
compressionNot providedNot providedNot provided
moderationNot providedNot providedNot provided
nNot provided1Defaults to one output image. The model-specific maximum is not yet verified for this public operation.
operationNot providedNot providedNot provided
output_compressionNot providedNot providedNot provided
output_formatpng, jpeg, webpNot providedNot provided
promptNot providedNot providedNot provided
qualityauto, low, medium, highNot providedNot provided
response_formatNot providedNot providedThe public image response selector accepts url or b64_json. A URL-only supply rejects b64_json before upstream execution. Omit this field to keep the selected supply response representation; no uniform omitted-field default is declared here.
sizeNot providedNot providedSize accepts auto or WIDTHxHEIGHT. Both dimensions must be multiples of 16; the longest edge is at most 3840 pixels, the long-to-short ratio is at most 3:1, and total pixels range from 655360 through 8294400.
userNot providedNot providedNot provided

Use response_format to select URL or base64 image output from TokenLab.

GPT Image 2 accepts `background=auto` or `background=opaque`; transparent backgrounds are not supported by the model.

Size accepts `auto` or WIDTHxHEIGHT. Custom dimensions must both be multiples of 16, max edge <= 3840px, long/short ratio <= 3:1, and total pixels between 655,360 and 8,294,400.

Use response_format to select URL or base64 image output from TokenLab.

Image streaming and partial-image delivery are not supported. TokenLab rejects stream=true, partial_images, and input_fidelity.

Pricing

The Verified price applies to Verified, which costs less on most models. The Official price is the model maker's published price and applies to the more reliable Official route. Auto bills the route that completes the request.

Text to image / Image editing · Image

per 1M tokens
Official price
Input $5.00 / Output $30.00 / Text Input $5.00 / Text Input · Cache read $1.25 / Image Input $8.00 / Image Input · Cache read $2.00 / Image Output $30.00
Verified price
Input $3.50 / Output $21.00 / Text Input $3.50 / Text Input · Cache read $0.875 / Image Input $5.60 / Image Input · Cache read $1.40 / Image Output $21.00
Discount
-30%

Default spec

per 1M tokens
Official price
Cache read $1.25
Verified price
Cache read $0.875
Discount
-30%
Prompt cache pricing

Cache read

Official price
$1.25
Verified price
$0.875
Discount
-30%

Usage & activity

Success rate is the share of requests that completed. Latency is how long a full response takes; P95 means 95% of requests finished within that time.

Usage & availability

Last 24 hours
Requests
Success rate
P95 latency
Total tokens
Model performance
30-day success rate
99.9%
7-day median latency
36.5sn=1,357
7-day P95 latency
210.4sn=1,357
30-day requests
6K+
Last active
1 hour ago

Data is based on aggregate user requests, excluding status checks.

Open in Console

Open GPT Image 2 in Console with a prompt ready to edit or send.

Help me create an image with gpt-image-2 using text-to-image at /v1/images/generations. Show the result, cost, and any limits I should know.

Use cases

Best for
  • Text to Image
  • Product scene edits

    Place an existing product shot in a new background or setting while the item itself stays intact.

  • Concept art iteration

    Describe a composition, then refine it through several edit passes, changing colour, mood, or layout one step at a time.

  • Marketing visuals

    Create banners and social images that follow the style and subject of references you supply, at the size your layout needs.

  • Masked retouching

    Replace one area, such as a sign or a sky, using inpainting.

Prompt examples

A ceramic coffee mug on a walnut desk beside a window, soft morning light, shallow depth of field.

Keep the sneaker as it is and change the background to a rain-wet city street at night.

Replace the blank poster in the masked area with a retro travel poster of Lisbon.

This model has conditional pricing. Monthly token totals alone cannot produce a reliable estimate; use the detailed pricing for the request specification, cache, and applicable time window.

FAQ

What is gpt-image-2 used for?

It is an OpenAI model that creates and edits images from text and image inputs. It is reached through the image generation and image edit endpoints.

Can gpt-image-2 edit an existing image?

Yes. It supports the image edits endpoint with reference images and inpainting, so you can change one part of a picture while the rest of the image stays unchanged.

Should I use gpt-image-2 or GPT Image 2.5?

OpenAI says Flare gives higher quality than gpt-image-2 at half the latency, and Sunburst is for premium editing control. Stay on gpt-image-2 only where outputs are already approved.

Does gpt-image-2 support different sizes?

Yes. OpenAI documents flexible image sizes and high-fidelity image inputs, so you can request the aspect ratio your layout needs and still keep detail from a supplied reference.

What does it output?

Images only. It does not return text answers or video, and it works through the image generation and edit endpoints rather than through chat completions requests.

How much does GPT Image 2 cost?

On TokenLab, GPT Image 2 costs Input $3.50 / Output $21.00 per 1M tokens. The pricing table above shows the full breakdown. Rates depend on the billing unit, specification, and usage. Compare matching conditions in the model's detailed pricing; a single rate does not determine the total cost.

Which endpoint should GPT Image 2 use?

Use https://api.tokenlab.sh/v1/images/generations for GPT Image 2. The request example below shows the matching code shape.

Which operations does GPT Image 2 support?

GPT Image 2 supports Image editing, Text to image. Select an operation above to see its endpoint and request example.

Compare GPT Image 2

Guides that use GPT Image 2

Sources

Reviewed Oct 2, 2026

More from GPT Image

Related models