GPT-4.1: token counter & pricing
OpenAI · exact (uses official tokenizer) · pricing as of 2026-05-31.
- Provider
- OpenAI
- API model ID
gpt-4.1- Context window
- 1,000,000 tokens
- Input price
- $2.00 per 1M tokens
- Output price
- $8.00 per 1M tokens
- Tokenizer accuracy
- exact (uses official tokenizer)
- Pricing as of
- 2026-05-31
Open the counter to count tokens for GPT-4.1 in real time.
What is GPT-4.1?
GPT-4.1 is OpenAI's last GPT-4 generation flagship, the long-context member of the GPT-4 family with a 1,000,000-token context window (vs the GPT-5 family's 400K). Still callable via the API as of mid-2026, despite being retired from the ChatGPT interface on February 13, 2026.
$2 input / $8 output per 1M tokens, cheaper than current GPT-5.4 ($2.50/$15) and competitive with GPT-5.2 ($1.75/$14) while offering 2.5× more context.
How tokens are counted here
OpenAI's o200k_base tokenizer (same as the GPT-5 family). Browser-side via js-tiktoken. Exact.
Pricing notes
$2 input / $8 output per 1M. Cached input $0.50/M.
Single-tier pricing across the full 1M window, no long-context surcharge above 128K the way GPT-5.4 / GPT-5.5 charge. That makes GPT-4.1 the cost-rational choice for genuinely long-context workloads.
For 1,000 input + 200 output: $0.0036 per call, $3,600 per 1M calls.
When to use GPT-4.1
- Workloads requiring >400K context, entire codebases, long-document Q&A, multi-document synthesis.
- Production workloads pinned to GPT-4.1's behavior profile that need API stability post-ChatGPT-retirement.
- Cost-predictable long-context use, no tier jumps, fixed-rate budget math.
When not to use it:
- New short-context work. GPT-5.4 or 5.5 are better-tuned.
- Anywhere Gemini 2.5 Pro's 2M context is needed (GPT-4.1 caps at 1M).
Common questions
Why is GPT-4.1 still on the API after being retired from ChatGPT?
ChatGPT retirement (Feb 2026) was about UI defaults, moving the chat product to GPT-5.2 as the default. API consumers are different audience (developers with stable production pipelines) and OpenAI keeps deprecated models on the API for 12-24 months past UI retirement. No deprecation date published for GPT-4.1 as of April 2026.
GPT-4.1 vs Gemini 2.5 Pro for long context?
Gemini 2.5 Pro: $1.25/$10 ≤200k, $2.50/$15 above. GPT-4.1: $2/$8 flat across 1M. For prompts in 200K-1M range, GPT-4.1 is often cheaper (cached input savings further widen the gap). For >1M context, Gemini is the only option in this counter.
Should I migrate from GPT-4.1 to GPT-5?
For short-context workloads (<128K) yes. GPT-5.4 / 5.5 are better-tuned and not much more expensive. For long-context (>200K) workloads, GPT-4.1 is often still the right choice on cost.
Compare GPT-4.1 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 (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 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 3.1 Pro (Google, $2.00/$12.00)
- Mistral Large (Mistral, $2.00/$6.00)
- Qwen3 Coder 480B (Alibaba, $2.00/$2.00)