Context window budget planner
Split a model's context window between system prompt, tools, history, retrieved documents, input and reserved output — with fit, price band and cost per call.
What it does
A call to a model has to fit everything into one context window: the system prompt, the tool definitions, the conversation so far, the documents you retrieved, the user's new input — and room for the answer. The planner takes each of those parts, as a number of tokens or as a text to count, and shows for the model you choose:
- a bar of the window, split between the parts, with a written legend giving each part's tokens and share;
- whether the whole budget fits the window, and how much is left free or how far over it is;
- whether the output you reserve is more than the model writes in one answer;
- which price band the call falls in, and where a higher band starts;
- what one call costs, with the whole reserved output priced as if the answer used it all — the most the call can cost.
Under it, the same budget on every model in the catalogue, cheapest call first. Everything runs in your browser: a text you paste is counted here and sent nowhere.
How it counts
A number you type is used as it is, on every model. A text's count can be made its number ("Use N as the number"), so that a link can carry it; the number then keeps how it was counted. It is exact only on models that count the text the same way, and an estimate on every other model, whose own tokenizer may count the text differently.
A text is counted the way the Token Counter counts it, with the same code: exactly for OpenAI's models, with OpenAI's own tokenizer run in your browser; as an estimate for Anthropic, Google and xAI, ⌈characters ÷ 4⌉, because their tokenizers run only behind their APIs. Each part is counted on its own, so each part's number is the one the Token Counter gives for that text.
Tool definitions pasted as text are always an estimate. The text is counted, but a provider does not send your JSON to the model as it is: it renders the definitions into the prompt in its own form, which most providers do not publish.
A total is exact only when every counted part is. When any part is an estimate, the total is one too, and says "about". While a text is still being counted, the total is shown as "at least", and whether it fits is unknown until the count arrives.
The window and the most output are Reference Data, read off each provider's own page and dated. Where nobody could read them, they are shown as unknown, and so is every check against them — never a pass.
The cost is priced by Salyro's own cost arithmetic — the function it prices usage with — on today's price list, including the choice of price band. Some models have two bands: a call whose input is over the threshold is priced at the higher band's rates. The threshold comes from the price list, as the provider states it.
What it does not know
- Exact counts for Anthropic, Google and xAI, which need their APIs.
- The tokens a provider adds around each message, and how it renders tool definitions.
- Context windows the build could not read. OpenAI's, Google's and xAI's pages were not reachable when the Reference Data was gathered, so their windows and output limits are unknown here.
- What the answer will actually use. The cost assumes the whole reserved output; a shorter answer costs less.
FAQ
Why reserve output at all?
The window holds the answer as well as the prompt. A prompt that fills the window leaves the model no room to reply, and every model also caps one answer at its own maximum.
Why does crossing a threshold matter so much?
On a model with two price bands, the band is chosen by the size of the input, and the whole call is priced in it. A few thousand tokens over the threshold can make the call noticeably dearer.
Is my text sent anywhere, or put in a link?
No. It is counted in your browser, in a Web Worker. A shared link carries the numbers and the model only: a part entered as text opens empty, ready for its text.
Sources
The token counts come from the Token Counter's own layer: OpenAI's encodings, run with the gpt-tokenizer library and tested against OpenAI's tiktoken. Context windows and output limits are Reference Data, each with its source page and date, listed in the public tools' data freshness report. Prices and their bands come from Salyro's model catalogue.
Where the numbers come from
- Model and pricing data is a snapshot of the catalogue Salyro itself uses, taken when this site was built.
- Facts about models and providers that are not in that catalogue carry their own source and the date they were checked, and are shown as unknown where no reliable source exists.
