OpenAI logo
OpenAI

GPT-5.4 Nano

The lightest member of OpenAI's GPT-5.4 family — ultra-low cost and fast responses for classification, extraction, and sub-agent workloads

Category Text Model ID gpt-5.4-nano
Context Length400K tokens
Model TypeLightweight Large Language Model
MultimodalSupports text and image input, text output

Pricing & Specs

💰 Pricing

Input$0.2 / M tokens
Output$1.25 / M tokens
Cache Hit$0.02 / M tokens

⚙️ Specs

Context Length400K tokens
Model TypeLightweight Large Language Model
MultimodalSupports text and image input, text output
Max Output128K tokens
Release DateMarch 17, 2026
Training Cutoff DateAugust 2025
AvailabilityAPI, Codex

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-nano",
    messages=[
        {"role": "user", "content": "Summarize this requirement and break it into dev 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-nano",
    "messages": [
      {"role": "user", "content": "Summarize this requirement and break it into dev tasks"}
    ]
  }'

Developer Assist

# Configure ~/.codex/config.toml
cat > ~/.codex/config.toml << 'EOF'
model_provider = "xai"
model = "gpt-5.4-nano"
model_reasoning_effort = "xhigh"
plan_mode_reasoning_effort = "xhigh"
model_reasoning_summary = "detailed"
model_verbosity = "high"
approval_policy = "never"
sandbox_mode = "danger-full-access"

[model_providers.xai]
name = "xai"
base_url = "https://api.xairouter.com"
wire_api = "responses"
requires_openai_auth = false
env_key = "XAI_API_KEY"
EOF

# Set environment variable (add to ~/.bashrc or ~/.zshrc)
export XAI_API_KEY="sk-Xvs..."

# Launch Codex
codex