API 与开发者
免费、只读的 JSON 接口,提供实时的 LLM 与 GenAI 价格数据 —— 无需 API key,无需注册。
无需 API key · 无需注册基础 URL
https://llmrates.ai接口列表
GET/api/models
列出并筛选模型及其当前价格,支持分页。
参数: provider, modality, minContext, maxInputPrice, hasCaching, hasBatch, sort, order, page, pageSize, currency
GET
/api/models/{slug}单个模型的完整详情,包含近期价格历史和相关模型。
所有在用的供应商及其模型数量。
GET
/api/providers/{slug}单个供应商及其在用模型列表与代表价格。
GET/llms.txt
面向 LLM 与 AI 智能体的纯文本目录摘要。
所有查询参数均为可选。
快速开始
curl "https://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 头。
免费使用
公开 API 对轻量使用、研究、原型、内部工具和开源项目免费开放。欢迎署名。
如需大流量使用、商业再分发、生产环境集成、SLA、历史数据或定制监控,请以获取商业方案。
署名
如果数据对你的项目有帮助,欢迎链接回 LLMRates.ai —— 这有助于数据持续开放与更新。
<a href="https://llmrates.ai" target="_blank" rel="noopener">
LLM & GenAI pricing data by LLMRates.ai
</a>开放数据集
更想要文件而非 API?同样的数据每天以 JSON 与 CSV 形式发布在我们 GitHub 上的开放数据集中(CC BY 4.0)。
