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.'
});

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