Local-first, multi-provider tool that captures LLM API spend and exposes it to coding agents via MCP
Local-first, multi-provider tool that captures LLM API spend and exposes it to coding agents via MCP. Exposed over MCP by the llm mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.
LLM Usage & Cost Tracker — your local-first spend watchdog
Everything the assistant can do here goes through one of these:
compare — Rank every priced model by projected cost for an n-input / m-output call. Cheapest first, percent against the cheapest. Default viewmodels — Catalog browser. Sibling of compare, but answers "what does this model charge?" rather than "what would my workload cost?". Rates per million tokensrecommend — Picks one. Filters by --provider, --model, and --budget, then returns the cheapest match plus two runner-ups. The reasoning string explains what itspend — Read the SQLite. The default view is a usage_summary headline — total dollars, top-3 providers, top-3 models, largest single call. Pass --group-by tostatus — One screen, four sections: Database, Capture proxy, Providers, Pricing. The "is everything actually working?" command. Read-only — running it on aproviders — Per-provider configuration view. Wider than the status Providers block: adds the wire-format flag (openai-compat: yes/no) and an optional --modelsabout — The front-door panel: version, author, license, and the project homepage. The human-facing companion to --version — fields are read from theBeing a remote server, there is no local install. You register the endpoint with your client, authorise it once, and the tools appear.
You will need 8 environment variables: ANTHROPIC_API_KEY, OPENAI_API_KEY, DEEPSEEK_API_KEY, DASHSCOPE_API_KEY, ANTHROPIC_BASE_URL, OPENAI_BASE_URL, DEEPSEEK_BASE_URL, LLM_USAGE_DB_URL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
Among the AI and media services options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Llm's toolset — compare, models, recommend and 4 more — is a fair guide to whether it matches your workflow. It is maintained by Y.Zhao; worth a glance at recent repository activity before you build anything load-bearing on it.
This entry was verified against Llm's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| compare | Rank every priced model by projected cost for an n-input / m-output call. Cheapest first, percent against the cheapest. Default view family-deduplicates rows that share both a model family root *and* an identical price — |
| models | Catalog browser. Sibling of compare, but answers "what does this model charge?" rather than "what would my workload cost?". Rates per million tokens, sorted alphabetically by provider by default; switch with --sort input |
| recommend | Picks one. Filters by --provider, --model, and --budget, then returns the cheapest match plus two runner-ups. The reasoning string explains what it assumed and what got chosen, so you can sanity-check rather than trust b |
| spend | Read the SQLite. The default view is a usage_summary headline — total dollars, top-3 providers, top-3 models, largest single call. Pass --group-by to switch into rollup mode. |
| status | One screen, four sections: Database, Capture proxy, Providers, Pricing. The "is everything actually working?" command. Read-only — running it on a fresh install before you've ever booted the proxy or MCP server prints da |
| providers | Per-provider configuration view. Wider than the status Providers block: adds the wire-format flag (openai-compat: yes/no) and an optional --models expansion that lists every priced model under each provider. |
| about | The front-door panel: version, author, license, and the project homepage. The human-facing companion to --version — fields are read from the installed package metadata, so they match what PyPI shows. |
{
"mcpServers": {
"llm-usage": {
"command": "uvx",
"args": ["llm-usage-mcp"],
"env": {
"ANTHROPIC_API_KEY": "your-value",
"OPENAI_API_KEY": "your-value",
"DEEPSEEK_API_KEY": "your-value",
"DASHSCOPE_API_KEY": "your-value",
"ANTHROPIC_BASE_URL": "your-value",
"OPENAI_BASE_URL": "your-value",
"DEEPSEEK_BASE_URL": "your-value",
"LLM_USAGE_DB_URL": "your-value"
}
}
}
}Add to claude_desktop_config.json, then restart Claude Desktop.
| Variable | Description | Required |
|---|---|---|
| ANTHROPIC_API_KEY | Credential the server authenticates with. | Yes |
| OPENAI_API_KEY | Credential the server authenticates with. | Yes |
| DEEPSEEK_API_KEY | Credential the server authenticates with. | Yes |
| DASHSCOPE_API_KEY | Credential the server authenticates with. | Yes |
| ANTHROPIC_BASE_URL | Endpoint or connection string the server talks to. | Yes |
| OPENAI_BASE_URL | Endpoint or connection string the server talks to. | Yes |
| DEEPSEEK_BASE_URL | Endpoint or connection string the server talks to. | Yes |
| LLM_USAGE_DB_URL | Endpoint or connection string the server talks to. | Yes |
Build a programmable telecommunications stack for connecting telephony services with the Internet via a cloud-based utility.
Search built for AI, not humans — semantic web search that returns model-ready content, plus code context.
Answers, not links — delegate questions to Perplexity's search-grounded models and get cited responses back.
Give your assistant a voice — text-to-speech, voice cloning and audio tools from the ElevenLabs API.
Give your assistant a real code sandbox — isolated cloud VMs for actually running the code it writes.
The ML hub in your context window — search models, datasets, papers and run Spaces from the official server.