LLMKit
About
AI cost tracking MCP server with 11 tools for spend analytics, budget enforcement, and session costs across Claude Code, Cursor, and Cline.
Details
- Author
- smigolsmigol
- Categories
- Developer Tools, AI, Other
Jump to
Setup
Install LLMKit in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/smigolsmigol/llmkit
Follow the installation instructions in the repository README, then restart your MCP client.
Measure what your AI agents cost. Stop requests before they exceed a budget.
Website|Docs|Pricing API|Architecture|Security|Assurance case
LLMKit is an open-source AI gateway and SDK suite for cost attribution, budget admission, and request evidence. The gateway reserves estimated spend before provider dispatch. It rejects requests that cannot fit the active budget, then settles admitted reservations to actual usage when the response completes.
The repository also ships local tracking surfaces that do not require an LLMKit account or proxy.
from llmkit import tracked from openai import OpenAI costs = [] client = OpenAI(http_client=tracked(on_cost=costs.append)) client.chat.completions.create( model="gpt-4.1", messages=[{"role": "user", "content": "Summarize this incident."}], ) print(f"${sum(item.total_cost or 0 for item in costs):.6f}")
The transport reads provider usage metadata and estimates cost from the bundled pricing catalog. It does not send tracking data to LLMKit.
npx @f3d1/llmkit-cli -- python my_agent.py
Use-vfor per-request output or--jsonfor machine-readable results.
Gateway examples require an existing LLMKit API key. Account creation and key management are temporarily unavailable while the authenticated service is restored. If you do not already have a key, use one of the local tracking paths above.
from openai import OpenAI client = OpenAI( base_url="https://api.llmkit.sh/v1", api_key="llmk_your_key_here", ) response = client.chat.completions.create( model="gpt-4.1", messages=[{"role": "user", "content": "Draft a release note."}], )
The control path is built around three boundaries:
- Atomic admission:a Durable Object owns reservation state for each budget scope. Concurrent requests cannot spend the same remaining balance.
- Dispatch-aware idempotency:deterministic failures before dispatch release the key. After provider dispatch may have occurred, failures remain terminal to avoid duplicate spend.
- Bounded responses:non-streaming bodies and individual SSE frames have explicit byte limits. LLMKit cancels upstream reads when a limit is exceeded.
Request receipts bind the admission decision, provider attempt, settlement, and analytics handoff with stable identifiers. Database writes use an outbox, so an analytics outage does not silently erase budget evidence.
{ "mcpServers": { "llmkit": { "command": "npx", "args": ["-y", "@f3d1/llmkit-mcp-server"] } } }
Five local tools inspect supported Claude Code sessions and Cline task data without an LLMKit key. Six gateway tools query spend, budgets, keys, sessions, and service health whenLLMKIT_API_KEYcontains an existing key. Together they expose 11 tools.
The pinned catalog is a bundled reference snapshot, not a live quote. One source file,packages/shared/pricing.json, records the snapshot date and generates the TypeScript, Python, and MCP tables. CI rejects drift between the source and generated files. The public site renders only populated provider tables and displays the source date.
The public comparison endpoint requires no account:
https://api.llmkit.sh/v1/pricing/compare?mode=text-token&models=anthropic%2Fclaude-sonnet-4-6%2Copenai%2Fgpt-4o&input=1000&output=1000&cacheRead=0&cacheWrite=0
The endpoint prices only the exact model keys supplied by the caller. It does not search for or recommend the cheapest model. Pricing is an estimate, not a provider invoice. Provider billing rules, model modality, and catalog freshness remain part of the error boundary.
git clone https://github.com/smigolsmigol/llmkit cd llmkit corepack pnpm@9.15.4 install --frozen-lockfile corepack pnpm@9.15.4 build corepack pnpm@9.15.4 quality:pr
Run the Worker locally with development-only bindings:
corepack pnpm@9.15.4 --filter @f3d1/llmkit-proxy dev
Generic deploy commands are intentionally omitted. Staging and production use separate guarded scripts with explicit target confirmation.
Provider credentials are encrypted with AES-256-GCM using a random IV and owner/provider-bound additional authenticated data. LLMKit API keys are hashed before storage. CI includes secret scanning, static analysis, dependency review, CodeQL, and package provenance checks.
Read thesecurity policy and architectureand the machine-readableSecurity Insights snapshot. Please report vulnerabilities throughGitHub private vulnerability reportingor emailsecurity@llmkit.sh.
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Identity infrastructure for the AI economy. 33-trait psychometric engine — belonging probability, trait vectors, attunement depth. Remote streamable-HTTP. Free tier: 16 tools, 10 req/min.
An unofficial MCP server for the Artificial Analysis API
MCP server that predicts your monthly LLM spend from local Claude Code / Cursor / Codex logs. Forecasts end-of-month $, ranks spike drivers, warns before budget breach. Free tier + paid tier ($19/mo), MIT licensed.
MCP server for AI agent token-cost telemetry + quota-window awareness across Anthropic, OpenAI, Gemini, Ollama, AWS Bedrock. Per-agent attribution, spend-spike detection, 429-prediction tools.
An AI-powered system for analyzing and predicting domestic energy consumption. It offers precise forecasts, historical pattern analysis, and personalized optimization recommendations through a conversational interface.
MCP server for Tessera's LLM cost-optimization layer. Anchored spend, drift detection, recommendations as typed tools.
Tickerr — Live AI Tool Status & API Pricing
Real-time status monitoring, uptime tracking, incident history, and API pricing for 42+ AI tools including ChatGPT, Claude, Gemini, Cursor, GitHub Copilot, Perplexity, DeepSeek, and Groq. No API key required. Data updated every 5 minutes from independent monitoring infrastructure.
The Global Price Benchmark for AI Inference. 1,600+ SKUs, 40+ vendors, 25 AIPI indexes.
GA4 conversion analyst inside Claude. Ask where your funnel is leaking, get numbers back.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





