关于 AICostBudget AI API Pricing
这是面向 AICostBudget AI API Pricing Dataset 的只读 MCP 服务,供评估 API 成本的人查询模型价格、比较费用、查看价格变动并估算月度支出。结果附带来源链接和核验日期。
主要功能
- 01查询模型价格
- 02按提供商和费率筛选模型
- 03估算 API 月度费用
- 04比较模型成本
- 05查看价格变动事件
- 06附带来源链接和核验日期
适用场景
- 01查看模型当前列出的费率
- 02估算某种用量的月度支出
- 03比较不同模型的成本
- 04跟踪提供商价格变化
MCP 相关
MCP 服务提供模型定价、筛选列表、成本估算、模型比较和价格变动查询工具。成功结果包含提供商来源链接和核验日期。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
5收录的工具列表 · 更新于 1 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 |
详细介绍
ai-api-pricing-mcp
只读 MCP 服务,使用带来源链接的 AICostBudget AI API Pricing Dataset。它提供模型价格、筛选后的模型列表、月度成本估算、模型比较和价格变更事件。每个成功结果都包含官方服务商来源 URL、验证日期和 AICostBudget 页面链接。
该服务不会写入文件、收集遥测数据,运行时仅使用以下公共端点:
https://aicostbudget.github.io/ai-api-pricing-data/api/v1/prices.jsonhttps://raw.githubusercontent.com/aicostbudget/ai-api-pricing-data/main/data/price-change-events/events.jsonlhttps://aicostbudget.com/sitemap.xml
如果实时价格或价格变更加载失败,响应会明确说明已使用捆绑的备用数据。仅当站点地图中存在模型页面链接时,才会输出这些链接;否则,服务会链接到 https://aicostbudget.com/en/models。
运行
需要 Node.js 18 或更高版本。
npx -y ai-api-pricing-mcp
Claude Desktop
在 claude_desktop_config.json 的 mcpServers 下添加此条目:
{
"mcpServers": {
"ai-api-pricing": {
"command": "npx",
"args": ["-y", "ai-api-pricing-mcp"]
}
}
}
保存文件后重启 Claude Desktop。
在 Claude Desktop 中安装(MCPB)
维护者会创建 GitHub Release 并附上 ai-api-pricing-mcp-<version>.mcpb。从 GitHub Releases 下载此捆绑包,然后双击它,或将其拖入 Claude Desktop → Settings → Extensions 进行安装。
Claude Code
claude mcp add ai-api-pricing -- npx -y ai-api-pricing-mcp
Cursor
在项目中创建 .cursor/mcp.json,或创建 ~/.cursor/mcp.json 以供全局使用:
{
"mcpServers": {
"ai-api-pricing": {
"command": "npx",
"args": ["-y", "ai-api-pricing-mcp"]
}
}
}
VS Code
创建 .vscode/mcp.json:
{
"servers": {
"ai-api-pricing": {
"type": "stdio",
"command": "npx",
"args": ["-y", "ai-api-pricing-mcp"]
}
}
}
工具
get_model_price({ model })list_models({ provider?, max_input_price?, max_output_price? })estimate_monthly_cost({ model, input_tokens_per_request, output_tokens_per_request, requests_per_month, cached_input_ratio?, use_batch? })compare_models({ models, input_tokens_per_request, output_tokens_per_request, requests_per_month })price_changes({ since?, provider? })
模型匹配支持精确 ID 和显示名称。模糊查询若匹配多个模型,会明确返回“你是否想找”列表,而不会静默选择其中一个。成本估算遇到缺少必需价格时会拒绝计算;绝不会替换为标准、缓存或批处理费率。
演示记录
User: Get the price of gpt-4.1.
Assistant → get_model_price: GPT-4.1; input 2, cached input 0.5, output 8 USD per 1M tokens; official source and verified date included.
User: List OpenAI models with input price at most $2 per million tokens.
Assistant → list_models: Matching model IDs and source-linked rates.
User: Estimate 1,000 monthly requests with 1,000 input and 100 output tokens on gpt-4.1.
Assistant → estimate_monthly_cost: $2.80 before taxes, contracts, credits, or provider rounding.
User: Compare gpt-4.1 and claude-haiku-5-5 for that workload.
Assistant → compare_models: Results sorted from lowest to highest estimated total.
User: Show OpenAI price changes since 2026-01-01.
Assistant → price_changes: Up to 20 newest matching events with source URLs and the price monitor link.
故障排查
- **客户端无法启动
npx:**安装 Node.js 18+,并确保客户端应用程序的 PATH 中包含node和npx。 - 首次启动较慢:
npx可能需要下载一次软件包。公司代理必须允许访问 npm 注册表和文档中列出的三个运行时 URL。 - **出现捆绑的备用数据:**实时 URL 超时、返回非 2xx 响应或未通过验证。响应仍可使用,但数据可能较旧;请查看其验证日期。
- **缺少价格错误:**请求的缓存、批处理、输入或输出费率不存在。只有在符合服务商实际计费模式时才更改工作负载;服务不会猜测。
- **模型链接指向
/en/models:**当前站点地图中没有该模型的专属 URL,因此有意使用索引页链接。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。