curl "https://api.ornnai.com/api/otpi/hourly"import requests
rows = requests.get("https://api.ornnai.com/api/otpi/hourly").json()["data"]
for r in rows:
print(r["lab"], r["indexPerMtok"])
const res = await fetch("https://api.ornnai.com/api/otpi/hourly");
const { data } = await res.json();
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ornnai.com/api/otpi/hourly",
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/hourly"
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/hourly")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornnai.com/api/otpi/hourly")
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",
"capturedAt": "2026-11-15T03:00:12.104Z",
"count": 2,
"data": [
{
"capturedAt": "2026-11-15T03:00:12.104Z",
"windowStart": "2026-11-15T02:00:09.871Z",
"lab": "anthropic",
"indexPerMtok": 0.81,
"tokens": 14200000000,
"coverage": 0.97
},
{
"capturedAt": "2026-11-15T03:00:12.104Z",
"windowStart": "2026-11-15T02:00:09.871Z",
"lab": "openai",
"indexPerMtok": null,
"tokens": 9100000000,
"coverage": 0.42
}
]
}Get the hourly token price by lab
Hourly Ornn Token Price Index. Returns the latest window by default, one UTC date, or a startDate/endDate range. Each row covers the tokens traded between windowStart and capturedAt (about one hour) and carries lab, indexPerMtok, tokens, and coverage. A sample at 23:59:30 UTC closes each day and the next day’s first window starts there, so consecutive windows share an edge.
Windows start 2026-11-10 (UTC). Rows before that date keep the earlier method, the day-so-far price at each hourly sample, and have null windowStart, tokens, and coverage.
indexPerMtok is that window’s spend divided by its tokens, in USD per million tokens. It is null when priced tokens cover less than 80% of the window’s tokens, the same gate the settled index uses. The settled daily print stays on GET /api/otpi. Access matches that route: without a key, the free tier covers anthropic, openai, google, and deepseek for the trailing 3 months. A key unlocks all 11 labs and the full history. The response includes access: "public-3mo" | "premium" | "full".
curl "https://api.ornnai.com/api/otpi/hourly"import requests
rows = requests.get("https://api.ornnai.com/api/otpi/hourly").json()["data"]
for r in rows:
print(r["lab"], r["indexPerMtok"])
const res = await fetch("https://api.ornnai.com/api/otpi/hourly");
const { data } = await res.json();
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ornnai.com/api/otpi/hourly",
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/hourly"
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/hourly")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornnai.com/api/otpi/hourly")
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",
"capturedAt": "2026-11-15T03:00:12.104Z",
"count": 2,
"data": [
{
"capturedAt": "2026-11-15T03:00:12.104Z",
"windowStart": "2026-11-15T02:00:09.871Z",
"lab": "anthropic",
"indexPerMtok": 0.81,
"tokens": 14200000000,
"coverage": 0.97
},
{
"capturedAt": "2026-11-15T03:00:12.104Z",
"windowStart": "2026-11-15T02:00:09.871Z",
"lab": "openai",
"indexPerMtok": null,
"tokens": 9100000000,
"coverage": 0.42
}
]
}Overview
The hourly Ornn Token Price Index. Each row is one window, fromwindowStart to capturedAt (about an hour). A sample at 23:59:30 UTC closes each day and the next day’s first window starts there, so consecutive windows share an edge. Each row carries the lab, indexPerMtok, tokens, and coverage. Windows start 2026-11-10 (UTC). Rows before that date keep the earlier method, the day-so-far price at each hourly sample, and have null windowStart, tokens, and coverage.
indexPerMtok is the window’s spend divided by its tokens. It is null when priced tokens cover less than 80% of the window, the settled index’s gate. The settled daily print remains GET /api/otpi. Access is the same: without a key, anthropic, openai, google, and deepseek for the trailing 3 months. A Premium or Full key unlocks all 11 labs and the full history.Query Parameters
UTC day in YYYY-MM-DD. Returns every window captured that day. Omit it, and omit the range, for the latest window.
Inclusive start of a UTC-day window. Use with endDate.
Inclusive end of a UTC-day window. Use with startDate.
Filter to a single lab. Without a key, only anthropic, openai, google, and deepseek are available.
anthropic, openai, google, deepseek, minimax, xiaomi, qwen, moonshotai, z-ai, mistralai, meta-llama Response
Hourly window rows. The latest window carries a top-level capturedAt. A date query carries that date. A range carries startDate and endDate.

