/ 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

← 返回行情總表 · 價格變動日誌 →