GPT-5.4 Image 2 API

GPT-5.4 Image 2 on AIMLAPI.

Modalities
Image, TextText
In / Out price
$8.46/$15.87per 1M
Context window
272K tokens
Released
Apr 21, 2026

GPT-5.4 Image 2 overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by GPT-5.4 Image 2 through AI/ML API

GPT-5.4 Image 2 specs

Model ID
openai/gpt-5.4-image-2
Developer
OpenAI
Context window
272,000 tokens
Max output
128,000 tokens
Input
Image, Text
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

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.

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.

Capabilities

  • Function calling
  • Reasoning
  • Streaming
  • Structured outputs
  • Web search

GPT-5.4 Image 2 API pricing

GPT-5.4 Image 2 pricing in US dollars
UsagePriceUnit
Input$8.461M tokens
Output$15.871M tokens
Cached input$2.121M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

GPT-5.4 Image 2 vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
GPT-5.4 Image 2$8.46$15.87
GPT-6 Luna$0.1$0.5
GPT-6.1 Terra$1$5
GPT-6.1 Sol$2$10
GPT-6.1 Terra Pro$2.12$10.58

How to use the GPT-5.4 Image 2 API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl '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": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

GPT-5.4 Image 2 FAQ

What is the context window of GPT-5.4 Image 2?

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

What inputs and outputs does GPT-5.4 Image 2 support?

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

What is the model ID for GPT-5.4 Image 2?

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

How much does GPT-5.4 Image 2 cost?

GPT-5.4 Image 2 costs $8.46 input and $15.87 output per 1M tokens on AI/ML API, billed as you go with no subscription.

Does GPT-5.4 Image 2 support streaming?

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

Can GPT-5.4 Image 2 read images?

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

Who created GPT-5.4 Image 2?

GPT-5.4 Image 2 was built by OpenAI.

Start building with GPT-5.4 Image 2

GPT-5.4 Image 2 API

openai/gpt-5.4-image-2

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl '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": "Write a haiku about the ocean."
    }
  ]
}'