Endpoint
POST https://llm-pricing-api.fly.dev/mcp
Protocol
MCP 2024-11-05 · JSON-RPC 2.0
Tools
32 tools · No key needed for pricing tools
npm package
npx -y llm-pricing-mcp v1.1.0 · npmjs.com · MCP Registry io.github.skakumanu/llm-pricing-mcp-server
Recommended. No installation required — your client connects directly to the hosted server at https://llm-pricing-api.fly.dev/mcp.
1

Add to your client's MCP config

Use the url field — no command or local path needed.

{ "mcpServers": { "llm-pricing": { "url": "https://llm-pricing-api.fly.dev/mcp" } } }
2

Optional: add your service key

The 18 pricing and routing tools need no key. The four alert and conversation management tools marked operator only list or delete every subscriber's and visitor's data, so they need the server operator's key (MCP_API_KEY); anyone else gets operator_key_required. The 7 usage and budget tools marked needs key below read or write your org's data, so they need your service API key (free at /billing, POST /billing/signup) sent on the MCP connection as x-api-key or Authorization: Bearer. They then act only on that key's org: org_id defaults to it, and another org's is refused (org_mismatch). Without a key they return customer_key_required. The dispatch tool also needs your service key, plus at least one provider key stored for your org (POST /dispatch/keys): it makes a real model call billed to those keys; without a customer key it returns dispatch_requires_api_key. The support_chat tool works without a key (general answers) and, with your service key, can describe your own plan, payment status and rate limit; it is the one tool that is identity-aware rather than key-gated.

{ "mcpServers": { "llm-pricing": { "url": "https://llm-pricing-api.fly.dev/mcp", "headers": { "x-api-key": "<your-service-key>" } } } }

Claude Code CLI:

claude mcp add --transport http llm-pricing https://llm-pricing-api.fly.dev/mcp --header 'x-api-key: <key>'
3

Restart your client

After saving the config, restart VS Code / Cursor. The 32 tools will appear automatically. (Claude Desktop adds remote servers under Settings → Connectors instead — see its tab.)

4

Ask a question

Try: "What is the cheapest model for RAG under $2/1M tokens?"

For STDIO-only clients. The llm-pricing-mcp npm package is a zero-dependency bridge: it reads MCP requests on stdin and forwards them to the hosted server. Nothing to clone, no Python, no local pricing data to keep fresh. Needs Node 22.23.4+, 24.22.1+ or 26.12.1+ (the builds with the October 2026 security fixes).
1

Add to your client's MCP config

npx -y fetches the package on first run and caches it; nothing else to install.

{ "mcpServers": { "llm-pricing": { "command": "npx", "args": ["-y", "llm-pricing-mcp"] } } }
2

Optional: point it elsewhere, or add your service key

All settings are optional; the defaults work out of the box. LLM_PRICING_API_KEY (bridge v1.1.0+) is forwarded as the x-api-key header and never logged; only the 7 usage and budget tools and dispatch need it. If you use dispatch (a real model call with failover), raise the timeout to LLM_PRICING_MCP_TIMEOUT_MS=120000.

# env vars for the bridge LLM_PRICING_MCP_URL=https://llm-pricing-api.fly.dev/mcp # a self-hosted or local instance LLM_PRICING_MCP_TIMEOUT_MS=30000 # per-request timeout upstream (120000 for dispatch) LLM_PRICING_API_KEY=<your-service-key> # optional: usage & budget tools

In the client config, add "env": { "LLM_PRICING_API_KEY": "<your-service-key>" } next to "args".

3

Restart your client

The 32 tools appear automatically. Package: npmjs.com/package/llm-pricing-mcp (MIT), listed in the MCP Registry as io.github.skakumanu/llm-pricing-mcp-server.

Option A (remote, easiest): in Claude Desktop open Settings → Connectors → Add custom connector and paste https://llm-pricing-api.fly.dev/mcp. Claude Desktop does not read a url entry from claude_desktop_config.json; that file only launches local commands. A connector carries no custom headers, so for the 7 usage/budget tools and dispatch use Option B with LLM_PRICING_API_KEY set. Option B (no Python): the npx tab — npx -y llm-pricing-mcp bridges STDIO to the hosted server. Option C below runs a local Python server — works offline.
1

Clone and install

