How AI tokens affect your costs and answer length
A practical explanation of input, output and context limits, with a worked API cost example and a checklist for avoiding misleading estimates.
In this article
Paste a long document into an AI tool and two questions follow: will it fit, and what will the answer cost? Tokens help answer both. They are the units a model processes, but they are not the same as words. A token-based API bill can depend on how much you send and how much the model generates.
This guide separates those counts from the model's context window and output limit. It also shows how to estimate a bill without confusing an imagined price with an actual one. If you use a consumer chat subscription instead of an application programming interface (API), check its own terms: the API arithmetic below does not establish your subscription charge.
What a token counts
According to OpenAI's token guide, a token may represent a character, part of a word, a whole word or punctuation. Spaces and capitalisation can change how text is divided. Tokenisation is the process of making those units; a tokeniser is the tool that performs it. The same text can produce different counts with different models, encodings or languages.
OpenAI offers a rough English estimate: 100 tokens correspond to about 75 words. That makes 1,000 tokens roughly 750 English words, but this is a planning approximation, not a conversion rule. A different language, code or unusual spelling can produce a different ratio. OpenAI's tiktoken repository explains that its byte-pair encoding often represents common word parts as units, without promising a fixed split for every word.
Input, output and the space between them
Input tokens are supplied in a request; output tokens are generated by the model. OpenAI notes that a complete API request can also include message structure, tool definitions, schemas, images or files, so counting only the pasted text may miss part of the input. Some reasoning models use internal reasoning tokens that are not displayed as answer text; OpenAI says those count towards output usage for its models.
A context window is the amount of tokenised material a model can work with in a request. The maximum output is a separate limit on generated tokens. According to OpenAI, both limits vary by model, and reasoning models need room for reasoning as well as visible text. A large context window therefore does not guarantee an equally long visible answer. Ask for the format you need, then check the model's actual limits.
| Term | What to check | Why it matters |
|---|---|---|
| Input | The full request, not only the document | Instructions and request structure can add tokens. |
| Context window | The selected model's limit | An oversized request may need to be shortened or split. |
| Output | The model's cap and reported usage | Visible text may not account for all generated tokens. |
| Price | The applicable rate for each usage category | Input and output rates can differ. |
For a long source, remove duplicated material or divide it into smaller pieces before asking for a synthesis. Keep the question and the passages needed to answer it together. The more guides section has other practical explanations, and tutorials covers task-oriented workflows.
A worked API cost example
Imagine an API request reports 2,000 input tokens and 500 output tokens. For arithmetic only, suppose the provider charges £2 per million input tokens and £8 per million output tokens. These are invented rates, not a quote from any provider. There is no cached input or separate tool charge in this example. Multiply each count by its own rate, then divide by one million.
| Usage | Calculation | Illustrative cost |
|---|---|---|
| Input | 2,000 × £2 ÷ 1,000,000 | £0.004 |
| Output | 500 × £8 ÷ 1,000,000 | £0.004 |
| Total | £0.004 + £0.004 | £0.008 |
The output is one quarter of the token count but half the illustrated cost because its assumed rate is four times higher. If the actual counts or rates differ, the total changes. OpenAI says input, cached input and output can have different rates, and other capabilities can use different billing units. Check the provider's current pricing and usage record before treating the estimate as a bill.
Why answers can be shorter than expected
A request for a long answer is an instruction, not proof that the model can generate that much. OpenAI's response-length documentation distinguishes an output token cap from a prompt asking for a particular length. As of 22 November 2026, it identifies max_output_tokens for its Responses API and says there is no minimum tokens setting. Confirm the current endpoint and model documentation before using a setting.
A restrictive output cap can leave too little room for the requested response. Conversely, raising a cap sets an upper bound; it does not promise a particular length. For a reasoning model, some output usage may be internal rather than visible. If a response is too short, inspect the cap and usage, then ask for a narrower section or a specified word count. Check the result rather than assuming the requested word count was met.
Common mistakes
Treating every token as a word. OpenAI's English estimate is useful for rough planning, but the exact split depends on the text and encoding. Counting a document's words alone cannot tell you the exact request count or its final output usage. A tokeniser gives a more relevant count than a fixed words-to-tokens multiplier.
Using one provider's counter for another provider's model. Anthropic's own token-counting guidance says counts are model-specific and recommends its counting endpoint with the model intended for inference. It explicitly warns against using OpenAI's tiktoken to estimate Claude counts. OpenAI's repository describes tiktoken as a tokeniser for OpenAI models. Use the counter intended for the model you will call.
Equating a short answer with a cheap request. A long input still contributes to usage even if the response is brief. On OpenAI reasoning models, output usage can also include reasoning that is not visible. Compare the returned usage categories and applicable rates, not just the length of the answer on screen.
What to do with this
Before sending a large API request, identify the model and count the complete input with its provider's method. Check its context window and output cap, then leave room for the response and any reasoning. For OpenAI's Responses API, the documented input-token counting API includes request formatting; OpenAI says an input count does not predict generated output.
Afterwards, inspect the usage information returned by the API and apply the rates for the relevant categories. Keep a small sample of representative requests and compare their actual usage with your estimates. If you revise a document, count both versions with the same model-specific method; Anthropic's guidance suggests subtracting the two counts to see the input difference.
Limits and what to check
This is a guide to token-based API usage, not a universal price list. Subscription products, plans, providers and endpoints can have different limits and billing rules. Prices, model availability and settings change. As of 22 November 2026, the linked OpenAI and Anthropic pages describe the methods above; confirm current model documentation and pricing before committing to a workload.
A count made before generation cannot tell you exactly how much output will be produced. The hypothetical calculation also excludes cached-token rates and any separate service charges. For a real estimate, include the complete request, likely output, every applicable rate and any other billed capability; reconcile it against the provider's usage report.
Sources & further reading
Understanding and counting tokens
Written by the Auratro desk with AI assistance and checked against the sources listed above before publication. See how we work, or report an error. Editorial policy · Contact


