curl "https://api.ornnai.com/api/otpi/weight-class"from datetime import date, timedelta
import requests
end_date = date.today()
start_date = end_date - timedelta(days=30)
rows = requests.get(
"https://api.ornnai.com/api/otpi/weight-class",
params={"startDate": start_date.isoformat(), "endDate": end_date.isoformat()},
).json()["data"]
for r in rows:
print(r["date"], r["class"], r["indexPerMtok"])
const res = await fetch("https://api.ornnai.com/api/otpi/weight-class?class=open");
const { data } = await res.json();
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ornnai.com/api/otpi/weight-class",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.ornnai.com/api/otpi/weight-class"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ornnai.com/api/otpi/weight-class")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornnai.com/api/otpi/weight-class")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"access": "public-3mo",
"startDate": "2026-01-01",
"endDate": "2026-01-01",
"count": 2,
"data": [
{
"date": "2026-01-01",
"class": "closed",
"indexPerMtok": 1,
"labsPriced": 3
},
{
"date": "2026-01-01",
"class": "open",
"indexPerMtok": 1,
"labsPriced": 8
}
]
}{
"error": "Bad request",
"message": "Invalid GPU type. Allowed: H100 SXM, H200, A100 SXM4, B200, RTX PRO 6000 WS"
}{
"error": "Unauthorized",
"message": "API key required. Use Authorization: Bearer YOUR_API_KEY"
}Get the closed and open-source token price indexes
The Closed Source and Open Source Token Indexes: per weight class, the labs’ settled OTPI, each weighted by the tokens it priced that day, in USD per million tokens. Closed is anthropic, openai, google; open is deepseek, minimax, xiaomi, qwen, moonshotai, z-ai, mistralai, meta-llama.
With no dates, returns each class’s latest settled day. Without a key, the trailing 3 months: an earlier startDate is clamped to the window, and a range that ends before it returns 401. A Premium or Full key returns the complete history. A day on which a class could not be priced (a lab in it reported no volume on a day it normally does), and a closed day priced from fewer than all three closed labs, is omitted for that class, not returned as null or zero.
curl "https://api.ornnai.com/api/otpi/weight-class"from datetime import date, timedelta
import requests
end_date = date.today()
start_date = end_date - timedelta(days=30)
rows = requests.get(
"https://api.ornnai.com/api/otpi/weight-class",
params={"startDate": start_date.isoformat(), "endDate": end_date.isoformat()},
).json()["data"]
for r in rows:
print(r["date"], r["class"], r["indexPerMtok"])
const res = await fetch("https://api.ornnai.com/api/otpi/weight-class?class=open");
const { data } = await res.json();
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ornnai.com/api/otpi/weight-class",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.ornnai.com/api/otpi/weight-class"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ornnai.com/api/otpi/weight-class")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornnai.com/api/otpi/weight-class")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"access": "public-3mo",
"startDate": "2026-01-01",
"endDate": "2026-01-01",
"count": 2,
"data": [
{
"date": "2026-01-01",
"class": "closed",
"indexPerMtok": 1,
"labsPriced": 3
},
{
"date": "2026-01-01",
"class": "open",
"indexPerMtok": 1,
"labsPriced": 8
}
]
}{
"error": "Bad request",
"message": "Invalid GPU type. Allowed: H100 SXM, H200, A100 SXM4, B200, RTX PRO 6000 WS"
}{
"error": "Unauthorized",
"message": "API key required. Use Authorization: Bearer YOUR_API_KEY"
}Overview
The Closed Source and Open Source Token Indexes: per weight class, the labs’ settled OTPI, each weighted by the tokens it priced that day, in USD per million tokens. Returns each class’s latest settled day by default, or astartDate/endDate range; class limits the response to closed or open. Without a key, the trailing 3 months; a Premium or Full key returns the complete history. A day on which a class could not be priced is omitted for that class, not returned as null or zero. The response includes access: "public-3mo" | "premium" | "full".Query Parameters
closed or open. Omit for both. Any other value returns 400.
closed, open Inclusive start of a settlement-date range in YYYY-MM-DD. Use with endDate. Without a key, compute a date within the trailing 3 months at request time.
Inclusive end of a settlement-date range in YYYY-MM-DD. Use with startDate.
Response
One row per class per settled day, oldest first. labsPriced is how many labs in the class carried that day's value.

