curl --request GET \
--url https://api-v2.requesty.ai/v1/manage/org/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-v2.requesty.ai/v1/manage/org/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-v2.requesty.ai/v1/manage/org/usage', 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-v2.requesty.ai/v1/manage/org/usage",
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-v2.requesty.ai/v1/manage/org/usage"
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-v2.requesty.ai/v1/manage/org/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.requesty.ai/v1/manage/org/usage")
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{
"usage": {}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}Get Organization Usage
Get aggregated usage statistics for your entire organization within a date range. Supports aggregation by different time periods and optional grouping by user, model, or custom fields.
curl --request GET \
--url https://api-v2.requesty.ai/v1/manage/org/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-v2.requesty.ai/v1/manage/org/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-v2.requesty.ai/v1/manage/org/usage', 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-v2.requesty.ai/v1/manage/org/usage",
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-v2.requesty.ai/v1/manage/org/usage"
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-v2.requesty.ai/v1/manage/org/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.requesty.ai/v1/manage/org/usage")
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{
"usage": {}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}{
"error": {
"origin": "router",
"message": "<string>"
}
}group_by fields: group_name, group_id, member_id, member_email, user_id, api_key_id, model_requested, model_used, provider_used, is_byok, origin_title, user_agent, api, finish_reason, status_code, extra.<field_name>, api_key_label.<label_key>, and group_label.<label_key>.
group_by=api returns one group per request type: chat, embedding, image, speech, transcription, or decision.
group_by=finish_reason returns one group per finish reason, such as stop, tool_calls or length. Coding agents send many tool_calls requests and one final stop per user prompt, so group_by=api_key_id&group_by=finish_reason&resolution=day gives prompts per key per day as the stop rows. Failed requests have an empty finish reason.
group_by=status_code returns one group per HTTP status code, with 0 for successful requests.
api_key_label.<label_key> or group_label.<label_key> to break down spend by the labels you set on API keys or groups — for example group_by=api_key_label.team groups usage by each key’s team label. Rows whose key or group is missing the label are grouped under Unknown.Query Parameters
Fields to group by: group_name, group_id, member_id, member_email, user_id, api_key_id, model_requested, model_used, provider_used, is_byok, origin_title, user_agent, api, finish_reason, status_code, extra.<field_name>, api_key_label.<label_key>, or group_label.<label_key>. Rows missing a requested label are grouped under "Unknown". Grouping by api returns one group per request type: chat, embedding, image, speech, transcription, or decision. Grouping by user_agent returns one group per client, taken from the User-Agent header with version numbers and parenthesised comments removed and lowercased (for example claude-cli/2.1.221 (external, cli) becomes claude-cli/). Grouping by finish_reason returns one group per finish reason, for example stop or tool_calls, so a coding agent turn that makes several tool calls and ends with stop can be counted by its stop rows. Grouping by status_code returns one group per HTTP status code, with 0 for successful requests. Grouping by finish_reason returns one group per finish reason, for example stop or tool_calls, so a coding agent turn that makes several tool calls and ends with stop can be counted by its stop rows. Grouping by status_code returns one group per HTTP status code, with 0 for successful requests. Can be specified multiple times.
Was this page helpful?