GPT-5.4: token counter & pricing
OpenAI · exact (uses official tokenizer) · pricing as of 2026-05-31.
- Provider
- OpenAI
- API model ID
gpt-5.4- Context window
- 400,000 tokens
- Input price
- $2.50 per 1M tokens
- Output price
- $15.00 per 1M tokens
- Tokenizer accuracy
- exact (uses official tokenizer)
- Pricing as of
- 2026-05-31
Open the counter to count tokens for GPT-5.4 in real time.
What is GPT-5.4?
GPT-5.4 is the second-most-recent flagship in OpenAI's GPT-5 line (released alongside GPT-5.5). Same o200k_base tokenizer, same 400K context, $2.50 input / $15 output per 1M tokens, half the price of GPT-5.5 on input.
For most production workloads, GPT-5.4 is the sane default: most of GPT-5.5's quality at half the cost.
How tokens are counted here
OpenAI's o200k_base tokenizer. Browser-side via js-tiktoken. Exact.
Pricing notes
$2.50 input / $15 output per 1M (short context). Cached input $0.25/M.
Long-context tier kicks in above 128K input tokens: $5 input / $22.50 output per 1M. This calculator shows the short-context rate. If you're routinely sending prompts above 128K, your effective cost is closer to GPT-5.5's short-tier rate.
Regional processing (data residency) endpoints are charged a 10% uplift.
When to use GPT-5.4
- Default flagship for most production AI workloads, better than the GPT-5.x predecessors, cheaper than 5.5.
- Cost-sensitive coding and reasoning agents where you want flagship quality.
- Long context up to 128K, under the long-context surcharge threshold.
When not to use it:
- Frontier reasoning where you've measured 5.5 winning meaningfully, pay the upgrade.
- High-volume cheap workloads. GPT-5.4 Mini ($0.75/$4.50) or GPT-5.4 Nano ($0.20/$1.25) cover those.
- Prompts routinely exceeding 128K, the tier-2 price equalizes you with 5.5, so 5.5 becomes the better deal.
Common questions
How does GPT-5.4 compare to Claude Sonnet 4.6?
GPT-5.4: $2.50/$15. Claude Sonnet 4.6: $3/$15. GPT-5.4 is 17% cheaper on input, tied on output. Claude often wins on instruction-following nuance; GPT-5.4 often wins on tool use and structured outputs. Run your own evals on your own prompts.
Is GPT-5.4 worth the upgrade from GPT-5.2?
GPT-5.4 ($2.50/$15) costs 43% more on input than 5.2 ($1.75/$14). The upgrade pays off if you've measured a quality win on a workload that fails on 5.2, otherwise stay on 5.2.
What's GPT-5.4 Pro?
$30/$180 per 1M, 12× the base 5.4 input. Use only for measured-difficult tasks where the per-call cost is justified by what a wrong answer costs.
Compare GPT-5.4 to other models
- GPT-5.5 (OpenAI, $5.00/$30.00)
- GPT-5.5 Pro (OpenAI, $30.00/$180.00)
- GPT-5.4 Mini (OpenAI, $0.75/$4.50)
- GPT-5.4 Nano (OpenAI, $0.20/$1.25)
- GPT-5.4 Pro (OpenAI, $30.00/$180.00)
- GPT-5.3 (OpenAI, $1.75/$14.00)
- GPT-5.2 (OpenAI, $1.75/$14.00)
- GPT-5.2 Pro (OpenAI, $21.00/$168.00)
- GPT-5.1 (OpenAI, $1.25/$10.00)
- GPT-5 (OpenAI, $1.25/$10.00)
- GPT-5 Mini (OpenAI, $0.25/$2.00)
- GPT-5 Nano (OpenAI, $0.05/$0.40)
- GPT-5 Pro (OpenAI, $15.00/$120.00)
- GPT-4.1 (OpenAI, $2.00/$8.00)
- GPT-4.1 Mini (OpenAI, $0.40/$1.60)
- GPT-4.1 Nano (OpenAI, $0.10/$0.40)
- o3 (OpenAI, $2.00/$8.00)
- o3-mini (OpenAI, $1.10/$4.40)
- o3-pro (OpenAI, $20.00/$80.00)
- o4-mini (OpenAI, $1.10/$4.40)
- GPT-4o (OpenAI, $2.50/$10.00)
- GPT-4o mini (OpenAI, $0.15/$0.60)
- GPT-4 Turbo (OpenAI, $10.00/$30.00)
- Claude Sonnet 4.6 (Anthropic, $3.00/$15.00)
- Gemini 3.1 Pro (Google, $2.00/$12.00)
- Mistral Large (Mistral, $2.00/$6.00)