SandBase is live — $1 in free credits on signupStart free ›

OpenAI modelsimage generation api

openai/gpt-image-2

GPT Image 2, OpenAI's latest image model, is capable of making fine-grained, detailed edits to images.

Input
The text prompt to generate an image from.
Quality for the generated image Allowed values: low, medium, high.
The resolution of the generated image. Leave unset to preserve the provider's standard dimensions. Allowed values: 1k, 2k, 4k.
The aspect ratio of the generated image. Allowed values: 1:1, 1:2, 2:1, 1:3, 3:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9.
The format of the generated image. Allowed values: jpeg, png, webp.
Idle

Example output — click Run to generate your own

API README

OpenAI GPT Image 2 Text-to-Image

OpenAI's most capable image generation model. Excels at complex scenes with accurate text rendering, strong prompt adherence, and photorealistic output across Latin and CJK scripts.

Highlights

Near-perfect text rendering — Generates readable text inside images including signage, UI labels, handwritten notes, and posters. Supports Chinese, Japanese, Korean, and Latin scripts with correct spelling and consistent spacing.

Extreme prompt adherence — Follows complex multi-part instructions faithfully. Composition, lighting, material properties, and fine-grained details described in long prompts are preserved without drift.

Neutral, accurate color — Eliminates the warm color cast present in earlier models. Colors render true-to-intent across all scene types, critical for brand assets and product photography.

Flexible resolution up to 4K — Supports preset sizes and custom dimensions. Both edges must be multiples of 16, max single edge 3840px, total pixels between 655K and 8.3M.

Pricing

QualityStandard SizeLarge (21:9 / 9:21)
Low$0.015$0.03
Medium$0.05$0.08
High$0.20$0.30

Standard covers most aspect ratios (1:1, 2:3, 3:2, 4:3, 16:9, etc). Large applies to ultra-wide/tall formats only.

When to Use

✅ Good fit❌ Consider alternatives
Text-heavy images (posters, ads, packaging)Simple icons or flat illustrations
Complex multi-object scenesReal-time / sub-second generation
Brand-accurate color requirementsIterative mask-based editing (use Edit model)
Multilingual text in imagesVideo or animation
Product mockups and concept artExtremely large batch jobs on budget

Prompt Guide

Structure your prompts for best results:

Scene: [environment, time of day, background]
Subject: [main focus, position, action]
Details: [materials, lighting, camera angle, mood]
Text: [exact text to render, font style, placement]
Constraints: [no watermark, specific aspect ratio, color palette]

Example:

A minimalist product photo of a ceramic coffee mug on a marble countertop, morning sunlight from the left, soft shadows. The mug has "Good Morning" written in a clean serif font. White background, 3:2 aspect ratio, no other objects.

Technical Specs

SpecValue
InputText prompt (max 32,000 characters)
OutputPNG, JPEG, or WebP
Resolution655,360 – 8,294,400 total pixels
Max edge3,840 px
Aspect ratioUp to 3:1
Edge constraintMultiples of 16
ExecutionAsync (submit → poll for result)

Related

Related Models

openai/gpt-image-2/editGPT Image 2 Editing supports image editing and multi-image synthesis with high-quality results.openai/gpt-image-1-miniGpt Image 1 Mini by OpenAI - generate stunning images from text prompts with state-of-the-art AI. Supports multiple aspect ratios, styles, and high-resolution output for creative and commercial use.openai/gpt-image-1-mini/editGpt Image 1 Mini Edit is OpenAI's intelligent image editing model. Transform, retouch, and reimagine existing images using text prompts - from background replacement to artistic style conversion.openai/gpt-image-1.5Gpt Image 1.5 is OpenAI's advanced text-to-image AI model. Create photorealistic images, illustrations, and concept art from natural language descriptions with exceptional detail and prompt adherence.openai/gpt-image-1.5/editGpt Image 1.5 Edit by OpenAI - AI-powered image editing, style transfer, and transformation. Edit photos with natural language instructions, remove backgrounds, change styles, and enhance images effortlessly.openai/gpt-image-1/editGpt Image 1 Edit by OpenAI - AI-powered image editing, style transfer, and transformation. Edit photos with natural language instructions, remove backgrounds, change styles, and enhance images effortlessly.openai/gpt-image-2.5-flareGPT Image 2.5 Flare is optimized for fast, high-quality image generation for everyday creative workflows.openai/gpt-image-2.5-flare/editGPT Image 2.5 Flare Edit is optimized for fast, high-quality image editing and multi-image composition.