Completion length predictor
Output tokens usually cost more than input tokens, and they are the part you cannot see until after you pay for them. Always budgeting at max_tokens overstates your bill; ignoring output entirely understates it. This predictor reads your prompt and task type to estimate a realistic output length and cost, so your projections sit close to reality.
How it works
Each task type carries a characteristic output profile: summaries shrink the input, Q&A answers are short, code and long-form writing expand well beyond the prompt. The tool starts from the task profile, then adjusts using signals in your prompt — input length, and any explicit length instruction like “in one paragraph” or “list ten items.” It returns a low, expected, and high token estimate and prices the expected completion against your model’s output rate. Everything runs in your browser.
Typical output ranges by task type
| Task type | Typical output (tokens) | What drives length |
|---|---|---|
| Short Q&A | 20 – 150 | Answer complexity |
| Summarisation | 10 – 30% of input | Compression ratio |
| Classification / sentiment | 5 – 30 | One label or short explanation |
| Code generation | 100 – 2,000+ | Problem size, language verbosity |
| Essay / long-form writing | 500 – 4,000 | Topic breadth, word count instruction |
| Chain-of-thought reasoning | 300 – 1,500 | Problem depth |
| Structured data extraction | 50 – 500 | Number of fields |
These are rough guides. Real output depends on the specific model, the content of the prompt, and any length instructions you include.
How output cost compounds
On many tasks, output tokens cost significantly more per token than input tokens. For a model with a 5:1 output-to-input cost ratio, a 10,000-token input costs the same as a 2,000-token output. On chat and code tasks where output is substantial and repeated across many calls, the output cost can dominate the total bill — which is exactly why this estimate matters more than input counting for those workloads.
For example, a customer-support system making 10,000 calls per day where average output is 300 tokens (not 1,000 at max_tokens) saves the difference between budgeting 10M tokens of output versus 3M. At typical rates, that gap is significant enough to change which model tier is viable.
Tips and notes
The single biggest accuracy gain is telling the model how long to be — “answer in two sentences” both shortens output and makes it predictable. Use the high estimate to set a sensible max_tokens cap and the expected estimate for cost budgeting; they serve different purposes. Output cost often dominates total cost on generative tasks, so this estimate matters more than input counting for chat and code workloads. Measure your real completions over a few hundred calls and adjust your assumptions — nothing beats your own data for refining the forecast.