无需鉴权,带 Access-Control-Allow-Origin: *,缓存 5 分钟。价格字段单位为「每百万 token」。
| 路径 | 内容 |
|---|---|
/api/v1/all.json | 全量快照(厂商、模型、供给方、价格、变动) |
/api/v1/models.json | 模型与官方价、规格 |
/api/v1/vendors.json | 模型厂商名录 |
/api/v1/offers.json | Token 供给方名录 |
/api/v1/prices.json | 逐模型逐供给方的报价明细 |
/api/v1/changes.json | 价格与供给变动日志 |
/llms.txt | 给大模型读的站点索引 |
curl -s https://kunlab.cn/api/v1/prices.json | head -c 400
写入接口与只读接口分离:只写入待复核队列,不会直接改价格;确认后才发布,并写入变动日志。
POST https://kunlab.cn/api/v1/corrections/public — 公开提交,限频(每 IP 每小时 5 次)
POST https://kunlab.cn/api/v1/corrections — 合作方接口,需请求头 X-KunLab-Key
curl -X POST https://kunlab.cn/api/v1/corrections/public \
-H 'Content-Type: application/json' \
-d '{"model":"claude-fable-5-2","offer":"ohmygpt","price_in":7.04,
"price_out":35.2,"currency":"USD","source_url":"https://example.com/pricing",
"note":"页面显示的输入价","contact":"you@example.com"}'
同一份 SQLite 真源,通过 MCP 以工具形式暴露给 AI 客户端(Claude Desktop / Cursor / 自建 agent)。
{
"mcpServers": {
"kunlab-directory": {
"command": "/srv/kunlab-directory/.venv/bin/python",
"args": ["/srv/kunlab-directory/scripts/mcp_server.py"]
}
}
}
工具:search_models · get_model · get_price · list_vendors · list_offers · price_index