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 分