LLM Pricing
Real-time, drift-verified LLM pricing across 26 providers with cost+quality model routing.
我该使用它吗
质量与安全性
发现(3)
- LOW在 estimate_cost 中
- LOW在 compare_costs 中
- LOW在 ask_agent 中
基于对工具定义和协议合规性的自动分析。
上下文开销
这是每次将服务器的工具加载到模型上下文窗口时所消耗的大致 token 数。数值越高,可用于其他任务的注意力就越少。
安装
一键安装
将以下内容添加到你的 `claude_desktop_config.json` 文件中:
{
"mcpServers": {
"llm-pricing-mcp-server": {
"url": "https://llm-pricing-api.fly.dev/mcp"
}
}
}远程端点
https://llm-pricing-api.fly.dev/mcpstreamable-http它能做什么
工具清单
工具(29)
🟢get_all_pricing
Get current pricing for all LLM models from all providers
输入模式
{
"type": "object",
"properties": {},
"required": []
}⚪estimate_cost(model_name, input_tokens, output_tokens)
Estimate the cost of using a specific LLM model
输入模式
{
"type": "object",
"properties": {
"model_name": {
"type": "string",
"description": "Name of the LLM model (e.g., 'gpt-4', 'claude-3-opus')"
},
"input_tokens": {
"type": "integer",
"description": "Number of input tokens",
"minimum": 0
},
"output_tokens": {
"type": "integer",
"description": "Number of output tokens",
"minimum": 0
}
},
"required": [
"model_name",
"input_tokens",
"output_tokens"
]
}⚪compare_costs(model_names, input_tokens, output_tokens)
Compare costs for multiple LLM models
输入模式
{
"type": "object",
"properties": {
"model_names": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of model names to compare"
},
"input_tokens": {
"type": "integer",
"description": "Number of input tokens",
"minimum": 0
},
"output_tokens": {
"type": "integer",
"description": "Number of output tokens",
"minimum": 0
}
},
"required": [
"model_names",
"input_tokens",
"output_tokens"
]
}🟢get_performance_metrics(provider, include_cost)
Get performance metrics (throughput, latency, context window) for models
输入模式
{
"type": "object",
"properties": {
"provider": {
"type": "string",
"description": "Optional provider filter (e.g., 'openai', 'anthropic')"
},
"include_cost": {
"type": "boolean",
"description": "Include cost metrics in response (default: true)",
"default": true
}
},
"required": []
}🟢get_use_cases(provider)
Get recommended use cases and strengths for LLM models
输入模式
{
"type": "object",
"properties": {
"provider": {
"type": "string",
"description": "Optional provider filter"
}
},
"required": []
}🟢get_telemetry(include_details, limit)
Get MCP server telemetry and usage statistics including tool usage, response times, and error rates
输入模式
{
"type": "object",
"properties": {
"include_details": {
"type": "boolean",
"description": "Include detailed statistics (default: true)",
"default": true
},
"limit": {
"type": "integer",
"description": "Maximum items per category (default: 10, max: 50)",
"default": 10,
"minimum": 1,
"maximum": 50
}
},
"required": []
}🟢get_pricing_history(model_name, provider, days, limit)
Query historical pricing snapshots recorded over time. Use this to look up past prices for a model or provider, or to see how prices have changed over a given number of days.
输入模式
{
"type": "object",
"properties": {
"model_name": {
"type": "string",
"description": "Filter by model name (e.g. 'gpt-4o'). Omit for all models."
},
"provider": {
"type": "string",
"description": "Filter by provider (e.g. 'openai'). Omit for all providers."
},
"days": {
"type": "integer",
"description": "Look-back window in days (default: 30, max: 365)",
"default": 30,
"minimum": 1,
"maximum": 365
},
"limit": {
"type": "integer",
"description": "Maximum number of snapshot rows to return (default: 50, max: 500)",
"default": 50,
"minimum": 1,
"maximum": 500
}
},
"required": []
}🟡get_pricing_trends(days, limit)
Find models whose prices changed the most over a given period. Returns models sorted by absolute percentage price change with a direction label ('increased', 'decreased', or 'unchanged'). Use this to answer questions like 'which models got cheaper this month?' or 'which providers raised prices recently?'
输入模式
{
"type": "object",
"properties": {
"days": {
"type": "integer",
"description": "Look-back window in days (default: 30, max: 365)",
"default": 30,
"minimum": 1,
"maximum": 365
},
"limit": {
"type": "integer",
"description": "Maximum models to return (default: 20, max: 100)",
"default": 20,
"minimum": 1,
"maximum": 100
}
},
"required": []
}⚪register_price_alert(url, threshold_pct, provider, model_name)
Register a webhook URL to receive notifications when a model's price changes by more than a specified percentage. Optionally scope the alert to a specific provider or model. Returns the alert ID.
输入模式
{
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Webhook URL to POST when the alert fires"
},
"threshold_pct": {
"type": "number",
"description": "Minimum absolute % price change to trigger the alert (default: 5.0)",
"default": 5
},
"provider": {
"type": "string",
"description": "Limit to a specific provider (e.g. 'openai'). Omit for all."
},
"model_name": {
"type": "string",
"description": "Limit to a specific model name. Omit for all models."
}
},
"required": [
"url"
]
}🟡list_price_alerts
List all registered price-change webhook alerts with their IDs and settings.
输入模式
{
"type": "object",
"properties": {},
"required": []
}🔴delete_price_alert(alert_id)
Delete a registered price-change alert by its ID.
输入模式
{
"type": "object",
"properties": {
"alert_id": {
"type": "integer",
"description": "The ID of the alert to delete (from list_price_alerts or register_price_alert)"
}
},
"required": [
"alert_id"
]
}🟡get_pricing_export_url(format, model_name, provider, days, limit)
Generate a download URL for the pricing history export. Returns a URL the user can open in their browser to download snapshot history as CSV (for spreadsheets) or JSON (for code). Use this when the user asks to export, download, or save pricing data.
输入模式
{
"type": "object",
"properties": {
"format": {
"type": "string",
"description": "Output format: 'csv' (default) or 'json'",
"enum": [
"csv",
"json"
],
"default": "csv"
},
"model_name": {
"type": "string",
"description": "Filter by model name (optional)"
},
"provider": {
"type": "string",
"description": "Filter by provider (optional)"
},
"days": {
"type": "integer",
"description": "Look-back window in days (default: 30, max: 365)",
"default": 30,
"minimum": 1,
"maximum": 365
},
"limit": {
"type": "integer",
"description": "Max rows to export (default: 10000, max: 100000)",
"default": 10000,
"minimum": 1,
"maximum": 100000
}
},
"required": []
}🟢list_conversations(limit)
List stored chat conversation sessions with their IDs, last-updated timestamp, turn count, and a preview of the most recent user message. Use this when the user asks to see their past conversations or chat history.
输入模式
{
"type": "object",
"properties": {
"limit": {
"type": "integer",
"description": "Maximum number of conversations to return (default: 20, max: 100)",
"default": 20,
"minimum": 1,
"maximum": 100
}
},
"required": []
}🔴delete_conversation(conversation_id)
Delete a specific chat conversation by its ID. Use when the user asks to delete, clear, or remove a past conversation. Use list_conversations first to find the conversation ID.
输入模式
{
"type": "object",
"properties": {
"conversation_id": {
"type": "string",
"description": "The ID of the conversation to delete"
}
},
"required": [
"conversation_id"
]
}🟢get_ide_pricing(provider, max_monthly, inline_only)
Get subscription pricing for AI coding IDE tools: GitHub Copilot, Cursor, Windsurf, Claude.ai, JetBrains AI, Amazon Q Developer, and Tabnine. Returns monthly subscription cost, inline completion support, context window, and per-tool strengths. Use this when the user asks to compare IDE AI tools, subscription-based coding assistants, or wants to know which IDE AI fits their budget.
输入模式
{
"type": "object",
"properties": {
"provider": {
"type": "string",
"description": "Filter by provider name (partial match, case-insensitive). Examples: 'GitHub Copilot', 'Cursor', 'Windsurf', 'JetBrains', 'Amazon Q', 'Tabnine'"
},
"max_monthly": {
"type": "number",
"description": "Only return plans at or below this monthly USD price (e.g. 20 for $20/mo)",
"minimum": 0
},
"inline_only": {
"type": "boolean",
"description": "If true, only return tools that support real-time inline code completion",
"default": false
}
},
"required": []
}⚪predict_cost(prompt, task_type, top_n, cache_hit_ratio, require_function_calling, ...)
Predict the real cost of an LLM call from your actual prompt text — no need to know token counts in advance. Counts tokens locally, infers the task type (or accepts one explicitly), estimates output length from empirical I/O profiles, and returns all models ranked cheapest-first with effective cost after prompt-cache savings. Also surfaces the best quality-per-dollar pick. Use this before making any LLM API call to avoid surprise bills.
输入模式
{
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The actual prompt text to cost-estimate (required)"
},
"task_type": {
"type": "string",
"description": "Task type for output-length estimation. Auto-inferred from prompt if omitted. Options: classification, extraction, summarization, qa, code_generation, translation, chat, content_generation, reasoning, function_calling, data_analysis, rewrite",
"enum": [
"classification",
"extraction",
"summarization",
"qa",
"code_generation",
"translation",
"chat",
"content_generation",
"reasoning",
"function_calling",
"data_analysis",
"rewrite"
]
},
"top_n": {
"type": "integer",
"description": "Number of models to return, ranked cheapest-first (default: 10, max: 50)",
"default": 10,
"minimum": 1,
"maximum": 50
},
"cache_hit_ratio": {
"type": "number",
"description": "Fraction of calls that hit the prompt cache (0–1). Set this if you have a large reusable system prompt. Supported providers: Anthropic (10% cache rate), OpenAI (50%), Google (25%). Default: 0",
"default": 0,
"minimum": 0,
"maximum": 1
},
"require_function_calling": {
"type": "boolean",
"description": "Only include models that support function/tool calling (default: false)",
"default": false
},
"require_vision": {
"type": "boolean",
"description": "Only include models that support image/vision input (default: false)",
"default": false
},
"min_context_tokens": {
"type": "integer",
"description": "Minimum context window size required in tokens (optional)",
"minimum": 1
}
},
"required": [
"prompt"
]
}🟢optimize_workload(workloads, monthly_budget_usd, min_quality_score)
Optimise a multi-task LLM workload by assigning the cheapest qualifying model to each task instead of running everything through one model. Takes a list of workloads (task type + monthly volume + optional quality floor and capability requirements) and returns a per-task model allocation, the total monthly cost, and the saving versus the best single-model deployment. If a monthly budget is given, leftover headroom is spent on the most cost-efficient quality upgrades. Use when the user asks how to cut LLM spend across several task types, or whether tiered model routing is worth it.
输入模式
{
"type": "object",
"properties": {
"workloads": {
"type": "array",
"description": "One entry per task type in the workload mix",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"task_type": {
"type": "string",
"description": "Task category driving the input/output token ratio",
"enum": [
"classification",
"extraction",
"summarization",
"qa",
"code_generation",
"translation",
"chat",
"content_generation",
"reasoning",
"function_calling",
"data_analysis",
"rewrite"
]
},
"monthly_requests": {
"type": "integer",
"description": "Expected requests per month for this task",
"minimum": 0
},
"avg_input_tokens": {
"type": "integer",
"description": "Average prompt size in tokens (default: 500)",
"default": 500,
"minimum": 1
},
"avg_output_tokens": {
"type": "integer",
"description": "Average completion size in tokens. Derived from the task profile when omitted.",
"minimum": 1
},
"min_quality_score": {
"type": "number",
"description": "Quality floor (0-100) for this task specifically",
"minimum": 0,
"maximum": 100
},
"require_function_calling": {
"type": "boolean",
"description": "Task needs tool/function calling (default: false)",
"default": false
},
"require_vision": {
"type": "boolean",
"description": "Task needs image input (default: false)",
"default": false
},
"min_context_tokens": {
"type": "integer",
"description": "Minimum context window required for this task",
"minimum": 1
},
"label": {
"type": "string",
"description": "Friendly name for this workload in the output"
}
},
"required": [
"task_type",
"monthly_requests"
]
}
},
"monthly_budget_usd": {
"type": "number",
"description": "Total monthly budget in USD. Leftover headroom is spent on the most cost-efficient quality upgrades.",
"exclusiveMinimum": 0
},
"min_quality_score": {
"type": "number",
"description": "Global quality floor (0-100) applied to every workload",
"minimum": 0,
"maximum": 100
}
},
"required": [
"workloads"
]
}🟢recommend_model(description, task_type, max_cost_per_1m_tokens, min_quality_score, min_context_window, ...)
Recommend the optimal LLM model from a free-text description of your use case — no need to already know the routing engine's task_type vocabulary. Classifies the description into a task type, then runs it through the same routing engine behind /router/recommend (live pricing + benchmark quality, hard filters for cost/quality/context window, scored by quality-per-dollar). Returns the best match plus up to 3 alternatives. Read-only — use predict_cost first if you also want per-model cost estimates for an actual prompt, and optimize_workload if you have several distinct task types to route at once.
输入模式
{
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "Free-text description of the use case, e.g. 'summarize long customer support tickets' or 'generate Python unit tests'"
},
"task_type": {
"type": "string",
"description": "Optional explicit task type, bypassing auto-classification of the description. Options: classification, extraction, summarization, qa, code_generation, translation, chat, content_generation, reasoning, function_calling, data_analysis, rewrite",
"enum": [
"classification",
"extraction",
"summarization",
"qa",
"code_generation",
"translation",
"chat",
"content_generation",
"reasoning",
"function_calling",
"data_analysis",
"rewrite"
]
},
"max_cost_per_1m_tokens": {
"type": "number",
"description": "Maximum acceptable average cost per 1M tokens (USD)",
"minimum": 0
},
"min_quality_score": {
"type": "number",
"description": "Minimum required quality score (0-100)",
"minimum": 0,
"maximum": 100
},
"min_context_window": {
"type": "integer",
"description": "Minimum required context window size (tokens)",
"minimum": 0
},
"preferred_provider": {
"type": "string",
"description": "Preferred provider name (10% score boost applied)"
},
"prefer_low_latency": {
"type": "boolean",
"description": "Prioritise lower-latency models (default: false)",
"default": false
},
"exclude_reasoning_models": {
"type": "boolean",
"description": "Exclude slow thinking/reasoning models (default: false)",
"default": false
},
"ide_context": {
"type": "string",
"description": "IDE context hint — boosts IDE-native tools: 'copilot' | 'cursor' | 'windsurf' | 'claude_code' | 'jetbrains' | 'amazon_q'"
},
"monthly_budget_usd": {
"type": "number",
"description": "Monthly spend ceiling in USD. Combined with estimated_monthly_requests, avg_input_tokens, and avg_output_tokens to hard-filter models that would exceed it.",
"exclusiveMinimum": 0
},
"estimated_monthly_requests": {
"type": "integer",
"description": "Estimated requests per month (default: 1000)",
"default": 1000,
"minimum": 1
},
"avg_input_tokens": {
"type": "integer",
"description": "Average input tokens per request (default: 500)",
"default": 500,
"minimum": 1
},
"avg_output_tokens": {
"type": "integer",
"description": "Average output tokens per request (default: 200)",
"default": 200,
"minimum": 1
}
},
"required": [
"description"
]
}🟢check_price_drift(threshold_pct, provider, limit)
Audit this server's own pricing data against an external reference registry. Prices here are hand-maintained and go stale silently; a price that disagrees with the registry by more than the threshold is automatically withheld from serving the moment it's detected, not just when this tool runs. This reports what's currently withheld and why. The price value itself is never overwritten by the registry. Use when the user asks whether the pricing data is accurate or up to date, or wants to audit a specific provider's rates.
输入模式
{
"type": "object",
"properties": {
"threshold_pct": {
"type": "number",
"description": "Minimum % difference to report (default: 5)",
"default": 5,
"minimum": 0
},
"provider": {
"type": "string",
"description": "Limit the audit to one provider (partial, case-insensitive)"
},
"limit": {
"type": "integer",
"description": "Maximum findings to return (default: 50, max: 200)",
"default": 50,
"minimum": 1,
"maximum": 200
}
},
"required": []
}🟢get_data_quality
Report an aggregate accuracy summary for the pricing catalogue: what percentage of models have a confirmed, fresh price, how many are currently withheld due to price drift, how many are newly discovered and not yet priced, and how many confirmed prices are over 90 days old. A single trust signal, distinct from check_price_drift which lists individual disputes. Use when the user asks how accurate or trustworthy the pricing data is, overall.
输入模式
{
"type": "object",
"properties": {},
"required": []
}🟡get_cache_stats
Report process-lifetime hit/miss counts, total lookups, and hit rate for the ~5-minute recommendation cache, separately for the recommend_model tool and POST /router/recommend (never combined). Server-operations introspection for confirming the cache is reducing recomputation in production, not a pricing question. Counts reset on process restart; reading them never changes them.
输入模式
{
"type": "object",
"properties": {},
"required": []
}⚪record_usage(model_name, input_tokens, output_tokens, org_id, occurred_at, ...)
Record actual token usage for a completed LLM call. Cost is computed server-side from current pricing, never trusted from the caller — this is the 'actual spend' counterpart to estimate_cost's hypothetical numbers. Optionally scope to an org_id for per-org spend tracking. Resubmitting the same request_id for the same org is a no-op. Use when the user wants to log or track real LLM spend, not just estimate it.
输入模式
{
"type": "object",
"properties": {
"model_name": {
"type": "string",
"description": "Name of the LLM model that was called"
},
"input_tokens": {
"type": "integer",
"description": "Number of input tokens actually used",
"minimum": 0
},
"output_tokens": {
"type": "integer",
"description": "Number of output tokens actually used",
"minimum": 0
},
"org_id": {
"type": "string",
"description": "Optional organisation ID to attribute this usage to"
},
"occurred_at": {
"type": "number",
"description": "Unix timestamp when the call happened (default: now)"
},
"request_id": {
"type": "string",
"description": "Optional idempotency key — resubmitting the same value is a no-op"
},
"session_id": {
"type": "string",
"description": "Optional session ID to tag this event with, so it can later be grouped and retrieved via analyze_session_usage — e.g. a bounded burst of calls like a coding-agent run or a chat session"
}
},
"required": [
"model_name",
"input_tokens",
"output_tokens"
]
}🟢get_usage_summary(org_id, days)
Get a summary of actual recorded LLM spend: total cost, request count, and breakdowns by model and provider, from usage events previously logged via record_usage. Use when the user asks what they've actually spent, as opposed to a hypothetical cost estimate.
输入模式
{
"type": "object",
"properties": {
"org_id": {
"type": "string",
"description": "Optional organisation ID filter"
},
"days": {
"type": "integer",
"description": "Look-back window in days (default: 30, max: 365)",
"default": 30,
"minimum": 1,
"maximum": 365
}
},
"required": []
}🟡analyze_session_usage(session_id, org_id)
Analyze one specific session's actual recorded LLM usage (tagged via record_usage's session_id) on demand: total input/output tokens, total actual cost, and a per-model breakdown if more than one model was used. Also runs the session's own observed token pattern through the same routing engine behind recommend_model / POST /router/recommend to produce a grounded recommendation — or confirm the current choice is already optimal — with the estimated dollar savings or increase versus this session's actual cost. Returns has_data: false with no recommendation if the session_id has no recorded usage. Advisory only — never switches or reroutes anything.
输入模式
{
"type": "object",
"properties": {
"session_id": {
"type": "string",
"description": "The session_id previously used when calling record_usage"
},
"org_id": {
"type": "string",
"description": "Optional organisation ID filter — scopes the lookup to usage events recorded under that org_id, same as get_usage_summary's org_id"
}
},
"required": [
"session_id"
]
}🟢import_session_usage(session_id, org_id, entries)
Bulk-import a completed session's usage in a single call — the retroactive counterpart to record_usage, for when a session wasn't instrumented live. Use when a calling agent (e.g. VS Code Copilot Chat) already has a session's turn-by-turn history in its own local store and wants this server to report on it exactly as if it had been tracked live. Accepts a list of entries under one shared session_id; each entry resolves its input and output tokens independently, either from exact counts when known or by estimating from raw turn text using this server's existing token counter. Cost is always computed server-side from current pricing, never trusted from the caller. A malformed entry (no usable tokens/text on one side, or an unresolvable model_name) is reported as its own per-entry failure and does not fail the rest of the batch. Idempotent like record_usage — resubmitting the same entries (same request_id, or the same session_id/model/occurred_at/token-or-text when request_id is omitted) is a no-op. Recorded usage is then readable via analyze_session_usage and GET /usage/session/{session_id}.
输入模式
{
"type": "object",
"properties": {
"session_id": {
"type": "string",
"description": "Shared session ID to tag every entry in this batch with"
},
"org_id": {
"type": "string",
"description": "Optional organisation ID to attribute this usage to"
},
"entries": {
"type": "array",
"description": "Usage entries to import, one per turn/call in the session",
"minItems": 1,
"maxItems": 500,
"items": {
"type": "object",
"properties": {
"model_name": {
"type": "string",
"description": "Name of the LLM model used for this entry"
},
"occurred_at": {
"type": "number",
"description": "Unix timestamp when this call happened (default: now)"
},
"input_tokens": {
"type": "integer",
"minimum": 0,
"description": "Exact input token count, if known"
},
"output_tokens": {
"type": "integer",
"minimum": 0,
"description": "Exact output token count, if known"
},
"input_text": {
"type": "string",
"description": "Raw input/prompt text — used to estimate input_tokens via this server's token counter when input_tokens isn't known"
},
"output_text": {
"type": "string",
"description": "Raw output/response text — used to estimate output_tokens via this server's token counter when output_tokens isn't known"
},
"request_id": {
"type": "string",
"description": "Optional idempotency key. When omitted, a deterministic one is derived from session_id/model_name/occurred_at/token-or-text source so resubmitting the same entry is safely a no-op"
}
},
"required": [
"model_name"
]
}
}
},
"required": [
"session_id",
"entries"
]
}⚪register_budget_alert(url, threshold_usd, org_id, period_days)
Register a webhook URL to receive notifications when actual recorded spend (from record_usage) crosses a USD threshold within a rolling window. Optionally scope to a specific org_id (omit for total spend across all orgs). Fires at most once per period_days while spend stays over threshold. Returns the alert ID.
输入模式
{
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Webhook URL to POST when the alert fires"
},
"threshold_usd": {
"type": "number",
"description": "Spend level in USD that triggers the alert"
},
"org_id": {
"type": "string",
"description": "Organisation to monitor. Omit for total spend across all orgs."
},
"period_days": {
"type": "integer",
"description": "Rolling look-back window for the spend check, in days (default: 30)",
"default": 30
}
},
"required": [
"url",
"threshold_usd"
]
}🟢list_budget_alerts
List all registered budget-spend webhook alerts with their IDs and settings.
输入模式
{
"type": "object",
"properties": {},
"required": []
}🔴delete_budget_alert(alert_id)
Delete a registered budget-spend alert by its ID.
输入模式
{
"type": "object",
"properties": {
"alert_id": {
"type": "integer",
"description": "The ID of the alert to delete (from list_budget_alerts or register_budget_alert)"
}
},
"required": [
"alert_id"
]
}⚪ask_agent(message, conversation_id, autonomous)
Ask the LLM Pricing AI agent a question in natural language. Use for complex queries about pricing, model recommendations, cost optimisation advice, or anything that benefits from multi-step reasoning.
输入模式
{
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The question or task for the pricing agent"
},
"conversation_id": {
"type": "string",
"description": "Optional conversation ID to continue a previous session"
},
"autonomous": {
"type": "boolean",
"description": "Run in autonomous task mode (default: false)",
"default": false
}
},
"required": [
"message"
]
}社区
证据