Skip to content

GPT Image 2

GPT Image 2 is OpenAI's state-of-the-art image generation model, built for fast, high-quality image generation and editing with flexible sizes and high-fidelity image inputs.

Image Gen
index.ts
import { experimental_generateImage as generateImage } from 'ai';
const result = await generateImage({
model: 'openai/gpt-image-2',
prompt: 'A red balloon on a wooden table.'
});

Playground

Try out GPT Image 2 by OpenAI. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.

Providers

Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.

Provider
Context
Latency
Throughput
Input
Output
Cache
Web Search
Per Query
Capabilities
ZDR
No Training
Release Date
OpenAI
Legal:Terms
Privacy
$5.00/M+1 more
$30.00/M
Read:$1.25/M
Write:
04/21/2026

More models by OpenAI

Model
Context
Latency
Throughput
Input
Output
Cache
Web Search
Per Query
Capabilities
Providers
ZDR
No Training
Release Date
1M
2.8s
66tps
$5.00/M
$30.00/M
Read:
$0.5/M
Write:
$10.00/K
+ input costs
azure logo
openai logo
04/24/2026
400K
1.6s
190tps
$0.75/M$4.50/M
Read:$0.07/M
Write:
$10.00/K
+ input costs
azure logo
openai logo
03/17/2026
400K
0.4s
17tps
$0.20/M$1.25/M
Read:$0.02/M
Write:
$10.00/K
+ input costs
azure logo
openai logo
03/17/2026
1.1M
0.9s
55tps
$2.50/M
$15.00/M
Read:
$0.25/M
Write:
$10.00/K
+ input costs
azure logo
openai logo
03/05/2026
128K
1.0s
96tps
$1.25/M$10.00/M
Read:$0.13/M
Write:
$10.00/K
+ input costs
azure logo
openai logo
11/12/2025
131K
0.1s
880tps
$0.35/M$0.75/M
Read:$0.25/M
Write:
baseten logo
bedrock logo
cerebras logo
+5
08/05/2025

About GPT Image 2

GPT Image 2 was released on April 21, 2026 on AI Gateway as OpenAI's state-of-the-art image generation model. It's built for fast, high-quality image generation and editing, with flexible image sizes and high-fidelity image inputs that make it practical for both creation and editing workflows.

Flexible sizing means you can request output dimensions that match the surface you're rendering into (square avatars, wide hero images, tall mobile assets) without forcing the model into a fixed canvas. High-fidelity image inputs let you pass detailed source images for editing tasks while preserving the structure and detail of the original.

Integrate GPT Image 2 through generateImage from the AI SDK. Pricing on this page is per generated image, with rates varying by output size and quality settings; check the pricing panel for current values across the dimensions you plan to use.

What To Consider When Choosing a Provider

  • Configuration: GPT Image 2 is a generation-focused model, not a language model. It produces images from text and image inputs rather than text from text. Pricing is per generated image and depends on output dimensions and quality.
  • Configuration: Call GPT Image 2 with generateImage from the AI SDK. Reference the live pricing panel on this page for the current per-image cost across sizes and quality settings.
  • Zero Data Retention: AI Gateway does not currently support Zero Data Retention for this model. See the documentation for models that support ZDR.
  • Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.

When to Use GPT Image 2

Best For

  • Fast image generation: Creating images from text prompts when speed matters alongside fidelity
  • High-fidelity image editing: Editing existing images while preserving detail from high-resolution inputs
  • Flexible-size outputs: Generating images at the dimensions an application actually needs without forced cropping
  • Product and marketing visuals: Promotional imagery, hero shots, and product compositions from detailed prompts
  • Creative tooling: Building generation and editing features into design and content applications

Consider Alternatives When

  • Cost-sensitive batch generation: Gpt-image-1-mini for high-volume pipelines where per-image cost dominates
  • Earlier-generation needs: Gpt-image-1 or gpt-image-1.5 if you already depend on their specific output characteristics
  • Image understanding: A GPT chat model with vision when you need to analyze images rather than generate them
  • Text tasks: Any GPT chat or reasoning model for non-image workloads like analysis, coding, or generation

Conclusion

GPT Image 2 brings OpenAI's latest image generation and editing capability to AI Gateway. For applications that need fast, high-quality generation with flexible sizing and high-fidelity edits, it is the current generation in the gpt-image lineup.

Frequently Asked Questions

  • What can GPT Image 2 generate?

    It creates and edits images from text and image inputs, supporting flexible output sizes and high-fidelity image inputs for editing workflows.

  • How do I call GPT Image 2 from my application?

    Use generateImage from the AI SDK. AI Gateway routes the request to GPT Image 2 and returns the generated image.

  • Can GPT Image 2 edit existing images?

    Yes. It accepts high-fidelity image inputs and produces edited outputs while preserving detail from the source image.

  • How is GPT Image 2 priced?

    Pricing is per generated image, with rates depending on output size and quality settings. Check the pricing panel on this page for current values across the dimensions you plan to use.

  • What output sizes does GPT Image 2 support?

    GPT Image 2 supports flexible image sizes. Request the dimensions that match the surface you're rendering into, rather than forcing the model into a fixed canvas.

  • Does GPT Image 2 support zero data retention through AI Gateway?

    Zero Data Retention is not currently available for this model. Zero Data Retention is offered on a per-provider basis. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.

  • How does AI Gateway handle authentication for GPT Image 2?

    AI Gateway accepts a single API key or OIDC token for all requests. You don't embed OpenAI credentials in your application; AI Gateway routes and authenticates on your behalf.

  • What are typical generation times?

    This page shows live performance metrics measured across real AI Gateway traffic.