LLMRates.ai

API 与开发者

免费、只读的 JSON 接口,提供实时的 LLM 与 GenAI 价格数据 —— 无需 API key,无需注册。

无需 API key · 无需注册

基础 URL

https://www.llmrates.ai

接口列表

GET/api/models

列出并筛选模型及其当前价格,支持分页。

参数: provider, modality, minContext, maxInputPrice, hasCaching, hasBatch, sort, order, page, pageSize, currency

GET/api/models/{slug}

单个模型的完整详情,包含近期价格历史和相关模型。

GET/api/providers

所有在用的供应商及其模型数量。

GET/api/providers/{slug}

单个供应商及其在用模型列表与代表价格。

GET/api/compare

通过稳定 id(sid)最多并排对比 5 个模型。

参数: models (comma-separated sids, max 5), currency

GET/llms.txt

面向 LLM 与 AI 智能体的纯文本目录摘要。

所有查询参数均为可选。

快速开始

curl "https://www.llmrates.ai/api/models?provider=openai&sort=inputPrice&order=asc"

Model 响应结构

{
  "models": [
    {
      "id": number,
      "name": string,
      "slug": string,
      "family": string | null,
      "contextWindow": number | null,
      "maxOutput": number | null,
      "supportsTools": boolean,
      "supportsBatch": boolean,
      "supportsCaching": boolean,
      "deprecatedAt": string | null,        // ISO 8601
      "provider": { "name": string, "slug": string, "providerType": string, "baseUrl": string | null },
      "modalities": string[],               // e.g. ["text", "image"]
      "price": PriceRow | null,             // headline price in the requested currency
      "prices": PriceRow[]                  // every tier / region
    }
  ],
  "pagination": { "page": number, "pageSize": number, "total": number, "totalPages": number }
}

// PriceRow (per 1M tokens unless the field name says otherwise)
{
  "inputPricePerMillion": number | null,
  "outputPricePerMillion": number | null,
  "cachedInputPricePerMillion": number | null,
  "processingTier": "standard" | "batch" | "fast",
  "region": string | null,
  "priceUnit": string,                      // currency the row was sourced in
  "sourceUrl": string | null,
  "verifiedAt": string | null               // ISO 8601
}

缓存与时效

每个接口都经过边缘缓存,并在每次价格抓取后不久刷新,因此响应数据可能有几分钟的延迟。每个响应都包含 Cache-Control 头。

署名

数据可免费使用。如果它对你的项目有帮助,欢迎链接回 LLMRates.ai —— 这有助于数据持续开放与更新。

<a href="https://www.llmrates.ai" target="_blank" rel="noopener">
  LLM &amp; GenAI pricing data by LLMRates.ai
</a>

请合理控制请求量。如需大流量或商业用途,请与我们联系。