LLM Pricing MCP Server
Provides pricing data and cost estimation for Google LLM models, and can audit codebases for Google LLM SDK call sites.
Provides pricing data, cost estimation, and usage tracking for OpenAI models. Can use OpenAI GPT-4o-mini as the LLM backend for its conversational agent, and offers an OpenAI-compatible proxy endpoint for drop-in SDK integration.
Integrates with Stripe for SaaS billing, enabling paid tier subscriptions via Stripe Checkout, a self-serve customer portal, and webhook handling for subscription updates.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
LLM Pricing MCP Server
LLM pricing you can verify, route on, and act on: 32 MCP tools, a REST API and browser UIs over pricing data from 30 LLM providers.
Live at: https://llm-pricing-api.fly.dev · API reference: /api-docs · Swagger: /docs
What it does
Verified prices: every curated price is checked against a live external registry; anything drifted more than 5% is withheld, never silently served.
Routes, not just quotes: picks a model by cost and quality for your task.
Executes: the dispatch gateway runs the best eligible model on your own provider keys.
Tracks real spend: records usage, analyzes sessions, fires budget alerts.
Price alerts: webhooks on price changes, self-managed with an
alert_token.Local currency: optional
currency/countryon pricing and estimates (13 currencies).Many surfaces: MCP (STDIO + HTTP), REST, chat agent, calculator / compare / history UIs, billing dashboard, FAQ (
/faq), published legal pages and security statement (/terms,/privacy,/refunds,/dpa,/subprocessors,/security).Customer support: a grounded support assistant (Support mode on
/chat,support_chatMCP tool) that knows the FAQ, the plan catalogue and your own account, and escalates anything it cannot do to the owner with a reference.Retired providers: Anyscale (2026-10)
Related MCP server: AgentCost MCP Server
Quick start
Claude Desktop (remote, no install): open Settings → Connectors → Add custom connector and paste:
https://llm-pricing-api.fly.dev/mcpClaude Desktop ignores a
urlentry inclaude_desktop_config.json; that file only launches local commands.A connector sends no custom headers. For tools that need your service key, use the npx bridge below.
npx bridge (STDIO, no clone, no Python): add to claude_desktop_config.json:
{
"mcpServers": {
"llm-pricing": {
"command": "npx",
"args": ["-y", "llm-pricing-mcp"],
"env": { "LLM_PRICING_API_KEY": "<your-service-key>" }
}
}
}LLM_PRICING_API_KEYis optional; it is forwarded asx-api-key. Options are in npm/llm-pricing-mcp/README.md.Other clients (Cursor, VS Code, Claude Code): docs/MCP_QUICK_START.md · Claude details and troubleshooting: docs/CLAUDE_INTEGRATION.md.
Run locally (Python 3.11):
pip install -r requirements.txt
uvicorn src.main:app --reload --port 8000 # REST + POST /mcp; STDIO server: python mcp/server.pyMCP tools
All 32 tools are listed over POST /mcp and STDIO. MCP protocol version 2024-11-05.
Group | Tools |
Pricing and estimates |
|
Routing |
|
Data quality |
|
History |
|
Price alerts |
|
Usage and budget |
|
Agent, support and dispatch |
|
Pass client (e.g. Claude Code, cursor, github copilot, cline) to recommend_model, optimize_workload, compare_costs or POST /router/recommend and the answer is restricted to models that tool can run before ranking; on the hosted MCP server it is inferred from the handshake when omitted, and an explicit value always wins. Recognised clients and the override order are in docs/MCP_QUICK_START.md.
The chat agent binds 27 of the 32 MCP tools (all except ask_agent, support_chat, get_telemetry, get_cache_stats and dispatch).
Key features
Dispatch gateway
Add a
dispatchpolicy toPOST /v1/chat/completions. The best eligible model runs for real and you get adispatch_receiptwith the chosen model, reason, actual cost and savings.Objectives:
balanced,cheapest,best_quality,lowest_latency,pinned. Failover never drops below yourmin_quality_score.Supports
stream: true(OpenAI-format SSE; the receipt arrives in the final chunk).Text-only, single-choice.
tools,n > 1and image parts are rejected up front, with the feature named.Also available as the
dispatchMCP tool. Executable providers are listed atGET /dispatch/providers.
Stored provider keys
Store each provider key once per org with
POST /dispatch/keys. After that, callers need only their service key.Keys are AES-256-GCM-encrypted at rest and never returned; listings show only a last-4 fingerprint.
A per-request
X-Provider-Key-<Provider>header still overrides the stored key.
Price alerts with alert_token
Registering a price alert returns a one-time
alert_token. It is stored only as a hash and nobody can recover it.View or delete your alert with no account:
POST /pricing/alerts/self/viewor/self/deletewith the token in the JSON body, or themanage_price_alerttool.Listing or deleting all alerts is operator-only.
Webhook SSRF guard
Webhook URLs must be public https. Private, loopback, metadata and unresolvable hosts are refused with 422
invalid_webhook_url.The URL is checked at registration and again at every delivery, connecting only to the checked IP; redirects are never followed.
Older alerts that break the rules are kept but skipped at delivery.
WEBHOOK_ALLOW_PRIVATE_TARGETSis for local development only; never set it in production.
Cost estimation
POST /cost-estimate(one model) andPOST /cost-estimate/batch(1–50 models). No key needed; requests are rate-limited.predict_costandscripts/audit_repo.pyestimate the cost of a workload or a codebase's LLM call sites.
Data quality
GET /data-qualitygives one trust score,confirmed_pct, plus counts of drift-withheld, never-priced and stale models.Every price carries
price_source_kind(providerorregistry).check_price_driftgives per-model detail.
Usage and budget
POST /usagerecords actual spend.GET /usage/summaryandGET /usage/session/{session_id}analyze it.Budget alerts (
POST /usage/alerts) fire a webhook at a threshold;hard_stop: truealso blocks dispatch for your org.
Customer support and plans
Support mode on /chat and the
support_chatMCP tool answer plan, billing, key, rate-limit and how-to questions only from the published FAQ (docs/FAQ.md), the plan catalogue (GET /billing/config) and, with your service key, your own account. No invented prices, policies or response times.Everything outside its authority (refunds, credits, disputes, failed payments, a lost key without the current key, bug/feature/security reports, "talk to a human") becomes an escalation in the owner's operator-only queue with a reference;
POST /support/escalations/statusreturns the owner's reply.Plans describe only what is implemented: rate limit, support assistant allowance and escalation priority. Upgrade and Manage Billing work when Stripe is configured;
POST /billing/key/rotaterotates a key with the current one;GET /billing/account/exportdownloads everything held about your organisation andPOST /billing/account/delete(body{"confirm": "DELETE", "org_id": ...}) irreversibly erases it, ends any Stripe subscription and opens a refund review when you delete inside the 14-day window (v1.87.0); service keys are stored only as a SHA-256 hash; the Stripe webhook handles failed renewals (14-day grace, then the free limit), refunds and disputes, and ignores duplicate deliveries.Legal pages (v1.86.0): /terms, /privacy, /refunds, /dpa, /subprocessors are generated from
docs/legal/*.md(scripts/sync_legal.py), linked from the site footer,/billingand/faq, and show a draft notice until the owner turns onLEGAL_PAGES_LIVEand every placeholder is replaced. Paid checkout stays disabled until then; the Stripe customer portal is unaffected. Refunds: full within 14 days of the first payment, pro-rated after, every request reviewed by the owner via the support assistant. /security states what the service does and does not have (no SOC 2, ISO 27001 or third-party penetration test). The pre-launch list is docs/LAUNCH_CHECKLIST.md.Spend: per-caller daily LLM caps by tier (anonymous strictest) under the orchestrator's global monthly ceiling; a cap hit returns a non-LLM fallback with FAQ links. Every support action leaves an operator-only, append-only record.
Orchestrator core (operator-only)
One place where the operator's inbound work (GitHub issues/PRs, the weekly price audit, owner requests) is accepted exactly once, routed by trigger class and owner-applied labels only, and held at human checkpoints.
/orchestrator/*plus an Orchestrator block on/admin: approval queue, parked runs, run log (CSV), global pause, per-workflow mode, budgets. Nothing merges, moves money or sends anything without a recorded approval.The SDLC pipeline is wrapped as an owner checkpoint: the queue shows the exact
/release-featurecommand; the PR it opens completes the run and posts one status comment on the issue.
Compliance audit (operator-only, v1.88.0)
A weekly (Mondays 07:00 UTC,
compliance-audit.yml) and on-demand mechanical audit of the whole system: legal placeholders and the legal-live gate, Litestream coverage of every database, production secret presence (names only), version consistency, data-quality regression against the previous report, the weekly price audit, orchestrator budget, service-key hashing, Stripe reconciliation whenSTRIPE_AUDIT_KEYis set, and the launch checklist's "done" items. It is report-only (changes nothing audited), makes no legal-compliance claim, and opens an owner approval only when a check fails.POST /audit/run,GET /audit/reports,GET /audit/reports/{id}(latestalias) and a Compliance audit panel on/admin. Reports hold counts, file and setting names and opaque prefixes, never emails, keys or Stripe ids.
Document agent (operator-only, v1.89.0)
Owner-requested decks, one-pagers, release briefs and status reports from a closed four-type catalogue (
release_notes_brief,pricing_comparison_deck,pricing_one_pager,internal_status_report). Every figure comes from a product data call made during the generation and is recorded in a provenance manifest; every number in the text is cross-checked against it (untraceable numbers are removed and counted); each price carries itsprice_as_ofand a status label, and models without a usable price show "price not available" and stay out of rankings and charts.GET /documents/types,POST /documents/generate,GET /documents/artifacts,GET /documents/artifacts/{id}and.../download?format=html|md|pptx|docx(self-contained printable HTML, Markdown, a PowerPoint deck with native tables, native charts and speaker notes, or a Word document with native tables and numbered notes; a deck also saves as a Word handout, a one-pager has no .pptx and answers 415), plus a Documents panel on/admin. One bounded drafting call per document (claude-haiku-5-5by default,claude-sonnet-5-5on request) with a labelled data-only fallback; each document waits for the owner's publish approval. Nothing is sent anywhere, no MCP tool exposes it, and customer-visible behaviour is unchanged.
Access and keys
Access | Who | What it unlocks |
Public | Anyone | Pricing, estimates, data quality, history, registering a price alert, the chat agent, the support assistant in general mode: 19 public MCP tools + the identity-aware |
Service key | You (free: | Usage/budget tools and endpoints, router, |
Operator key | Server operator ( | Listing/deleting all price alerts and conversations, admin customer list and owner-side key rotation ( |
Intake key | GitHub Actions executor ( | Only |
Send keys as
x-api-key: <your-key>(MCP also acceptsAuthorization: Bearer <your-key>).Tiers: Free 30 / Pro 120 / Enterprise 600 req/min. Full endpoint and auth map: /api-docs.
Configuration
Set via environment variables or .env. An unknown key in .env stops startup with an error naming it.
Variable | Purpose |
| Chat agent backend: |
| Key for the chosen agent backend |
| Operator key; protected endpoints are open when unset |
| Enables stored provider keys (unset = 503 on |
| HMAC-SHA256 signing for alert webhooks |
| Local dev only: allow http/private webhook targets |
| SQLite file locations |
| Orchestrator SQLite file (runs, approvals, action records, spend, settings) |
| Separate credential for the GitHub Actions executor; accepted on three routes only |
| Orchestrator retention: rows (365) and redacted I/O summaries (90) |
| Optional pepper (secret, held outside the database) for the account-deletion marker; unset = salt-only markers; back it up (v1.89.4) |
| Restricted read-only Stripe key (Customers, Subscriptions, Webhook Endpoints: read) for the compliance audit's Stripe reconciliation; unset = those checks report n/a (v1.88.0) |
| Optional one-call executive summary of each audit report (default off; model |
| Audit report retention (365), escalation age warning (7 days), stale-price warning (10 %), and a comma list of check ids reported as n/a "disabled" |
| Models for the document writer's one drafting call ( |
| Stored document artefacts are purged after this many days (30); |
| Paid tiers; checkout, portal and webhook stay 503 until set, and checkout also waits for the legal pages to be in force ( |
| Marks the legal pages in force (default false). Even when true, a remaining |
| Support conversations are stored per organisation in this SQLite file ( |
| Full-refund window quoted by |
| Fly secrets (process environment, not |
| Days a failed renewal keeps the paid tier before the account is served at the free limit (14) |
|
|
| Per-caller daily LLM allowance for support by tier (0.10 / 0.50 / 3.00 / 10.00) |
| Escalations an identified customer may open per day (3; anonymous callers get 1) |
| Price a support turn when |
Full list: src/config/settings.py. Production settings: docs/DEPLOYMENT.md.
Development and tests
pytest tests/ -q4117 passing tests, CI/CD on every PR (test → lint → bandit → OSV → gitleaks → deploy); CodeQL and Dependabot run as additional scanners
Git Flow:
feature/*→develop→master. See docs/CONTRIBUTING.md.Internals, services, data stores and CI: docs/ARCHITECTURE.md.
Deploys to Fly.io from
masterwhen all CI gates pass: docs/DEPLOYMENT.md.
Links
docs/INDEX.md: every doc
docs/archive/README.md: historical docs (blue-green deployment, MCP validation report)
/whats-new: release notes
/faq: plans, billing, keys, rate limits, how to get help
/terms · /privacy · /refunds · /dpa · /subprocessors · /security: legal pages and security statement
/mcp-setup: MCP integration hub
License: MIT, see LICENSE
This server cannot be deployed
Maintenance
Related MCP Connectors
Sourced AI-model pricing and capability data — compare and route to the cheapest capable model.
Enforce AI budgets before the model call and track cost per customer across 10 providers.
Find AI model pricing, estimate token costs and compare offers. No API key required.
Live registry of AI model specs, context windows, and per-token pricing.
Related MCP Servers
AlicenseNot gradedqualityDmaintenanceProvides cost intelligence and a reputation scoring system to help AI agents optimize spending through smart model selection and local-to-cloud routing. It enables real-time cost tracking and rewards agents for making efficient, high-credibility decisions across various LLM providers.Apache 2.0- AlicenseNot gradedqualityDmaintenanceProvides real-time AI model pricing, cost estimation, and budget management tools to help agents understand and optimize their spending. It enables agents to compare costs across multiple providers and select the most cost-effective models for specific tasks.1MIT
- AlicenseAqualityDmaintenanceEnables AI agents to discover, compare, and select the best AI models across multiple providers based on pricing, performance, and capabilities, with real-time cost estimation and benchmarking.93,909 npm1MIT
- FlicenseNot gradedqualityDmaintenanceEnables real-time access to LLM pricing, benchmarks, deprecation alerts, and cost optimization for over 30 models across 8 providers, allowing AI agents to make cost-effective model selections.-