GPT Image 2

openai/gpt-image-2

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

Base price
$0.20USD / run
Execution
async
Model type
image
Input fields
5

Try the model

Playground

Open playground
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.
OutputReady

Your output will appear here

Complete the inputs, then click Run.

Specifications

Pricing

Base price
$0.20 / run
Billing formula
(params.aspect_ratio == "21:9" || params.aspect_ratio == "9:21") ? ((params.quality ?? "high") == "low" ? 0.03 : ((params.quality ?? "high") == "medium" ? 0.08 : 0.30)) : ((params.quality ?? "high") == "low" ? 0.015 : ((params.quality ?? "high") == "medium" ? 0.05 : 0.20))

Context & modalities

Input
Schema-defined
Output
image

Capabilities

Chat
Not supported
Vision
Not supported
Reasoning
Not supported
Structured output
Not supported
Function calling
Not supported
Audio input
Not supported

Access

Provider
OpenAI
Model ID
openai/gpt-image-2
Execution
async
API
Unified Run API
Endpoint
/v1/run

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

Start building

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

Production API
Unified Run API endpoint
https://api.sandbase.ai/v1/run
Model ID
openai/gpt-image-2
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
  -X POST "https://api.sandbase.ai/v1/run" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'SANDBASE_JSON'
{
  "model": "openai/gpt-image-2",
  "prompt": "Generate an image of gray tabby cat hugging an otter with an orange scarf",
  "quality": "high",
  "aspect_ratio": "1:1",
  "output_format": "png"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
  status=$(printf '%s' "$result" | jq -r .status)
  case "$status" in completed|failed|timeout) break ;; esac
  sleep 2
  result=$(curl --fail-with-body --silent \
    -H "Authorization: Bearer $SANDBASE_API_KEY" \
    "https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"

Choose your model

Compare models

All language models
ModelContextInput / 1MOutput / 1MReleased
GPT Image 2This model
OpenAI
———Apr 21, 2026
OpenAI———Aug 20, 2026
OpenAI———Aug 20, 2026
OpenAI———Aug 20, 2026
OpenAI———Aug 20, 2026
OpenAI———Apr 21, 2026