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.
import { experimental_generateImage as generateImage } from 'ai';
const result = await generateImage({ model: 'openai/gpt-image-2', prompt: 'A red balloon on a wooden table.'});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.