git clone https://github.com/skakumanu/llm-pricing-mcp-server.git cd llm-pricing-mcp-server python -m venv .venv # macOS/Linux: source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1 pip install -r requirements.txt
2

Edit claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{ "mcpServers": { "llm-pricing": { "command": "python", "args": ["-u", "/absolute/path/to/llm-pricing-mcp-server/mcp/server.py"], "cwd": "/absolute/path/to/llm-pricing-mcp-server", "env": { "PYTHONUNBUFFERED": "1" } } } }
3

Restart Claude Desktop

Tools appear in Claude's tool list. You'll see a hammer icon when the MCP server is active.

VS Code has two separate MCP setups depending on your extension — pick the one you use. Copilot reads its own servers config; Cline / Continue use a mcpServers config in their own settings UI.
1

One-click install

Add to VS Code
Opens VS Code directly. If nothing happens, your VS Code version doesn't support MCP deep links yet — use the JSON below instead.
2

Open your MCP config

Command Palette (Ctrl+Shift+P) → MCP: Open User Configuration for all workspaces, or create .vscode/mcp.json in this workspace for a project-only server.

3

Add the server

Copilot's native MCP config uses a servers key with an explicit type, not the mcpServers shape other clients use:

{ "servers": { "llm-pricing": { "type": "http", "url": "https://llm-pricing-api.fly.dev/mcp" } } }

Optional, for the 7 usage and budget tools: add "headers": { "x-api-key": "<your-service-key>" } next to "url". The pricing tools need no key.

4

Enable the tools in Agent mode

Open the Copilot Chat panel, switch to Agent mode, then click the tools icon and enable llm-pricing. All 32 tools become available to the agent.

1

Open your MCP config

