#tHow Many Tokens?

← All models

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

When not to use it:

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