curl --request GET \
--url https://data-api.compute-index.com/v2/llm/token/prices/metadata \
--header 'Authorization: Bearer <token>'import requests
url = "https://data-api.compute-index.com/v2/llm/token/prices/metadata"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://data-api.compute-index.com/v2/llm/token/prices/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://data-api.compute-index.com/v2/llm/token/prices/metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://data-api.compute-index.com/v2/llm/token/prices/metadata"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data-api.compute-index.com/v2/llm/token/prices/metadata")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data-api.compute-index.com/v2/llm/token/prices/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data_type": "prices",
"history_starts_at": "2020-01-01",
"data": {
"anchors": [
"<string>"
],
"price_unit": "usd_per_mtok",
"unit_family": "tokens",
"models": [
{
"canonical_model_id": "anthropic/claude-opus-4-8",
"lab": "anthropic",
"modality": "text",
"context_length": 200000,
"priced_metrics": 2,
"sources": 1
}
],
"vocabularies": {
"metric": [
"<string>"
],
"source": [
"<string>"
],
"price_type": [
"<string>"
],
"provider": [
"<string>"
],
"modality": [
"<string>"
],
"lab": [
"<string>"
],
"region": [
"<string>"
]
}
}
}{
"status": 401,
"title": "Unauthorized",
"detail": "Missing or invalid bearer token.",
"code": "unauthenticated",
"request_id": "01JQ2X8N4T6V9WZ0ABCD"
}{
"status": 403,
"title": "Forbidden",
"detail": "The token does not carry the scopes this endpoint requires.",
"code": "insufficient_entitlement",
"request_id": "01JQ2X8N4T6V9WZ0ABCD"
}{
"status": 404,
"title": "Not Found",
"detail": "No such resource, or none you are entitled to see.",
"code": "not_found",
"request_id": "01JQ2X8N4T6V9WZ0ABCD"
}{
"status": 422,
"title": "Unprocessable Content",
"detail": "A parameter failed validation.",
"code": "validation_failed",
"request_id": "01JQ2X8N4T6V9WZ0ABCD"
}{
"status": 429,
"title": "Too Many Requests",
"detail": "Rate limit exceeded; see the X-RateLimit-* headers.",
"code": "rate_limited",
"request_id": "01JQ2X8N4T6V9WZ0ABCD"
}Token Prices: Metadata
LLM inference prices per model, in USD per 1M tokens.
Returns the values you can filter this data by, what it covers, and how far back you are able to read it, in history_starts_at.
This is the best first call for any data type: it tells you what a query will accept before you write one. It is not paged.
curl --request GET \
--url https://data-api.compute-index.com/v2/llm/token/prices/metadata \
--header 'Authorization: Bearer <token>'import requests
url = "https://data-api.compute-index.com/v2/llm/token/prices/metadata"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://data-api.compute-index.com/v2/llm/token/prices/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://data-api.compute-index.com/v2/llm/token/prices/metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://data-api.compute-index.com/v2/llm/token/prices/metadata"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data-api.compute-index.com/v2/llm/token/prices/metadata")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data-api.compute-index.com/v2/llm/token/prices/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data_type": "prices",
"history_starts_at": "2020-01-01",
"data": {
"anchors": [
"<string>"
],
"price_unit": "usd_per_mtok",
"unit_family": "tokens",
"models": [
{
"canonical_model_id": "anthropic/claude-opus-4-8",
"lab": "anthropic",
"modality": "text",
"context_length": 200000,
"priced_metrics": 2,
"sources": 1
}
],
"vocabularies": {
"metric": [
"<string>"
],
"source": [
"<string>"
],
"price_type": [
"<string>"
],
"provider": [
"<string>"
],
"modality": [
"<string>"
],
"lab": [
"<string>"
],
"region": [
"<string>"
]
}
}
}{
"status": 401,
"title": "Unauthorized",
"detail": "Missing or invalid bearer token.",
"code": "unauthenticated",
"request_id": "01JQ2X8N4T6V9WZ0ABCD"
}{
"status": 403,
"title": "Forbidden",
"detail": "The token does not carry the scopes this endpoint requires.",
"code": "insufficient_entitlement",
"request_id": "01JQ2X8N4T6V9WZ0ABCD"
}{
"status": 404,
"title": "Not Found",
"detail": "No such resource, or none you are entitled to see.",
"code": "not_found",
"request_id": "01JQ2X8N4T6V9WZ0ABCD"
}{
"status": 422,
"title": "Unprocessable Content",
"detail": "A parameter failed validation.",
"code": "validation_failed",
"request_id": "01JQ2X8N4T6V9WZ0ABCD"
}{
"status": 429,
"title": "Too Many Requests",
"detail": "Rate limit exceeded; see the X-RateLimit-* headers.",
"code": "rate_limited",
"request_id": "01JQ2X8N4T6V9WZ0ABCD"
}Example
curl -H "Authorization: Bearer $TOKEN" \
"https://data-api.compute-index.com/v2/llm/token/prices/metadata?canonical_model_id=anthropic/claude-opus-4-8"
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
Successful Response
The data type this vocabulary describes.
"prices"
The caller's licensed history floor for this type, as an ISO date. Null means unrestricted — either the caller has no floor, or this type is a published series that is not floor-bound. Reported here so a client can discover its own entitlement in one call rather than by overshooting a window and reading the clamp.
"2020-01-01"
The token-prices vocabulary.
Lists currently priced models only. A model not priced since March is not
queryable state to hand a client — /history and /as-of still reach its
past.
Show child attributes
Show child attributes