GPT-5.4 Image 2 API

openai/gpt-5.4-image-2
GPT-5.4 Image 2 on AIMLAPI.
Context
272K tokens
Input
$8.464 / 1M tokens
Output
$15.87 / 1M tokens
Released
Apr 21, 2026

Overview

What is GPT-5.4 Image 2 API?

GPT-5.4 Image 2 is available through AIMLAPI.

Technical Specifications
- Supported inputs: Image, Text
- Output: Text
- Context window: 272,000 tokens / Max output: 128,000 tokens
- Endpoint: /chat/completions

Performance Benchmarks
[embed]

GPT-5.4 Image 2 API Pricing
- Input: $10.4 / 1M tokens
- Output: $19.5 / 1M tokens

Where to Use GPT-5.4 Image 2

Coding and code review
Generate, debug, and review code across languages, reading whole files or repos in a single prompt.

Agentic and multi-step workflows
Reliable tool-calling and instruction-following suit agent loops that plan, call tools, and iterate.

Complex reasoning
Extended reasoning improves reliability on multi-step math, logic, and technical analysis.

Long-document analysis
Summarize and extract from contracts, papers, and reports without aggressive chunking.

Code Sample
[embed]

Uptime and performance

  • Uptime (7d): 33.0%

Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.

Use cases

GPT-5.4 Image 2 is documented as suited to rich multimodal workflows that move between reasoning, coding, and visual generation in one interaction. It is also suited to image editing with reference images, since it accepts up to 16 reference images in one request. It is described as accepting images, text, and files such as PDFs as input while returning images and text, which makes it suitable for workflows that combine document and visual inputs. It is also positioned for image-only workloads when paired with the provider’s dedicated image API.

How to use GPT-5.4 Image 2 API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to openai/gpt-5.4-image-2.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "openai/gpt-5.4-image-2",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "openai/gpt-5.4-image-2",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/chat/completions \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-5.4-image-2","messages":[{"role":"user","content":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

GPT-5.4 Image 2 API Pricing

TypePrice
Input
$8.464 / 1M tokens
Output
$15.87 / 1M tokens
Cached input
$2.116 / 1M tokens

GPT-5.4 Image 2 vs other models

ModelInputOutputContextBest for
$8.464 / 1M tokens
$15.87 / 1M tokens
272K tokens
Reasoning + agents
$5 / 1M tokens
$30 / 1M tokens
1M tokens
Reasoning + agents
$2 / 1M tokens
$10 / 1M tokens
1M tokens
Balanced coding + agents
$3 / 1M tokens
$15 / 1M tokens
1M tokens
Long-context, multimodal & agentic workflows
$1.5 / 1M tokens
$9 / 1M tokens
1M tokens
Reasoning + agents

Frequently asked questions

GPT-5.4 Image 2 has a 272,000 tokens context window and can return up to 128,000 tokens.

GPT-5.4 Image 2 takes image, text as input and returns text.

Use openai/gpt-5.4-image-2 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

GPT-5.4 Image 2 is priced at input $11.0032 / 1M tokens, output $20.631 / 1M tokens, cached input $2.7508 / 1M tokens.

Yes, GPT-5.4 Image 2 can stream responses as they are generated.

Yes, GPT-5.4 Image 2 accepts image input alongside text.

GPT-5.4 Image 2 was built by OpenAI.

Start building with GPT-5.4 Image 2

Get API Key
1000+ models, one API.