GPT Image 2 icon
Image by OpenAI

GPT Image 2 API

Generate and edit images with OpenAI's GPT Image 2 through one unified API. A single REST endpoint, async jobs, and webhooks, with no separate OpenAI account to wire up.

Integrate GPT Image 2 with a single API call — one key, one unified endpoint, and shared billing across every model on Apiframe.

model: "gpt-image-2"
GPT Image 2 multi-turn edit adding a winter coat and scarf to a portrait while keeping the face and background unchanged

What's special about GPT Image 2

OpenAI's latest flagship image model

It powers ChatGPT Images 2.0 and replaces both DALL-E 3 and the interim GPT Image 1.5, available in ChatGPT and via the API as gpt-image-2.

Reasoning built in

It is the first OpenAI image model with a "thinking" mode, so before generating it can plan the layout, search the web for references, and self-check its output.

Up to 8 images from one prompt

It can produce a coherent set of images in a single shot, keeping characters and objects consistent across all of them, which suits storyboards and brand campaigns.

State-of-the-art text rendering

It handles dense and multilingual text cleanly across multiple scripts, making it dependable for posters, packaging, menus, and UI labels.

Precise instruction following

OpenAI describes it as a step change in following detailed prompts and in placing and relating objects accurately within a scene.

Higher resolution and flexible editing

It supports up to 2K resolution via the API with a range of aspect ratios, plus multi-turn editing that preserves identity and context across changes.

Made with GPT Image 2

A few outputs generated through the GPT Image 2 API on Apiframe.

GPT Image 2 four-panel comic strip with readable dialogue about a cat who refuses to get off a keyboard

A four-panel comic strip with readable dialogue about a cat who refuses to get off a keyboard.

GPT Image 2 bilingual event poster with the headline in English and Japanese, a clean layout, and date and venue

A bilingual event poster with the headline in English and Japanese, clean layout, date and venue.

GPT Image 2 character sheet of the same mascot in eight consistent poses including waving, running, sitting, and jumping

A character sheet of the same mascot in eight poses, waving, running, sitting, jumping and more, consistent design.

GPT Image 2 infographic explaining the water cycle with labeled stages and small caption text

An infographic explaining the water cycle with labeled stages and small caption text.

GPT Image 2 landing page mockup for a fitness app with a hero header, three feature cards, and a sign-up button

A landing page mockup for a fitness app with a hero header, three feature cards, and a sign-up button.

GPT Image 2 portrait edited to add a winter coat and scarf while keeping the face and background unchanged

Edit this portrait to add a winter coat and scarf, keeping the face and background unchanged.

Overview

Endpoint
POST /v2/images/generate
Model ID
gpt-image-2
Params key
gptImage2Params
Modality
Image
Provider
OpenAI
Avg. completion
~15s

Capabilities

Aspect ratios1:1, 3:2, 2:3
Image inputSupported
Avg. time~15s

Quick start

Send a single POST /v2/images/generate request with your API key to generate with GPT Image 2. The call returns a jobId you can poll or receive via webhook.

curl -X POST https://api.apiframe.ai/v2/images/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
        "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
        "model": "gpt-image-2",
        "gptImage2Params": {
            "input_images": "https://example.com/input.jpg",
            "quality": "auto",
            "background": "auto",
            "number_of_images": 1
        }
    }'
import requests

response = requests.post(
    "https://api.apiframe.ai/v2/images/generate",
    headers={
        "X-API-Key": "afk_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
        "model": "gpt-image-2",
        "gptImage2Params": {
            "input_images": "https://example.com/input.jpg",
            "quality": "auto",
            "background": "auto",
            "number_of_images": 1
        }
    },
)
print(response.json())  # { "jobId": "...", "status": "QUEUED" }
const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
  method: "POST",
  headers: {
    "X-API-Key": "afk_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
    "model": "gpt-image-2",
    "gptImage2Params": {
      "input_images": "https://example.com/input.jpg",
      "quality": "auto",
      "background": "auto",
      "number_of_images": 1
    }
  }),
});
const { jobId } = await response.json();
console.log(jobId);

Response & job lifecycle

Generation is asynchronous. A successful submission returns 202 Accepted with a jobId. Poll GET /v2/jobs/{id} (or supply a webhook_url) until the status is COMPLETED; the result field then holds the output URL(s).

1. Submission response (202)

{
  "jobId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "status": "QUEUED"
}

2. Poll for the result

curl https://api.apiframe.ai/v2/jobs/JOB_ID \
  -H "X-API-Key: afk_your_api_key_here"
import requests, time

while True:
    job = requests.get(
        "https://api.apiframe.ai/v2/jobs/JOB_ID",
        headers={"X-API-Key": "afk_your_api_key_here"},
    ).json()
    if job["status"] in ("COMPLETED", "FAILED"):
        break
    time.sleep(2)
print(job["result"])
let job;
do {
  await new Promise((r) => setTimeout(r, 2000));
  job = await fetch("https://api.apiframe.ai/v2/jobs/JOB_ID", {
    headers: { "X-API-Key": "afk_your_api_key_here" },
  }).then((r) => r.json());
} while (job.status !== "COMPLETED" && job.status !== "FAILED");
console.log(job.result);

Input schema

Request parameters accepted by the GPT Image 2 endpoint. Model-specific options are nested under the params object shown below.

Parameter Type Required Default Allowed / range Description
prompt string required Text description of what to generate.
model string required "gpt-image-2" "gpt-image-2" The model identifier for this endpoint.
gptImage2Params.input_images string (URL) optional Reference image (URL)
gptImage2Params.quality string optional "auto" "auto", "low", "medium", "high" Quality
gptImage2Params.background string optional "auto" "auto", "opaque" Background
gptImage2Params.number_of_images number optional 1 min 1, max 10, step 1 Number of images
gptImage2Params.output_format string optional "webp" "webp", "png", "jpeg" Output format
gptImage2Params.moderation string optional "auto" "auto", "low" How strictly to filter content. Use "low" for less restrictive moderation.

Frequently Asked Questions

Common questions about the GPT Image 2 API.

What is GPT Image 2?

OpenAI's newest image generation and editing model, released in April 2026 as the engine behind ChatGPT Images 2.0, replacing DALL-E 3 and GPT Image 1.5.

What is "thinking" mode?

A reasoning step where the model plans the layout, can search the web for references, and reviews its own output before finishing, and it enables generating up to eight images from one prompt.

How is it different from GPT Image 1.5?

It is the newer model, adding built-in reasoning, stronger multilingual text, consistent multi-image sets, and higher overall quality.

Can it render text in multiple languages?

Yes. Multilingual text rendering across several scripts is one of its standout strengths.

Is it free?

Standard mode is available to ChatGPT users at no extra cost, while the thinking features are reserved for paid tiers, and API access is paid on a token basis.

Where can you access it?

Through Apiframe, as well as ChatGPT and the OpenAI API.

Still have questions?

Start building with the GPT Image 2 API

Get your API key and integrate GPT Image 2 in minutes — Pay-as-you-go.

Free credits to start
One API for every model
Webhooks, SDKs & idempotency
No provider account required

Questions? Join our Discord or contact sales.