GPT-5: token counter & pricing
OpenAI · exact (uses official tokenizer) · pricing as of 2026-05-31.
- Provider
- OpenAI
- API model ID
gpt-5- Context window
- 400,000 tokens
- Input price
- $1.25 per 1M tokens
- Output price
- $10.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 in real time.
What is GPT-5?
GPT-5 is the original model in OpenAI's GPT-5 line, launched in 2026 as the successor to the GPT-4 family. Mid-tier capability, 400K context window, priced as a workhorse for production AI.
GPT-5 has since been joined by GPT-5.1, 5.2, 5.3, 5.4, and 5.5, incremental improvements over the same base. For new work, default to GPT-5.5 (current flagship) or GPT-5.4 (cheaper). GPT-5 itself is still in the API for stability and as a budget-aware alternative.
How tokens are counted here
GPT-5 runs on OpenAI's o200k_base tokenizer, the same vocabulary used by every GPT-5.x variant and by GPT-4o. This page loads js-tiktoken and runs the real encoding in your browser: your text never leaves your device, and the count is exact, not a character-ratio estimate. One practical upshot for GPT-5 specifically: because the whole 5.x family shares this tokenizer, a count you take here applies unchanged to GPT-5.4 or GPT-5.5, so comparing upgrade costs is pure rate arithmetic, no re-measuring required.
Pricing notes
$1.25 input / $10 output per 1M tokens. Cached input $0.125/M (10% standard).
This is the single-tier price, no long-context surcharge above 128K. That makes GPT-5 attractive for workloads that frequently hit higher context lengths than GPT-5.4 / GPT-5.5 (which charge ~2× above 128K input).
When to use GPT-5
- Stable production workloads that were tuned on GPT-5 and don't need the GPT-5.4/5.5 quality bump.
- Predictable cost on long-context inputs, no tier jump above 128K.
- Agent / orchestrator pipelines where you want a known-good baseline behavior.
When not to use it:
- New work. GPT-5.5 is current.
- Cost-sensitive. GPT-5 Mini ($0.25/$2) is 5× cheaper on input.
What GPT-5 costs in production
Take a realistic agent pipeline: each run sends an average of 20,000 input tokens (system prompt, tool definitions, accumulated context across steps) and generates 2,000 output tokens of tool calls and final answers. At 50,000 runs per month, that is 1 billion input tokens and 100 million output tokens.
- Input: 1,000M tokens at $1.25/M = $1,250
- Output: 100M tokens at $10.00/M = $1,000
- Monthly total: $2,250
The same token volume on GPT-5 Mini ($0.25 input / $2.00 output) costs $250 + $200 = $450 per month, an 80% cut if the smaller model clears your eval bar. Going up instead, Claude Opus 4.8 ($5.00 / $25.00) runs $5,000 + $2,500 = $7,500 per month for identical traffic. GPT-5 sits in the useful middle: real multi-step capability at well under a third of Opus rates.
Migrating from GPT-4o
The move is mostly painless. Swap the apiId from gpt-4o-2024-08-06 to gpt-5, and your token budgets carry over unchanged: both models use o200k_base, so existing prompt measurements stay valid. Three things do change. Context grows from 128K to 400K, so prompts you were truncating can run whole. Input price drops from $2.50 to $1.25 per 1M tokens, while output holds at $10.00. And GPT-5 chains tool calls more willingly than GPT-4o did, so agent loops that needed prodding may need fewer retries, but your max-iteration guards deserve a fresh look before you ship.
GPT-5 vs the obvious alternative
The closest cross-provider match is Claude Sonnet 4.6 at $3.00 / $15.00 per 1M tokens, which makes GPT-5 ($1.25 / $10.00) the cheaper pick on both input and output. If you are deciding at the frontier tier instead, the head-to-head pages cover it: GPT-5 vs Claude Opus for Anthropic's $5.00 / $25.00 flagship, and GPT-5 vs Gemini 3.1 Pro for Google's $2.00 / $12.00 preview tier.
Common questions
Is GPT-5 the same as GPT-5.5?
No. GPT-5 is the original release; GPT-5.5 is the latest revision (April 2026). They share the same tokenizer and broadly similar capability tier, but GPT-5.5 has measurably better coding, tool use, and reasoning behavior.
What's the cheapest GPT-5 variant?
GPT-5 Nano at $0.05 input / $0.40 output per 1M tokens, currently the cheapest input rate of any exact-tokenizer model in this counter.
Does GPT-5 use the same tokenizer as GPT-4o?
Yes, both use o200k_base. Token counts match for the same input text across both models; only per-token price differs. (Older GPT-4 Turbo and GPT-3.5 use the predecessor cl100k_base and produce ~5-10% more tokens for the same text.)
Compare GPT-5 to other models
- GPT-5.5 (OpenAI, $5.00/$30.00)
- GPT-5.5 Pro (OpenAI, $30.00/$180.00)
- GPT-5.4 (OpenAI, $2.50/$15.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 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)
- Gemini 2.5 Pro (Google, $1.25/$10.00)
- GLM-5.1 (zhipu, $1.40/$4.40)
- Claude Haiku 4.5 (Anthropic, $1.00/$5.00)