OpenAI
GPT-5.4
OpenAI's 2026 flagship model with 400K context and cached-input pricing for reasoning, coding, and multimodal tasks
Context Length1M tokens
Model TypeLarge Language Model (LLM)
MultimodalSupports text and image input, text output
Pricing & Specs
π° Pricing
Input$2.5 / M tokens
Output$15 / M tokens
Cache Hit$0.25 / M tokens
βοΈ Specs
Context Length1M tokens
Model TypeLarge Language Model (LLM)
MultimodalSupports text and image input, text output
Caching SupportSupports cached-input pricing
Snapshotgpt-5.4-2026-02-20
Knowledge CutoffJune 2024
API Examples
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="your-api-key",
base_url="https://api.xairouter.com/v1"
)
response = client.chat.completions.create(
model="gpt-5.4",
messages=[
{"role": "user", "content": "Summarize this requirement and break it into development tasks"}
]
)
print(response.choices[0].message.content)cURL (OpenAI API)
curl https://api.xairouter.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-5.4",
"messages": [
{"role": "user", "content": "Summarize this requirement and break it into development tasks"}
]
}'Developer Assist
# Configure ~/.codex/config.toml
cat > ~/.codex/config.toml << 'EOF'
model_provider = "xai"
model = "gpt-5.4"
model_reasoning_effort = "xhigh"
plan_mode_reasoning_effort = "xhigh"
model_reasoning_summary = "none"
model_verbosity = "medium"
model_context_window = 1050000
model_auto_compact_token_limit = 945000
tool_output_token_limit = 6000
approval_policy = "never"
sandbox_mode = "danger-full-access"
suppress_unstable_features_warning = true
[model_providers.xai]
name = "OpenAI"
base_url = "https://api.xairouter.com"
wire_api = "responses"
requires_openai_auth = false
env_key = "XAI_API_KEY"
[features]
multi_agent = true
[agents]
max_threads = 4
max_depth = 1
job_max_runtime_seconds = 1800
EOF
# Set environment variable (add to ~/.bashrc or ~/.zshrc)
export XAI_API_KEY="sk-Xvs..."
# Launch Codex
codex