TokenBudget
Sourced LLM API prices and cost budgets for agent runs across OpenAI, Claude, Gemini and more.
Should I use this
Quality & Safety
Findings (1)
- LOWin get_model_pricing
Based on automated analysis of tool definitions and protocol compliance.
Context Cost
This is the approximate number of tokens consumed each time the server's tools are loaded into a model's context. Higher counts reduce the attention available for other tasks.
Install
One-Click Install
Add this to your `claude_desktop_config.json` file:
{
"mcpServers": {
"tokenbudget": {
"url": "https://tokenbudget.netlify.app/mcp"
}
}
}Remote endpoints
https://tokenbudget.netlify.app/mcpstreamable-httpWhat it can do
Tool inventory
Tools (7)
🟢estimate_cost(text, messages, system, input_tokens, output_tokens, ...)
Price one LLM request (input + expected output) on many models at once, cheapest first, with current list prices from each provider's own pricing page (source URL and check date included), prompt-cache and batch discounts, long-prompt surcharges and announced price changes. Also says whether the request fits each model's context window. Call this before an expensive request to pick a model or to stay inside a budget.
Input Schema
{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Prompt text. Counted with an estimator, never stored."
},
"messages": {
"type": "array",
"items": {
"type": "object"
},
"description": "Chat messages [{role, content}]. Counted with an estimator, never stored."
},
"system": {
"type": "string",
"description": "System prompt text."
},
"input_tokens": {
"type": "integer",
"minimum": 0,
"description": "Exact input token count, if you have it. Overrides text and gives an exact cost."
},
"output_tokens": {
"type": "integer",
"minimum": 0,
"description": "Expected output tokens (or the max_tokens you will allow)."
},
"cached_input_tokens": {
"type": "integer",
"minimum": 0,
"description": "How many input tokens will be read from the prompt cache."
},
"batch": {
"type": "boolean",
"description": "Price with the provider's batch API discount where one is listed."
},
"models": {
"type": "array",
"items": {
"type": "string"
},
"description": "Model ids to compare, e.g. [\"claude-sonnet-5-5\", \"gpt-6.2-sol\", \"gemini-3.8-flash\"]. Omit to compare every listed model. list_models gives every id."
},
"providers": {
"type": "array",
"items": {
"type": "string",
"enum": [
"anthropic",
"openai",
"google",
"deepseek",
"mistral",
"groq"
]
},
"description": "Only these providers."
},
"date": {
"type": "string",
"description": "Price on this day (YYYY-MM-DD), to see announced price changes. Default today."
}
}
}🟢plan_agent_run(turns, system_tokens, tools_tokens, task_tokens, output_tokens_per_turn, ...)
Estimate the total cost of an agent loop that re-sends its growing context every turn, with prompt caching, on many models. Returns total cost, peak context, how many turns fit in each model's context window, how many turns fit in a budget, and a recommended model. Use before starting a long agent task.
Input Schema
{
"type": "object",
"properties": {
"turns": {
"type": "integer",
"minimum": 1,
"maximum": 500,
"description": "Number of model calls in the loop."
},
"system_tokens": {
"type": "integer",
"minimum": 0
},
"tools_tokens": {
"type": "integer",
"minimum": 0,
"description": "Tokens of tool definitions sent every turn."
},
"task_tokens": {
"type": "integer",
"minimum": 0,
"description": "Tokens of the first user message."
},
"output_tokens_per_turn": {
"type": "integer",
"minimum": 0,
"description": "Default 800."
},
"tool_result_tokens_per_turn": {
"type": "integer",
"minimum": 0,
"description": "Default 1500."
},
"cache": {
"type": "boolean",
"description": "Assume prompt caching of the previous turn. Default true."
},
"budget_usd": {
"type": "number",
"exclusiveMinimum": 0
},
"models": {
"type": "array",
"items": {
"type": "string"
},
"description": "Model ids to compare, e.g. [\"claude-sonnet-5-5\", \"gpt-6.2-sol\", \"gemini-3.8-flash\"]. Omit to compare every listed model. list_models gives every id."
},
"providers": {
"type": "array",
"items": {
"type": "string",
"enum": [
"anthropic",
"openai",
"google",
"deepseek",
"mistral",
"groq"
]
},
"description": "Only these providers."
}
},
"required": [
"turns"
]
}🟢check_context_fit(text, messages, system, input_tokens, reserve_output_tokens, ...)
Say which models can take this input plus the output you want to reserve, which cannot, and which do not publish a context window. Use before sending a very large document or conversation.
Input Schema
{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Prompt text. Counted with an estimator, never stored."
},
"messages": {
"type": "array",
"items": {
"type": "object"
},
"description": "Chat messages [{role, content}]. Counted with an estimator, never stored."
},
"system": {
"type": "string",
"description": "System prompt text."
},
"input_tokens": {
"type": "integer",
"minimum": 0,
"description": "Exact input token count, if you have it. Overrides text and gives an exact cost."
},
"reserve_output_tokens": {
"type": "integer",
"minimum": 0
},
"models": {
"type": "array",
"items": {
"type": "string"
},
"description": "Model ids to compare, e.g. [\"claude-sonnet-5-5\", \"gpt-6.2-sol\", \"gemini-3.8-flash\"]. Omit to compare every listed model. list_models gives every id."
},
"providers": {
"type": "array",
"items": {
"type": "string",
"enum": [
"anthropic",
"openai",
"google",
"deepseek",
"mistral",
"groq"
]
},
"description": "Only these providers."
}
}
}🟢count_tokens(text, messages, models)
Estimate how many tokens a text is for each tokenizer family (OpenAI o200k, Claude legacy and 2026, Gemini, DeepSeek, Mistral, Qwen), with an error band. Estimates only; for exact counts use the provider's count endpoint.
Input Schema
{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Prompt text. Counted with an estimator, never stored."
},
"messages": {
"type": "array",
"items": {
"type": "object"
},
"description": "Chat messages [{role, content}]. Counted with an estimator, never stored."
},
"models": {
"type": "array",
"items": {
"type": "string"
},
"description": "Model ids to compare, e.g. [\"claude-sonnet-5-5\", \"gpt-6.2-sol\", \"gemini-3.8-flash\"]. Omit to compare every listed model. list_models gives every id."
}
}
}🟢list_models(providers, provider, min_context)
List every model this tool prices, with input, output, cache and batch prices per 1M tokens, context window, max output, source URL and the day the price was checked.
Input Schema
{
"type": "object",
"properties": {
"providers": {
"type": "array",
"items": {
"type": "string",
"enum": [
"anthropic",
"openai",
"google",
"deepseek",
"mistral",
"groq"
]
},
"description": "Only these providers."
},
"provider": {
"type": "string",
"enum": [
"anthropic",
"openai",
"google",
"deepseek",
"mistral",
"groq"
],
"description": "One provider (same as providers with one item)."
},
"min_context": {
"type": "integer",
"minimum": 0
}
}
}🟢get_model_pricing(model)
Price, context window, long-prompt surcharge, announced price changes and source for one model id.
Input Schema
{
"type": "object",
"properties": {
"model": {
"type": "string"
}
},
"required": [
"model"
]
}🟡send_feedback(kind, message, model, endpoint)
Report a wrong price, a missing model, a bug or an idea. Read by a person. Keep it under 1000 characters and do not include prompts, secrets or personal data (they are scrubbed anyway).
Input Schema
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"bug",
"wrong-price",
"missing-model",
"idea",
"praise",
"other"
]
},
"message": {
"type": "string",
"maxLength": 1000
},
"model": {
"type": "string",
"description": "Model id the feedback is about, if any."
},
"endpoint": {
"type": "string",
"description": "Tool or endpoint the feedback is about, e.g. plan_agent_run."
}
},
"required": [
"message"
]
}Community
Evidence