LLM Price Compare public API · 只读 JSON · 无需鉴权 · CORS 全开放 · 数据来源 OpenRouter,每日抓取(北京时间 04:17)并增量写入 Cloudflare D1。
https://llm-price-compare-b25.pages.devrequest / image / web_search 为美元 / 次。openai/gpt-4o),也可传模糊名称(如 gpt、claude opus、deepseek)。模糊匹配会优先本周热门、较新的、非变体(:free/:batch)模型;响应中的 resolved_id 和 alternatives 告诉你实际匹配到哪个。Cache-Control: max-age=300,边缘缓存约 5 分钟,新一次抓取写入后约 30 秒内自动换新(缓存键包含数据版本)。加 ?pretty 输出缩进 JSON。| 接口 | 说明 |
|---|---|
GET /api/meta | 最近一次抓取时间、模型/报价/供应商数量、单位 |
GET /api/models?q=&vendor=&limit=&offset= | 搜索模型(模糊),返回每个模型各项最低价及对应供应商 |
GET /api/models/{id} | 单个模型详情 + 全部供应商报价(输入/输出/缓存读/缓存写、量化、上下文、最大输出、可用率、阶梯价) |
GET /api/compare?ids=a,b,c | 并排对比,每个模型给出最便宜的供应商(按 workload 计算) |
GET /api/cost?ids=..&input=&output=&cache_hit= | 费用估算:每个模型每个供应商的费用,从低到高 |
GET /api/rankings?period=week | OpenRouter 热门排行:week / day / month / trending |
GET /api/history/{id} | 价格变动记录(旧值 → 新值) |
GET /api/runs | 抓取任务记录(新增/变更/删除/未变) |
GET /api/all | 网站使用的完整数据(较大) |
curl 'BASE/api/models?q=claude%20opus&limit=3&pretty'
curl 'BASE/api/models/deepseek/deepseek-v4.1-flash' curl 'BASE/api/models/gpt' # 模糊匹配
curl 'BASE/api/compare?ids=gpt,claude%20opus,deepseek'
curl 'BASE/api/cost?ids=gpt,claude%20opus&input=10m&output=1m&cache_hit=0.6'
费用公式:input×(1−cache_hit)×输入价 + input×cache_hit×缓存读取价(无则用输入价) + output×输出价,未计入缓存写入、推理 token 单独计费、请求/图片附加费及长上下文阶梯价。
curl 'BASE/api/rankings?period=week'
curl 'BASE/api/history/openai/gpt-4o'
cheapest.input 等 | 该模型所有供应商中该项的最低价 {price, provider} |
providers[] | provider, tag, quantization, context_length, max_output, input, output, cache_read, cache_write, cache_write_1h, reasoning, request, image, web_search, tiers, uptime_1d, uptime_30m, status |
variable_pricing | 路由类模型(如 openrouter/auto),价格随实际路由变化,无固定价 |
tiers | 长上下文阶梯价(min_prompt_tokens 以上适用) |
hot_rank_week | OpenRouter 本周 token 用量排名(前 10) |
Go CLI llmprice:llmprice search claude、llmprice compare gpt "claude opus" deepseek、llmprice cost gpt --input 10m --output 1m --cache-hit 0.5、llmprice top、llmprice history gpt-4o,加 --json 输出原始 JSON。
非 OpenRouter 官方服务。价格以 OpenRouter 实时为准。