In Cline: Settings (⚙) → MCP Servers → Edit JSON. In Continue: open your MCP server config (mcpServers section of Continue's settings).

2

Add the server

{ "mcpServers": { "llm-pricing": { "url": "https://llm-pricing-api.fly.dev/mcp" } } }
3

Reload the extension

Open the command palette (Ctrl+Shift+P) → Cline: Reload MCP Servers (or restart VS Code for Continue). Tools will appear in the agent panel.

1

One-click install

Add to Cursor
Opens Cursor directly. If nothing happens, your Cursor version may not support MCP deep links yet — use the JSON below instead.
2

Open Cursor MCP config

Windows: %USERPROFILE%\.cursor\mcp.json macOS/Linux: ~/.cursor/mcp.json
3

Add the server

{ "mcpServers": { "llm-pricing": { "url": "https://llm-pricing-api.fly.dev/mcp" } } }

Optional, for the 7 usage and budget tools: add "headers": { "x-api-key": "<your-service-key>" } next to "url". The pricing tools need no key.

4

Restart Cursor

Go to Settings → Features → MCP to confirm the server shows as connected.

1

Open Perplexity MCP config

Windows: %APPDATA%\Perplexity\mcp_config.json macOS: ~/Library/Application Support/Perplexity/mcp_config.json Tip: verify the exact path in Perplexity → Settings → MCP Servers.
{ "mcpServers": { "llm-pricing": { "url": "https://llm-pricing-api.fly.dev/mcp" } } }
2

Restart Perplexity

After saving, restart the desktop app. All 32 pricing tools will be available in your conversations.

3

Verify

Ask: "What LLM pricing tools do you have available?" — Perplexity should list all 32 tools.

All 32 tools are accessible via MCP. Purple = required arg · Grey = optional · needs key = send your service key on the connection (how); these act only on your own org. import_session_usage needs the key too, and dispatch spends on your own stored provider keys.

get_all_pricing
Live pricing for all 600+ models across 30 providers.
No arguments required
estimate_cost
Cost breakdown for a single model and token count.
model_nameinput_tokensoutput_tokens
compare_costs
Side-by-side cost comparison across multiple models. Pass client to flag which ones your tool can run.
model_names[]input_tokensoutput_tokensclient
predict_cost
Paste a prompt — get every model ranked cheapest-first. Counts tokens, infers the task, estimates output length, and factors in prompt-cache savings.
prompttask_typecache_hit_ratiotop_nrequire_function_callingrequire_visionmin_context_tokens
optimize_workload
Route each task to its own cheapest qualifying model instead of one model for everything. Reports the saving versus a single-model deployment. With client, only models your tool can run are used.
workloads[]clientmonthly_budget_usdmin_quality_score
recommend_model
Describe your use case in plain English — get the optimal model recommendation plus up to 3 alternatives. Classifies the description into a task type, then runs the same routing engine behind /router/recommend. Pass client and it only names models your tool can run.
descriptionclienttask_typemax_cost_per_1m_tokensmin_quality_scoremin_context_windowpreferred_providermonthly_budget_usd
check_price_drift
Audit our own pricing against an external reference registry. A drifted price is automatically withheld from serving the moment it's detected — this reports which models and why. The price value itself is never overwritten.
threshold_pctproviderlimit
get_data_quality
Aggregate accuracy summary for the whole catalogue: % confirmed and fresh, how many models are withheld for price drift, how many are unpriced or stale. A single trust signal, distinct from check_price_drift's per-model detail.
No arguments required
get_ide_pricing
Subscription pricing for AI coding IDEs: Copilot, Cursor, Windsurf, JetBrains AI, Amazon Q, Tabnine.
providermax_monthlyinline_only
get_performance_metrics
Throughput, latency, context window, and quality scores.
providerinclude_cost
get_use_cases
Model recommendations by use case and task type.
provider
get_cache_stats
Router recommendation-cache hit/miss statistics.
get_telemetry
Server usage analytics and tool call statistics.
include_detailslimit
get_pricing_history
Historical pricing snapshots for any model or provider.
model_nameproviderdayslimit
get_pricing_trends
Price-change leaderboard — biggest movers over N days.
dayslimit
register_price_alert
Webhook alert when a model price changes by threshold%. The URL must be public https (no private, internal or loopback hosts). Returns a one-time alert_token — save it, it is shown only once.
urlthreshold_pctprovidermodel_name
list_price_alertsoperator only
List all registered price-change webhooks.
No arguments required
delete_price_alertoperator only
Remove a registered webhook by ID.
alert_id
manage_price_alert
View or delete the one price alert you registered, using the alert_token from register_price_alert. No key needed; the token is the credential.
actionalert_token
get_pricing_export_url
Generate a CSV or JSON export URL for pricing data.
formatmodel_nameproviderdays
list_conversationsoperator only
List recent agent conversation sessions.
limit
delete_conversationoperator only
Delete a conversation by session ID.
conversation_id
ask_agent
Ask the ReAct AI pricing agent a natural-language question.
messagesession_id
support_chatkey optional
Customer support assistant for this service: plans and prices, sign-up, upgrade or cancel, invoices, service keys (rotation, lost key), rate limits, connecting over MCP/REST, data accuracy. Grounded in /faq and the plan catalogue; with your key it knows your own plan, payment status and rate limit. Never reveals keys or other customers' data, never changes billing; refunds, disputes, lost keys and "talk to a human" are escalated to the owner with a reference. Capped per caller per day (a cap hit returns FAQ links instead of an LLM answer).
messageconversation_id
record_usageneeds key
Record actual token usage for a completed LLM call. Cost is computed server-side from current pricing, never trusted from the caller — the real-spend counterpart to estimate_cost. Optionally tag with session_id for later per-session analysis.
model_nameinput_tokensoutput_tokensorg_idoccurred_atrequest_idsession_id
get_usage_summaryneeds key
Summarize actual recorded spend: total cost, request count, and breakdowns by model and provider, from usage previously logged via record_usage.
org_iddays
analyze_session_usageneeds key
Analyze one session's actual recorded usage on demand: total tokens, total cost, per-model breakdown, and a grounded model recommendation with estimated savings — or confirmation the current choice is already optimal.
session_id
register_budget_alertneeds key
Register a webhook to be notified when actual recorded spend crosses a USD threshold within a rolling window. Fires at most once per period_days while spend stays over threshold. The URL must be public https.
urlthreshold_usdorg_idperiod_days
list_budget_alertsneeds key
List your org's registered budget-spend webhook alerts with their IDs and settings.
No arguments required
delete_budget_alertneeds key
Delete one of your org's budget-spend alerts by its ID.
alert_id
dispatchneeds key
Run a text chat request through the dispatch gateway: your policy picks the best eligible model and you get the completion plus the full dispatch receipt (chosen model, reason, cost, savings, attempts). Makes a real model call billed to your own provider keys stored with POST /dispatch/keys; spend is recorded against your org. Hosted /mcp or the npx bridge only (with the bridge, set LLM_PRICING_MCP_TIMEOUT_MS=120000).
prompt | messagessystemmodelmax_tokenstemperaturetop_pstopdispatch

recommend_model, optimize_workload and compare_costs take a client argument so the answer only names models your tool can run. Recognised clients: Claude Code, Claude Desktop / claude.ai, Cursor, GitHub Copilot, Windsurf, Cline, Continue, Zed, JetBrains AI, Gemini CLI, Codex CLI, Aider, Amazon Q Developer and ChatGPT desktop (ids claude_code, claude_desktop, cursor, github_copilot, windsurf, cline, continue, zed, jetbrains_ai, gemini_cli, codex_cli, aider, amazon_q, chatgpt_desktop); names are case- and separator-insensitive.

A recognised client restricts the candidates before ranking (it is not just a boost); compare_costs still prices every model you name and flags each runnable_in_client. Override order: explicit client > legacy ide_context (deprecated alias) > the client inferred from the MCP handshake > none. On the hosted server, initialize returns an Mcp-Session-Id header; a client that echoes it is inferred from its clientInfo.name (best effort, in memory, lost on a server restart). Unknown or missing client: unfiltered result plus a note. Every response carries applied_client, client_source, client_as_of and client_note.

What is the cheapest model for RAG pipelines under $2/1M tokens?
Compare GPT-4o vs Claude Sonnet vs Gemini 1.5 Pro on cost and quality
What would 10M tokens per month cost on each major provider?
Which models have dropped in price in the last 30 days?
Which model gives the best quality per dollar for coding tasks?

Click any prompt to copy it.

ProblemFix
Tools not showing after restartCheck the config file path and JSON syntax. Use a JSON validator if unsure. Ensure no trailing commas.
STDIO server hangs with no outputExpected — the STDIO server waits for JSON-RPC input on stdin. It is not a web server; use it only with a MCP client.
ModuleNotFoundError (local STDIO)Activate the virtualenv (source .venv/bin/activate) and run from the repo root directory.
Model not found errorCall get_all_pricing first to get valid model names — they are case-sensitive.
Connection refused / timeoutRun curl https://llm-pricing-api.fly.dev/health to verify the server is up. If using local STDIO, ensure the server process is running.
401 Unauthorized on MCP endpointThe /mcp endpoint itself never returns 401 — no key is needed to connect or to use the pricing tools. If you see 401, check for a proxy or misconfigured auth header in your client.
customer_key_required from a usage or budget toolThe 7 usage and budget tools need your service API key on the MCP connection: x-api-key or Authorization: Bearer header, or LLM_PRICING_API_KEY for the npx bridge. Get a free key at /billing. The local STDIO server and the chat agent are always anonymous, so these tools refuse there.
operator_key_requiredlist_price_alerts, delete_price_alert, list_conversations and delete_conversation are restricted to the server operator: they need MCP_API_KEY on the connection. A service key from /billing does not unlock them. To view or delete a price alert you registered yourself, use manage_price_alert with the alert_token returned at registration (alerts registered before v1.81.0 have no token and are removed via the operator).
413 Request body too largePOST /mcp bodies are capped at 1,000,000 bytes. Split a large import_session_usage batch across several calls with the same session_id — imports are idempotent.
invalid_webhook_urlregister_price_alert and register_budget_alert only accept a public https webhook URL. Plain http, private, loopback, link-local, cloud-metadata or internal hosts (including hostnames that resolve to one) and hosts that do not resolve are refused, and nothing is stored. The reason field names the category. Redirects from your endpoint are never followed. Alerts registered before v1.80.1 that break these rules are kept but are not delivered.
invalid_alert_tokenmanage_price_alert found no alert for that alert_token. The response is the same whether the token is mistyped, already used to delete its alert, or never existed. Tokens are shown only once and cannot be recovered or re-issued; if you lost yours, register a new alert (alerts registered before v1.81.0 have no token and are removed via the operator).
org_mismatchA service key only acts on its own org. Omit org_id (it defaults to your key's org) or pass your own.
📖 API Reference 🔍 Swagger UI GitHub Repo 💬 Try the AI Agent