LLM Reference
OpenAI API

Using GPT Image 2 on OpenAI API

Implementation guide · GPT Image · OpenAI

Serverless

OpenAI API exposes GPT Image 2 through model ID gpt-image-2. Use the setup steps, sourced pricing, capabilities, and official provider links below to validate this route before deployment.

Last refreshed 2026-05-10. Next refresh: weekly.

Quick Start

  1. 1
    Create an account at OpenAI API and generate an API key.
  2. 2
    Use the OpenAI API SDK or REST API to call gpt-image-2 — see the documentation for request format.
  3. 3
    You'll be billed $8.00/1M input, $30.00/1M output tokens. See full pricing.

Code Examples

Install
pip install openai
API key
OPENAI_API_KEY
Model ID
gpt-image-2

Use the model slug directly, e.g. "gpt-4o" or "gpt-4.1-mini".

import os
from openai import OpenAI

client = OpenAI()  # reads OPENAI_API_KEY from env
response = client.chat.completions.create(
    model="gpt-image-2",
    messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)

Pricing on OpenAI API

TypePrice (per 1M)
Input tokens$8.00
Output tokens$30.00
Image input$8.00

Capabilities

VisionMultimodalReasoning

About GPT Image 2

OpenAI's image generation model succeeding DALL-E 3, released April 21, 2026. Uses an autoregressive architecture with native reasoning — the model plans structure and composition before generating pixels. Supports up to 4K (4096×4096) resolution, achieves ~99% character-level text accuracy across Latin, CJK, Hindi, and Bengali scripts, and generates images ~2× faster than DALL-E 3. Debuted at #1 on the Image Arena leaderboard by a +242-point margin. Powered by the GPT-5.4 backbone. API: $8/M image input tokens, $2/M cached, $30/M image output tokens. ChatGPT GA April 22, 2026; API access May 2026.

Model Specs

Released2026-04-21
ArchitectureAutoregressive Image

Provider

OpenAI API
OpenAI API

OpenAI

San Francisco, California, United States