/ REST API

API 文档.

程序化查询 Pricemon 的价格数据:全部接口为 GET, 返回 UTF-8 JSON,无需鉴权。数据每 5–60 分钟可缓存(响应头 Cache-Control 标注)。

base-url

生产 (同源,与主站共用)

https://pricemon.net/api/…

生产 (API 子域,仅 /api/*)

https://api.pricemon.net/api/…

端点总览

方法 路径 说明
GET /api/meta 站点统计:总条数、厂商数、类别分布、最近核对日期
GET /api/prices 全部价格,支持 vendor / category / q / currency / reasoning / free 过滤
GET /api/prices/:slug 单模型详情,slug 即 modelId 的小写化(如 gpt-6-astra)
GET /api/vendors 厂商列表(含条目数与 logo 路径)
GET /api/categories 类别列表(含条目数)
GET /api/changes 价格变动日志(按日期倒序)

端点详情

GET /api/meta

站点统计:总条数、厂商数、类别分布、最近核对日期

示例响应

{
  "ok": true,
  "data": {
    "total": 146,
    "vendors": 17,
    "categories": 7,
    "byCategory": {
      "对话": 79,
      "图像生成": 23,
      "视频生成": 27
    },
    "updatedAt": "2026-09-04"
  }
}
GET /api/prices

全部价格,支持 vendor / category / q / currency / reasoning / free 过滤

Query 参数

参数 类型 说明
vendor string 按厂商精确过滤,如 OpenAI、DeepSeek
category string 按类别过滤:对话 / 图像生成 / 视频生成 / 语音合成 / 语音识别 / 音乐生成 / 3D 生成
q string 关键词搜索,匹配厂商 / 模型名 / modelId
currency string 币种过滤:CNY 或 USD
reasoning boolean true / false,仅返回支持深度思考(或不支持)的模型
free boolean true / false,仅返回免费(或不免费)的模型

示例响应

{
  "ok": true,
  "count": 1,
  "data": [
    {
      "vendor": "DeepSeek",
      "model": "DeepSeek-V4-Flash",
      "modelId": "deepseek-v4-flash",
      "slug": "deepseek-v4-flash",
      "category": "对话",
      "currency": "CNY",
      "unit": "百万 tokens",
      "input": 3,
      "output": 9,
      "cacheRead": 0.1,
      "context": 1000000,
      "maxOutput": 384000,
      "modalities": [
        "文本"
      ],
      "reasoning": true,
      "free": false,
      "batchOff": null,
      "tiers": null,
      "inputLabel": "¥3",
      "outputLabel": "¥9",
      "sourceUrl": "https://api-docs.deepseek.com/zh-cn/quick_start/pricing",
      "updatedAt": "2026-09-04",
      "note": "默认思考模式;空闲时段输入输出半价"
    }
  ]
}
GET /api/prices/:slug

单模型详情,slug 即 modelId 的小写化(如 gpt-6-astra)

示例响应

{
  "ok": true,
  "data": {
    "vendor": "OpenAI",
    "model": "GPT-6 Astra",
    "modelId": "gpt-6-astra",
    "slug": "gpt-6-astra",
    "category": "对话",
    "currency": "USD",
    "unit": "百万 tokens",
    "input": 10,
    "output": 50,
    "cacheRead": 1,
    "context": 1050000,
    "modalities": [
      "文本",
      "图像"
    ],
    "reasoning": true,
    "inputLabel": "$10",
    "outputLabel": "$50",
    "tiers": [
      {
        "label": "短上下文(输入≤272K)",
        "price": null,
        "input": 10,
        "output": 50,
        "note": "缓存输入 $1.00;cache writes $12.50"
      }
    ]
  }
}
GET /api/vendors

厂商列表(含条目数与 logo 路径)

示例响应

{
  "ok": true,
  "count": 17,
  "data": [
    {
      "name": "DeepSeek",
      "count": 2,
      "logo": "/logos/deepseek.png"
    },
    {
      "name": "OpenAI",
      "count": 29,
      "logo": "/logos/openai.png"
    }
  ]
}
GET /api/categories

类别列表(含条目数)

示例响应

{
  "ok": true,
  "count": 7,
  "data": [
    {
      "name": "对话",
      "count": 79
    },
    {
      "name": "视频生成",
      "count": 27
    }
  ]
}
GET /api/changes

价格变动日志(按日期倒序)

示例响应

{
  "ok": true,
  "count": 1,
  "data": [
    {
      "date": "2026-09-04",
      "title": "建站首轮全量核对(28 个模型 / 10 家厂商)",
      "tag": "基线",
      "items": [
        "DeepSeek 官方文档直采:V4-Flash 输入 3 / 输出 9(高峰,空闲半价)"
      ]
    }
  ]
}
rate-limit

频率限制

每个客户端默认限制为 一分钟内最多 50 次请求 (60 秒滑动窗口),按两类维度各自独立计数, 任一超限即拒绝:

  • IP 桶 — 客户端 IP(Cloudflare 回源时取 CF-Connecting-IP,否则取连接地址 / XFF)
  • 请求指纹桶 — IP + User-Agent + Accept-Language + Accept + Sec-CH-UA 的哈希,同一客户端换 UA / 头信息也无法绕开 IP 限额

超限时返回 429 Too Many Requests, 响应带 Retry-After(秒)与 X-RateLimit-* 头;正常响应同样携带 X-RateLimit-Limit / Remaining / Reset,请据此做客户端退避。

429 响应示例

HTTP/1.1 429 Too Many Requests
Retry-After: 37
X-RateLimit-Limit: 50
X-RateLimit-Remaining: 0

{
  "ok": false,
  "error": "rate limit exceeded: max 50 requests / 60s (per IP and request fingerprint), retry later"
}
errors

错误约定

失败响应统一为 { ok: false, error: "message" }, 并配合恰当的 HTTP 状态码:

404 model not found: xxx(slug 不存在)

429 rate limit exceeded: …(限流)

500 服务器内部错误

mcp

MCP Server(Agent 接入)

需要喂给 Claude / Cursor 等 Agent 时,可直接连 MCP: https://mcp.pricemon.net/mcp (Streamable HTTP)。工具包括 search_modelsget_model_pricecompare_priceslist_changes 等,详见仓库 README

← 返回行情总表 · 价格变动日志 →