curl "https://api.ornnai.com/api/otpi"import requests
rows = requests.get("https://api.ornnai.com/api/otpi").json()["data"]
for r in rows:
print(r["lab"], r["indexPerMtok"])
const res = await fetch("https://api.ornnai.com/api/otpi");
const { data } = await res.json();
<?php
$ch = curl_init("https://api.ornnai.com/api/otpi");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);
package main
import (
"io"
"net/http"
)
func main() {
endpoint := "https://api.ornnai.com/api/otpi"
req, _ := http.NewRequest("GET", endpoint, nil)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
_ = body
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(
URI.create("https://api.ornnai.com/api/otpi"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
require "net/http"
require "json"
uri = URI("https://api.ornnai.com/api/otpi")
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
{
"success": true,
"access": "public-1mo",
"date": "2026-01-01",
"count": 4,
"data": [
{
"date": "2026-01-01",
"lab": "anthropic",
"indexPerMtok": 1,
"computedAt": "2026-01-01T00:00:00.000Z"
},
{
"date": "2026-01-01",
"lab": "openai",
"indexPerMtok": 1,
"computedAt": "2026-01-01T00:00:00.000Z"
},
{
"date": "2026-01-01",
"lab": "google",
"indexPerMtok": 1,
"computedAt": "2026-01-01T00:00:00.000Z"
},
{
"date": "2026-01-01",
"lab": "deepseek",
"indexPerMtok": 1,
"computedAt": "2026-01-01T00:00:00.000Z"
}
]
}Get the latest token price index by lab
The Ornn Token Price Index (OTPI): a daily, volume-weighted blended price per million tokens for each major model lab. Returns the latest settled day by default, a specific date, or a startDate/endDate range. Use lab to filter to a single lab. Without a key, the free tier covers 4 labs — anthropic, openai, google, deepseek — for the trailing 1 month (the same free window on index.ornn.com); other labs and older history require an API key. The response includes access: "public-1mo" | "premium" | "full".
curl "https://api.ornnai.com/api/otpi"import requests
rows = requests.get("https://api.ornnai.com/api/otpi").json()["data"]
for r in rows:
print(r["lab"], r["indexPerMtok"])
const res = await fetch("https://api.ornnai.com/api/otpi");
const { data } = await res.json();
<?php
$ch = curl_init("https://api.ornnai.com/api/otpi");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);
package main
import (
"io"
"net/http"
)
func main() {
endpoint := "https://api.ornnai.com/api/otpi"
req, _ := http.NewRequest("GET", endpoint, nil)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
_ = body
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(
URI.create("https://api.ornnai.com/api/otpi"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
require "net/http"
require "json"
uri = URI("https://api.ornnai.com/api/otpi")
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
{
"success": true,
"access": "public-1mo",
"date": "2026-01-01",
"count": 4,
"data": [
{
"date": "2026-01-01",
"lab": "anthropic",
"indexPerMtok": 1,
"computedAt": "2026-01-01T00:00:00.000Z"
},
{
"date": "2026-01-01",
"lab": "openai",
"indexPerMtok": 1,
"computedAt": "2026-01-01T00:00:00.000Z"
},
{
"date": "2026-01-01",
"lab": "google",
"indexPerMtok": 1,
"computedAt": "2026-01-01T00:00:00.000Z"
},
{
"date": "2026-01-01",
"lab": "deepseek",
"indexPerMtok": 1,
"computedAt": "2026-01-01T00:00:00.000Z"
}
]
}Overview
The Ornn Token Price Index (OTPI): a daily, volume-weighted blended price per million tokens for each major model lab. Returns the latest settled day by default, a specificdate, or a startDate/endDate range. Use lab to filter to a single lab. Without a key, the free tier covers 4 labs - anthropic, openai, google, deepseek - for the trailing 1 month (the same free window on index.ornn.com); other labs and older history require an API key. The response includes access: "public-1mo" | "premium" | "full".Query Parameters
Settlement date in YYYY-MM-DD. Returns that single day. Omit it for the latest settled day, as shown in the runnable examples above. Anonymous callers must compute a recent date at request time because dates older than the trailing 1 month require a key.
Inclusive start of a settlement-date range in YYYY-MM-DD. Use with endDate. For a no-key request, compute a date within the trailing 1 month at request time (for example, 7 days ago); older history requires a key.
Inclusive end of a settlement-date range in YYYY-MM-DD. Use with startDate; compute a current or recent settled date at request time so anonymous examples remain inside the rolling public window.
Filter to a single lab. Without a key, only anthropic, openai, google, deepseek are available; other labs require an API key.
anthropic, openai, google, deepseek, minimax, xiaomi, qwen, moonshotai, z-ai, mistralai, meta-llama Response
OTPI values per lab. Single-day responses (the default, or with date) carry a top-level date; range responses (startDate/endDate) carry top-level startDate and endDate and no date.

