AI-Cost-CLI

io.github.ufhouck由 GitHub 账号 ufhouck 发布v1.1.0更新于 Oct 24, 2026

AI API cost calculator, recommender & MCP server. 29 models across text/image/video/audio.

已验证STDIO仅桌面金融AI 与机器学习

概览

AI 生成的概览

本地 MCP 服务器兼命令行工具,可计算、比较并推荐 29 个文本、图像、视频和音频 AI 模型的 API 成本。

可以做什么
列出支持的模型及其按单位计价的价格,覆盖文本、图像、视频和音频类型,可换算为本地货币。根据输入和输出 token 数计算文本模型成本,并给出聚合平台的费用明细。比较模型,或将直连供应商与 OpenRouter、Portkey、LiteLLM、Martian 等聚合平台和网关对比。根据“快速、便宜、编程”这类自然语言需求推荐模型。从官方供应商文档同步最新价格数据。
适用场景
适合在多个 AI 模型或供应商之间做选择时使用,让助手在确定模型前估算或比较 API 开销,包括网关和聚合平台费用。
运行要求
作为本地进程运行;需安装带 mcp 附加组件的 PyPI 包 aicost-cli,并用 aicost mcp 命令启动。未声明需要账户、API 密钥或环境变量。货币换算和价格更新需要网络,换算有离线回退。
安装前请注意
费用数字来自内置或同步的价格数据,可能与实际账单费率不一致,应视为估算。sync 命令会通过网络从供应商文档更新价格。不索取任何凭据,也不会产生消费或执行账户操作。

安装

在 SourceWeft 中

  1. 打开 控制台中的 AI-Cost-CLI,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

AI-Cost-CLI

[PyPI] [License: MIT] [Python 3.9+] [MCP Registry]

A terminal-based calculator and recommendation engine for AI API costs. Supports multiple providers, local currency conversion, and automated pricing updates.

Preview: Direct vs. Aggregator Comparison

Compare the effective cost of using models directly vs. through gateways like OpenRouter, including platform fees.

text
                    Comparison: gpt-4o vs openrouter/gpt-4o                     ┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┓┃ Attribute        ┃             gpt-4o              ┃    openrouter/gpt-4o    ┃┡━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━┩│ Provider         │             OpenAI              │       OpenRouter        │├──────────────────┼─────────────────────────────────┼─────────────────────────┤│ Source           │             Direct              │       Aggregator        │├──────────────────┼─────────────────────────────────┼─────────────────────────┤│ Platform Fee     │              0.0%               │          5.5%           │├──────────────────┼─────────────────────────────────┼─────────────────────────┤│ Type             │              text               │          text           │├──────────────────┼─────────────────────────────────┼─────────────────────────┤│ Input Cost       │        111.4775 TRY (1M)        │    117.6088 TRY (1M)    │├──────────────────┼─────────────────────────────────┼─────────────────────────┤│ Output/Unit Cost │        445.9100 TRY (1M)        │    470.4350 TRY (1M)    │└──────────────────┴─────────────────────────────────┴─────────────────────────┘

Supported Models

Text Models

ModelProviderInput/1MOutput/1MTags
Claude Opus 4.7Anthropic$5.00$25.00reasoning, coding, vision, agentic
GPT-5.5OpenAI$5.00$30.00multimodal, coding, agentic
GPT-5.5 ProOpenAI$30.00$180.00precision, enterprise, agentic
Claude Sonnet 4.6Anthropic$3.00$15.00coding, fast, general
GPT-4oOpenAI$2.50$10.00reasoning, coding, vision
Gemini 3.1 ProGoogle$2.00$12.00long-context, multimodal
DeepSeek R1DeepSeek$0.55$2.19reasoning, coding, smart
Gemini 2.5 FlashGoogle$0.30$2.50fast, reasoning, legacy
Gemini 3.1 Flash-LiteGoogle$0.25$1.50fast, cheap, agentic
DeepSeek V3DeepSeek$0.14$0.28general, coding, cheap

Image, Video & Audio Models

ModelProviderPriceType
Imagen 4 FastGoogle$0.02/imageImage
GPT-Image-1OpenAI$0.02/imageImage
DALL-E 3OpenAI$0.04/imageImage
Imagen 4 UltraGoogle$0.06/imageImage
Veo 3 LiteGoogle$0.05/secVideo
Veo 3Google$0.40/secVideo
Lyria 3 ClipGoogle$0.04/clipMusic
Lyria 3 ProGoogle$0.08/songMusic
WhisperOpenAI$0.006/minSpeech-to-Text
TTS StandardOpenAI$15/1M charsText-to-Speech

Full list available via aicost list --currency USD

Features

  • Infrastructure Comparison: Compare Direct providers vs. Aggregators (OpenRouter) and Gateways (Portkey, LiteLLM, Martian).
  • Transparent Commissions: Automatically calculates platform fees (e.g., OpenRouter's 5.5% credit fee).
  • Direct Cost Calculation: Full breakdown of base costs and platform middle-layer fees.
  • Currency Conversion: Real-time conversion to local currencies (TRY, EUR, etc.) with offline fallback.
  • Automated Pricing: Weekly automated updates from official provider documentation.
  • MCP Server: Native support for AI agents (Cursor, Claude Desktop).

Installation

bash
pip install aicost-cli

With MCP server support:

bash
pip install aicost-cli[mcp]

Or from source:

bash
git clone https://github.com/ufhouck/aicost.gitcd aicostpip install -e .

Usage

List All Models

bash
aicost list --currency TRY

Calculate Cost

bash
# Text model — token-basedaicost calc claude-opus-4.7 --input 1000000 --output 500000 --currency TRY
# With platform fee breakdown (aggregators)aicost calc openrouter/gpt-4o --input 1000000 --output 500000 --currency TRY

Output Example:

text
╭───────── Cost Calculation ──────────╮│ Model: openrouter/gpt-4o            ││ Source: Aggregator                  ││                                     ││ Base Cost: 316.9976 TRY             ││ Platform Fee (5.5%): 17.4349 TRY    ││                                     ││ Total Cost: 334.4325 TRY            │╰─────────────────────────────────────╯

Compare Models

bash
aicost compare claude-opus-4.7 gpt-5.5 --currency USD

Get Recommendations

bash
aicost recommend "fast cheap coding" --currency USD

Sync Latest Pricing

bash
aicost sync

MCP Server

Start the Model Context Protocol server for AI agent integration:

bash
aicost mcp

Registries

Contributing

See CONTRIBUTING.md for guidelines on how to contribute, including pricing updates, bug reports, and code contributions.

Community

License

MIT — see LICENSE for details. Developed by Ufuk Aydın.

来源:README.md,提交 cd4e1bc

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分