curl --request GET \
--url https://api.omnara.com/v1/orgs/{orgID}/usage/timeseries \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omnara.com/v1/orgs/{orgID}/usage/timeseries"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omnara.com/v1/orgs/{orgID}/usage/timeseries', 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://api.omnara.com/v1/orgs/{orgID}/usage/timeseries",
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://api.omnara.com/v1/orgs/{orgID}/usage/timeseries"
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://api.omnara.com/v1/orgs/{orgID}/usage/timeseries")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnara.com/v1/orgs/{orgID}/usage/timeseries")
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{
"metric": "sum_tokens",
"interval": "hour",
"timezone": "<string>",
"bucket_starts": [
"2023-11-07T05:31:56Z"
],
"until": "2023-11-07T05:31:56Z",
"totals": {
"model_calls": 1,
"tokens": {
"input_tokens_total": 1,
"uncached_input_tokens": 1,
"cache_read_input_tokens": 1,
"cache_write_input_tokens": 1,
"output_tokens_total": 1,
"reasoning_output_tokens": 1
},
"cost": {
"provider_reported_usd": "<string>",
"model_calls_with_reported_cost": 1
}
},
"active_agents": 1,
"series": [
{
"kind": "all",
"total": 1,
"values": [
1
],
"id": "<string>",
"name": "<string>",
"model_provider_config_name": "<string>",
"project_name": "<string>"
}
],
"group_by": "model"
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Get usage timeseries
Buckets model usage over time for one metric, optionally broken down by configured model or agent profile. Covers every project the caller can read in the organization; project_ids and agent_profile_ids narrow that scope. Buckets are calendar days, weeks (starting Monday), or months in timezone.
curl --request GET \
--url https://api.omnara.com/v1/orgs/{orgID}/usage/timeseries \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omnara.com/v1/orgs/{orgID}/usage/timeseries"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omnara.com/v1/orgs/{orgID}/usage/timeseries', 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://api.omnara.com/v1/orgs/{orgID}/usage/timeseries",
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://api.omnara.com/v1/orgs/{orgID}/usage/timeseries"
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://api.omnara.com/v1/orgs/{orgID}/usage/timeseries")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnara.com/v1/orgs/{orgID}/usage/timeseries")
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{
"metric": "sum_tokens",
"interval": "hour",
"timezone": "<string>",
"bucket_starts": [
"2023-11-07T05:31:56Z"
],
"until": "2023-11-07T05:31:56Z",
"totals": {
"model_calls": 1,
"tokens": {
"input_tokens_total": 1,
"uncached_input_tokens": 1,
"cache_read_input_tokens": 1,
"cache_write_input_tokens": 1,
"output_tokens_total": 1,
"reasoning_output_tokens": 1
},
"cost": {
"provider_reported_usd": "<string>",
"model_calls_with_reported_cost": 1
}
},
"active_agents": 1,
"series": [
{
"kind": "all",
"total": 1,
"values": [
1
],
"id": "<string>",
"name": "<string>",
"model_provider_config_name": "<string>",
"project_name": "<string>"
}
],
"group_by": "model"
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"current_digest": "<string>",
"issues": [
{
"path": "<string>",
"message": "<string>",
"line": 2,
"column": 2
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
An opaque Omnara personal or organization bearer token.
Path Parameters
^org_[a-z2-7]{26}$Query Parameters
Only tally model calls started at or after this instant. Omit to start from the earliest recorded call.
Only tally model calls started before this instant. Must be later than since when both are given. Omit to include calls up to now.
IANA time zone that decides where each bucket starts.
64Bucket width. Omit to pick one from the window length: days up to 92 days, weeks up to 730 days, months beyond. Hourly buckets are used only when requested. The window may span at most 400 buckets.
hour, day, week, month Value plotted in each bucket. Defaults to sum_tokens.
sum_tokens is input plus output tokens. sum_cost is provider-reported cost in USD. count_model_calls counts model calls that recorded usage.
sum_tokens, sum_input_tokens, sum_output_tokens, sum_cost, count_model_calls Break the metric down into one series per group. Omit for a single series.
model, profile With group_by, how many groups get their own series, ranked by the metric. The rest are folded into one other series.
1 <= x <= 20Only count usage from these projects.
1 - 100 elements^proj_[a-z2-7]{26}$Only count usage from top-level agents launched from these agent profiles.
1 - 100 elements^aprf_[a-z2-7]{26}$With agent_profile_ids, also count usage from subagents spawned by those agents.
Response
Usage timeseries.
sum_tokens is input plus output tokens. sum_cost is provider-reported cost in USD. count_model_calls counts model calls that recorded usage.
sum_tokens, sum_input_tokens, sum_output_tokens, sum_cost, count_model_calls hour, day, week, month IANA time zone the buckets follow.
Start of each bucket in timezone, oldest first, including buckets without usage. The first bucket starts at the beginning of the interval containing since, but only usage at or after since counts.
End of the window; usage at or after this instant is excluded.
All usage in the window, regardless of metric and group_by.
Show child attributes
Show child attributes
Agents, not counting subagents, that made at least one model call in the window.
x >= 0Without group_by, a single all series. With it, one series per ranked group, most first, then an other series when usage remains.
Show child attributes
Show child attributes
model, profile