curl --request GET \
--url https://revise.io/api/v1/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://revise.io/api/v1/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://revise.io/api/v1/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://revise.io/api/v1/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://revise.io/api/v1/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://revise.io/api/v1/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://revise.io/api/v1/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{
"start": "2026-09-06T00:00:00Z",
"end": "2026-09-08T00:00:00Z",
"time_basis": "completed_at",
"bucket": "day",
"group_by": [
"metadata.customer"
],
"totals": {
"request_count": 5,
"tool_cpu_seconds": "5.000000",
"inference_usage": {
"input_tokens": 6000,
"cached_input_tokens": 2000,
"cache_creation_input_tokens": 0,
"output_tokens": 1000,
"web_search_requests_by_unit": {
"calls": 5,
"queries": 0,
"grounded_prompts": 0
}
},
"cost": {
"total_usd": "0.305000000",
"itemized": {
"base_fee_usd": "0.250000000",
"cpu_fee_usd": "0.005000000",
"inference_fee_usd": "0.050000000"
}
}
},
"data": [
{
"bucket_start": "2026-09-06T00:00:00Z",
"bucket_end": "2026-09-07T00:00:00Z",
"dimensions": {
"metadata.customer": "acme"
},
"request_count": 2,
"tool_cpu_seconds": "2.000000",
"inference_usage": {
"input_tokens": 2400,
"cached_input_tokens": 800,
"cache_creation_input_tokens": 0,
"output_tokens": 400,
"web_search_requests_by_unit": {
"calls": 2,
"queries": 0,
"grounded_prompts": 0
}
},
"cost": {
"total_usd": "0.122000000",
"itemized": {
"base_fee_usd": "0.100000000",
"cpu_fee_usd": "0.002000000",
"inference_fee_usd": "0.020000000"
}
}
},
{
"bucket_start": "2026-09-07T00:00:00Z",
"bucket_end": "2026-09-08T00:00:00Z",
"dimensions": {
"metadata.customer": "acme"
},
"request_count": 3,
"tool_cpu_seconds": "3.000000",
"inference_usage": {
"input_tokens": 3600,
"cached_input_tokens": 1200,
"cache_creation_input_tokens": 0,
"output_tokens": 600,
"web_search_requests_by_unit": {
"calls": 3,
"queries": 0,
"grounded_prompts": 0
}
},
"cost": {
"total_usd": "0.183000000",
"itemized": {
"base_fee_usd": "0.150000000",
"cpu_fee_usd": "0.003000000",
"inference_fee_usd": "0.030000000"
}
}
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Get usage
Account-scoped, receipt-based aggregation by completion time, including succeeded, failed and cancelled requests with settled receipts; pending requests are excluded. Filters combine with AND. No document, comment, prompt, artifact, supplier-cost or margin data is read or returned. Totals cover the entire filtered interval and reconcile with receipt charges, not current rates. Model/provider dimensions describe the requested configuration. No implied blended rates are returned. Money uses exact decimal strings. Rows sort by bucket then dimensions; each request contributes once. More than 1000 rows returns 422 with no partial report: narrow filters/range, reduce dimensions or use coarser buckets. Queries time out after five seconds (503). Reports use one database statement snapshot; no snapshot cursor or pagination. Fixed past completion windows stabilize once settled; future/open windows grow as requests finish. Unknown, empty or repeated parameters return 400; empty metadata filter values are allowed.
curl --request GET \
--url https://revise.io/api/v1/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://revise.io/api/v1/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://revise.io/api/v1/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://revise.io/api/v1/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://revise.io/api/v1/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://revise.io/api/v1/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://revise.io/api/v1/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{
"start": "2026-09-06T00:00:00Z",
"end": "2026-09-08T00:00:00Z",
"time_basis": "completed_at",
"bucket": "day",
"group_by": [
"metadata.customer"
],
"totals": {
"request_count": 5,
"tool_cpu_seconds": "5.000000",
"inference_usage": {
"input_tokens": 6000,
"cached_input_tokens": 2000,
"cache_creation_input_tokens": 0,
"output_tokens": 1000,
"web_search_requests_by_unit": {
"calls": 5,
"queries": 0,
"grounded_prompts": 0
}
},
"cost": {
"total_usd": "0.305000000",
"itemized": {
"base_fee_usd": "0.250000000",
"cpu_fee_usd": "0.005000000",
"inference_fee_usd": "0.050000000"
}
}
},
"data": [
{
"bucket_start": "2026-09-06T00:00:00Z",
"bucket_end": "2026-09-07T00:00:00Z",
"dimensions": {
"metadata.customer": "acme"
},
"request_count": 2,
"tool_cpu_seconds": "2.000000",
"inference_usage": {
"input_tokens": 2400,
"cached_input_tokens": 800,
"cache_creation_input_tokens": 0,
"output_tokens": 400,
"web_search_requests_by_unit": {
"calls": 2,
"queries": 0,
"grounded_prompts": 0
}
},
"cost": {
"total_usd": "0.122000000",
"itemized": {
"base_fee_usd": "0.100000000",
"cpu_fee_usd": "0.002000000",
"inference_fee_usd": "0.020000000"
}
}
},
{
"bucket_start": "2026-09-07T00:00:00Z",
"bucket_end": "2026-09-08T00:00:00Z",
"dimensions": {
"metadata.customer": "acme"
},
"request_count": 3,
"tool_cpu_seconds": "3.000000",
"inference_usage": {
"input_tokens": 3600,
"cached_input_tokens": 1200,
"cache_creation_input_tokens": 0,
"output_tokens": 600,
"web_search_requests_by_unit": {
"calls": 3,
"queries": 0,
"grounded_prompts": 0
}
},
"cost": {
"total_usd": "0.183000000",
"itemized": {
"base_fee_usd": "0.150000000",
"cpu_fee_usd": "0.003000000",
"inference_fee_usd": "0.030000000"
}
}
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}TypeScript
import { ReviseClient } from "@reviseio/api";
const revise = new ReviseClient({ apiKey: process.env.REVISE_API_KEY! });
const result = await revise.usage.get({ start: "2026-09-01T00:00:00Z", end: "2026-10-01T00:00:00Z" });
Authorizations
Revise API key from https://revise.io/console/api-keys. Send Authorization: Bearer .
Query Parameters
Inclusive completion time. Defaults to 30 days before end. RFC3339 timezone required.
Exclusive completion time. Defaults to now. Range must be positive and at most 366 days; hourly ranges at most 31 days.
UTC calendar buckets, or no time bucketing. Empty time buckets are omitted.
hour, day, month, none Comma-separated distinct dimensions, maximum three: api_key_id, provider, model, status, document_access, pricing_version, metadata.KEY (KEY 1–64 bytes). Missing values form null groups. Example: api_key_id,metadata.customer.
succeeded, failed, cancelled Exact conv_ ID.
Exact key_ ID of the submitting key. Older unattributed prompts do not match.
Exact AND matches, e.g. metadata[customer]=Acme. Keys up to 64 bytes; values up to 512 bytes.
Show child attributes
Show child attributes
Exact requested provider. Gemini uses the public name gemini.
openai, anthropic, xai, gemini Exact requested model ID; use with provider to disambiguate.
256Exact admitted document permission; not inferred from tool behavior.
read, comment, edit Exact pricing version pinned at admission.
256Response
Complete filtered usage report
"2026-09-06T00:00:00Z"
"2026-09-08T00:00:00Z"
"completed_at"
hour, day, month, none "day"
3["metadata.customer"]
Show child attributes
Show child attributes
{
"request_count": 5,
"tool_cpu_seconds": "5.000000",
"inference_usage": {
"input_tokens": 6000,
"cached_input_tokens": 2000,
"cache_creation_input_tokens": 0,
"output_tokens": 1000,
"web_search_requests_by_unit": {
"calls": 5,
"queries": 0,
"grounded_prompts": 0
}
},
"cost": {
"total_usd": "0.305000000",
"itemized": {
"base_fee_usd": "0.250000000",
"cpu_fee_usd": "0.005000000",
"inference_fee_usd": "0.050000000"
}
}
}
1000Show child attributes
Show child attributes
[
{
"bucket_start": "2026-09-06T00:00:00Z",
"bucket_end": "2026-09-07T00:00:00Z",
"dimensions": { "metadata.customer": "acme" },
"request_count": 2,
"tool_cpu_seconds": "2.000000",
"inference_usage": {
"input_tokens": 2400,
"cached_input_tokens": 800,
"cache_creation_input_tokens": 0,
"output_tokens": 400,
"web_search_requests_by_unit": {
"calls": 2,
"queries": 0,
"grounded_prompts": 0
}
},
"cost": {
"total_usd": "0.122000000",
"itemized": {
"base_fee_usd": "0.100000000",
"cpu_fee_usd": "0.002000000",
"inference_fee_usd": "0.020000000"
}
}
},
{
"bucket_start": "2026-09-07T00:00:00Z",
"bucket_end": "2026-09-08T00:00:00Z",
"dimensions": { "metadata.customer": "acme" },
"request_count": 3,
"tool_cpu_seconds": "3.000000",
"inference_usage": {
"input_tokens": 3600,
"cached_input_tokens": 1200,
"cache_creation_input_tokens": 0,
"output_tokens": 600,
"web_search_requests_by_unit": {
"calls": 3,
"queries": 0,
"grounded_prompts": 0
}
},
"cost": {
"total_usd": "0.183000000",
"itemized": {
"base_fee_usd": "0.150000000",
"cpu_fee_usd": "0.003000000",
"inference_fee_usd": "0.030000000"
}
}
}
]