APIrove

Home / Models / GPT / GPT Image 2

MODEL · GPT · IMAGE

GPT Image 2 API

Sign in to get a trial allowance

Send your first request

Replace YOUR_API_KEY with your API key.

curl https://apirove.com/v1/images/generations \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"model": "gpt-image-2", "prompt": "Describe a paper boat on a lake.", "size": "1024x1024", "n": 1}'
python -m pip install openai
from openai import OpenAI

client = OpenAI(base_url="https://apirove.com/v1", api_key="YOUR_API_KEY")
print(client.images.generate(
    model="gpt-image-2",
    prompt="Describe a paper boat on a lake.",
    size="1024x1024",
    n=1,
))
Node.js · .mjs
const response = await fetch("https://apirove.com/v1/images/generations", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({"model": "gpt-image-2", "prompt": "Describe a paper boat on a lake.", "size": "1024x1024", "n": 1})
});
console.log(response.status, await response.json());

On sale

An explicit image model for a reproducible generation workflow

GPT Image 2 generates images from text through the Images API. Set gpt-image-2 explicitly to keep this model in an existing workflow; omitting model selects a different default.

Model IDgpt-image-2

Verified in production on 2026-11-12 (Beijing time)

Endpoints

  • Base URL: https://apirove.com/v1
  • POST /v1/images/generations
  • Auth: Authorization: Bearer YOUR_API_KEY

Public price

Billing itemUSD rateUnit
1K$0.08image
2K$0.10image
4K$0.15image

Public USD retail rates. The server renders the public price list of 2026-11-24; the page refreshes them on load. Actual charges are on the Usage page.

This model has no directly comparable official rate for the listed items.

Highlights

  • Use POST /v1/images/generations rather than a chat endpoint
  • Start with one 1024x1024 image to inspect the returned result
  • Specify the model ID to preserve an existing workflow
  • Compare actual outputs against the 2.5 and 2.6 variants
Two pale discs overlapping the sides of a square on a jade green gradient, with a disc at upper right

Use cases

  • Maintaining scripts that already select GPT Image 2
  • Turning a product scene or illustration brief into a visual draft
  • Building a fixed-prompt comparison set for sibling image models

How to call it

Send an Images API request with an explicit model. Start with one square image and inspect the response.

bash
APIROVE_API_KEY='YOUR_API_KEY'

curl https://apirove.com/v1/images/generations \
  -H "Authorization: Bearer $APIROVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-image-2", "prompt": "A red ceramic cup on a pale desk, soft daylight, uncluttered composition", "size": "1024x1024", "n": 1}'

FAQ

Does omitting model still select GPT Image 2?

No. Image requests without model currently default to gpt-image-2.6-flare. Set gpt-image-2 explicitly to select this model.

Can I generate images through a chat endpoint?

This page uses POST /v1/images/generations. Do not submit this image model ID as a chat model. The example base URL is https://apirove.com/v1.

How should I choose 1K, 2K or 4K?

Check the current public size tiers and API documentation first. 4K requires enabled image permissions and a published price for that tier. A listed tier name alone does not establish access for your key; do not guess model suffixes.

How do I read the generated image?

Check the HTTP status and JSON response first. The existing GPT Image 2 example reads base64 image data from data[0].b64_json. Validate that the field exists and handle the returned format; do not save the whole JSON as an image.

What should I check if the model is unavailable?

Check the full model ID, image endpoint and image permissions on the console Keys page. For a rejected size, check the published tiers. Keep a sanitized error for support and never include an API key in logs.

Should I immediately resubmit a slow request?

Avoid repeated submissions while the original request may still be running. Allow a reasonable timeout, check whether it completed, then decide whether to retry to avoid duplicate work or charges.

Where can I check pricing and usage?

See the current public price table for rates and tiers, and the console Usage page for actual requests. Keep prompt, image count and dimensions fixed when comparing models; do not infer prices from variant names.

Compare same-generation variants and adjacent versions with a fixed prompt and dimensions, considering actual results and current public prices.

Get an API key See pricing