Cost per request
This is an estimate, not an exact count
Every model family has its own tokenizer, so the same text is a different number of tokens on different models. This page uses OpenAI's published rule of thumb for English: 1 token ≈ 4 characters ≈ ¾ of a word, so 100 tokens is about 75 words. Code, numbers, and languages other than English usually take more tokens per character.
For Claude, Anthropic says Claude 4.7 and later models use a newer tokenizer that produces about 30% more tokens for the same text than earlier Claude models. If you are moving from an older Claude model, recount rather than reusing old numbers.
Exact counts
- Claude: the
/v1/messages/count_tokensendpoint counts a request for the model you name. Anthropic's docs say it is free to use (with its own rate limits) and the result is itself an estimate that can differ slightly from billed usage. - OpenAI: the Tokenizer page, or the
tiktokenlibrary withtiktoken.encoding_for_model(model). - After the fact: every API response reports the real input and output tokens in its
usagefield. That is what you are billed for.
Which tokenizer does each model use?
- OpenAI:
tiktokenmaps GPT-4o, GPT-4.1, GPT-5, o1, o3 and o4-mini too200k_base, and GPT-4 and GPT-3.5 Turbo tocl100k_base. - Claude: Anthropic's token counting "counts under the tokenizer of the
modelyou pass", so count against the exact model you will call.
What the cost calculator leaves out
- Prompt caching: cached input is much cheaper (see the Claude and OpenAI price tables).
- Batch processing: Anthropic's Batch API is 50% off input and output; OpenAI lists separate, lower Batch prices.
- Thinking / reasoning tokens: billed as output tokens, and they don't appear in the visible answer, so real output is often larger than the reply you see.
- Tools: web search and other tool calls cost extra; tool definitions add input tokens.
Prices checked on 29 Nov 2026 on the official pages: Claude API docs: Pricing · OpenAI API docs: Pricing. Prices change; the official page always wins. All prices in US dollars, before tax.
Related: Claude Code pricing · Claude API pricing · OpenAI API pricing · token counter + cost calculator · Ollama models · is Claude down? · is ChatGPT down?
Sources
- OpenAI Help Center: What are tokens and how to count them?: help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them
- Claude API docs: Token counting: platform.claude.com/docs/en/build-with-claude/token-counting
- tiktoken: model to encoding map: github.com/openai/tiktoken/blob/main/tiktoken/model.py
- Claude API docs: Pricing: platform.claude.com/docs/en/about-claude/pricing
- OpenAI API docs: Pricing: developers.openai.com/api/docs/pricing