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 & GenAI pricing data by LLMRates.ai
</a>請合理控制請求量。如需大流量或商業用途,請與我們聯絡。
