See where your complete request fits safely.
Paste text, reserve output, and choose a safety margin. PromptCostLab compares the total request budget against every model in the registry.
Where this request fits safely
Plain-text estimate only. Chat roles, tool schemas, images, files, hidden formatting, and model-specific tokenizers can change the real count. Verify strict limits with the provider.
Reserve output before checking fit
The response shares the request budget on many APIs and can also have a separate cap. Plan output first so a prompt that technically fits still has room to answer.
Keep operational headroom
SDK formatting, chat roles, tool schemas, retrieved evidence, and longer user inputs add tokens. A 10–20% margin is a practical starting point for production planning.
Improve retrieval before upgrading
A larger context window can hide weak retrieval. Select fewer, more relevant passages before paying for a bigger route or accepting slower requests.
Questions people ask before using the result
What is included in an LLM context window?
System instructions, user messages, conversation history, retrieved documents, tool definitions and results, hidden request formatting, and the generated response can all consume context.
Why should I leave safety headroom?
Your planning text may not include chat wrappers, tools, files, images, or unusual user inputs. Headroom reduces truncation and request-limit failures when the real payload is larger.
Is the displayed token count exact?
No. It is a private plain-text estimate. Use provider token-counting APIs or returned usage fields for strict production limits and billing.