GPT-5.4 Image 2 overview
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
| Usage | Price | Unit |
|---|---|---|
| Input | $8.46 | 1M tokens |
| Output | $15.87 | 1M tokens |
| Cached input | $2.12 | 1M 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.
| Model | Input | Output |
|---|---|---|
| $8.46 | $15.87 | |
| $0.1 | $0.5 | |
| $1 | $5 | |
| $2 | $10 | |
| $2.12 | $10.58 |
How to use the GPT-5.4 Image 2 API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport 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."
}
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "openai/gpt-5.4-image-2",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}
response = requests.post("https://api.aimlapi.com/v1/chat/completions", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = 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": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Related articles
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.

