AvailableOpenAIImageSync / AsyncCache 75% off
gpt-image-2

Build next-gen apps with gpt-image-2

API Code Example

Pricing

Text to Image / Image Edit · Image

Per 1M Tokens
Official Price
Input $5.00 / Output $30.00
TokenLab Price
Input $3.50 / Output $21.00
Discount
30%

One-click test

Sign in once and Web Agent keeps this model, prompt, and request preset for you.

Test gpt-image-2 in Web Agent. Run the recommended text-to-image image request at /v1/images/generations, then show the request body, returned image or task status, and model-specific constraints.

API workbench

The default route for production. The code sample below uses this endpoint with the format you pick.

Image EditText 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 '{
  "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."
}'

Use cases

Best for

Text to Image

Producing product imagery, illustrations, and design variations

01

Product visuals

Make campaign images, catalog scenes, and design directions from a few prompts.

02

Iterative editing

Try edits and variations using the request shape this model already accepts.

03

Creative QA

Sanity-check prompt behavior, output count, and response mode before you ship.

04

Side-by-side test

Compare real response quality, latency, and price for production defaults.

Prompt examples

Generate a clean product shot of matte black headphones on a soft blue gradient.

Edit the source image into a premium ecommerce hero with natural shadows.

Give me three visual directions for a developer-tool launch banner.

Cost Calculator

1M
0.5M
Estimated Monthly Cost$14.00

FAQ

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.

What is gpt-image-2 best for?

gpt-image-2 is a strong fit for Text to Image, Image Edit. You can call it through TokenLab with one API key.

How do I call the gpt-image-2 API?

Get a TokenLab API key, then send your request to https://api.tokenlab.sh/v1/images/generations. The API workbench above has a recommended endpoint and copy-ready code.

Which endpoint should gpt-image-2 use?

Use https://api.tokenlab.sh/v1/images/generations as the default for gpt-image-2. If a provider-native format is supported, the API workbench shows that endpoint too.

Can I test gpt-image-2 before integrating it?

Yes. Try in Web Agent opens a ready test for gpt-image-2 and keeps your prompt after sign-in, so you don’t lose context.

Which operations does gpt-image-2 support?

gpt-image-2 supports Image Edit, Text to Image. Pick an operation in the API workbench above to see the matching endpoint and code sample.

Related Models