使用此端点可以列出当前对外可见的活跃模型定价信息。
如需查看某个模型的完整定价详情,包括结构化定价和溯源信息,请优先使用 获取模型定价。
查询参数
可选的提供方筛选,例如 openai、anthropic 或 google。
可选的模型标签筛选,例如 chat、image、video、embedding 或 translation。
定价条目数组。每一项包括 model、provider、is_lock_price、capabilities、aliases,以及上方交互式 schema 返回的公开标量或结构化定价摘要字段。
curl "https://api.tokenlab.sh/v1/pricing?provider=openai&tag=chat" \
-H "Authorization: Bearer sk-your-api-key"
import requests
response = requests.get(
"https://api.tokenlab.sh/v1/pricing",
headers={"Authorization": "Bearer sk-your-api-key"},
params={"provider": "openai", "tag": "chat"}
)
print(response.json())
const response = await fetch(
'https://api.tokenlab.sh/v1/pricing?provider=openai&tag=chat',
{
headers: { 'Authorization': 'Bearer sk-your-api-key' }
}
);
const data = await response.json();
console.log(data);
package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.tokenlab.sh/v1/pricing?provider=openai&tag=chat", nil)
req.Header.Set("Authorization", "Bearer sk-your-api-key")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
<?php
$ch = curl_init('https://api.tokenlab.sh/v1/pricing?provider=openai&tag=chat');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer sk-your-api-key'
]
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
{
"object": "pricing",
"updated_at": "2026-04-20T00:00:00.000Z",
"currency": "USD",
"data": [
{
"model": "gpt-4o",
"provider": "openai",
"is_lock_price": false,
"capabilities": ["chat"],
"aliases": ["gpt-4o-latest"],
"pricing": {
"input_per_1m": "2.50",
"output_per_1m": "10.00",
"per_request": null,
"is_lock_price": false,
"currency": "USD"
}
}
]
}
使用上面的交互式 OpenAPI 面板获取确切的响应 schema。公开定价条目也可能暴露 lock_price_per_request、has_complex_pricing、supported_operations、pricing_summary 和 pricing_provenance。