Back to models
Cyan glass perfume bottle in a violet-lit studio
OpenAI · Image

GPT Image 2

High-fidelity image creation and editing through natural language.

EditingTextFidelity
openai/gpt-image-2/text-to-image
Starting at$0.08 / imageSaved models stay in this browser.
Try it now

Playground

$0.08 / image
GPT Image 2Image  •  Text to image
97 / 1000
Reference imageOptional
Aspect ratio
Estimated cost ~0.080 credits$0.0800 USD
Your result will appear hereConfigure a model, then generate it.
Current API contract

Use an organization API key.

Create a key in the studio, then send it as a Bearer token. API usage and credits remain scoped to that key’s organization.

Keys are shown once and API requests are rate limited per key.
const response = await fetch("/api/predictions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer omk_your_api_key",
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID()
  },
  body: JSON.stringify({
    model: "openai/gpt-image-2/text-to-image",
    input: {
        "prompt": "Surreal floating architecture above a calm reflective sea, soft dusk light, cinematic composition",
        "aspect_ratio": "1:1"
    }
  })
});

const { data, error } = await response.json();
Submit
POST /api/predictions with an 8–200 character Idempotency-Key.
Poll
GET /api/predictions/{id} until the returned status is terminal.
Response
Success returns { data: prediction }; failures return { error: message }.
Model overview

Text to image

High-fidelity image creation and editing through natural language.

EditingTextFidelity
Keep exploring

Related models