Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI API Price Compare

对比主流 AI 模型(Claude / GPT / Gemini / DeepSeek)在官方和第三方中转站的 API 价格,计算使用中转能省多少钱。

English | 中文

为什么需要这个工具?

选择 AI API 时,除了官方渠道,还有很多第三方中转站(relay)提供相同模型的访问。但两者的定价、计费方式、可用模型经常不同,手动对比很麻烦。

这个工具把主流模型的官方价格和中转价格放在一起,一眼看出:

  • 哪些模型用中转更划算
  • 按你的实际月用量能省多少钱
  • 哪些模型官方和中转价格一致(中转价值在便利性而非价格)

快速开始

# 对比全部模型
python compare.py

# 对比指定模型
python compare.py gpt-4o

# 按月用量估算节省(单位:tokens)
python compare.py claude-opus-4 --usage 1000000

输出示例

模型                    官方均价      中转均价        节省      节省%
--------------------------------------------------------------------
claude-opus-4          $   30.00  $   10.00  $   20.00    66.7%
gemini-2.5-flash       $    0.85  $    0.49  $    0.36    42.6%
claude-sonnet-4-5      $    6.00  $    6.00  $    0.00     0.0%
gpt-4o                 $    4.38  $    4.38  $    0.00     0.0%
...

数据来源

渠道 说明
官方价格 各厂商官方定价页(Anthropic / OpenAI / Google / DeepSeek)
中转价格 qionggeme 公开定价

价格数据在 price_data.py,按厂商官方公告更新。如发现数据过期,欢迎提 PR。

中转站的真正价值

很多模型官方和中转价格一致(节省 0%),那为什么还要用中转?

  1. 支付门槛:官方需要海外信用卡 + 手机号,中转支持支付宝/微信
  2. 统一入口:一个 API Key 调用所有模型,不用在多家注册
  3. 网络稳定:中转服务器在国内或香港,访问更稳定
  4. 兼容格式:中转通常兼容 OpenAI 格式,现有代码无缝迁移
  5. 部分型号有价差:如 Claude Opus 系列中转价格显著低于官方

作为 Python 库使用

from price_data import OFFICIAL_PRICES, QIONGGEME_PRICES
from compare import compare_model

result = compare_model("gpt-4o")
print(f"节省 {result['saving_pct']}%")

更新价格数据

编辑 price_data.py,更新 OFFICIAL_PRICESQIONGGEME_PRICES,然后提 PR。

License

MIT


AI API Price Compare (English)

Compare API prices of mainstream AI models (Claude / GPT / Gemini / DeepSeek) between official providers and third-party relay services.

python compare.py                    # Compare all models
python compare.py gpt-4o             # Compare specific model
python compare.py --usage 1000000    # Estimate monthly savings

Price data sources: official pricing pages and qionggeme.

Why use a relay service even when prices are identical?

  1. Payment: Relay services accept Alipay/WeChat (official requires foreign credit card)
  2. Unified access: One API key for all models
  3. Network stability: Relay servers located in HK/mainland China
  4. OpenAI-compatible format: Migrate existing code with zero changes

License

MIT

About

对比主流 AI 模型(Claude/GPT/Gemini/DeepSeek)官方与中转站 API 价格的工具

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages