curl --request POST \
--url https://api.orbit.devotel.io/api/v1/billing/agent-usage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant-Id: <x-tenant-id>' \
--data '
{
"agent_id": "agent_01HZY8AGENT",
"model_id": "claude-sonnet-4.6",
"prompt_tokens": 1200,
"completion_tokens": 350,
"cache_read_tokens": 0,
"cache_creation_tokens": 0,
"conversation_id": "conv_01HZY8CONV",
"request_id": "req_01HZY8REQ"
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/billing/agent-usage"
payload = {
"agent_id": "agent_01HZY8AGENT",
"model_id": "claude-sonnet-4.6",
"prompt_tokens": 1200,
"completion_tokens": 350,
"cache_read_tokens": 0,
"cache_creation_tokens": 0,
"conversation_id": "conv_01HZY8CONV",
"request_id": "req_01HZY8REQ"
}
headers = {
"X-Tenant-Id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant-Id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
agent_id: 'agent_01HZY8AGENT',
model_id: 'claude-sonnet-4.6',
prompt_tokens: 1200,
completion_tokens: 350,
cache_read_tokens: 0,
cache_creation_tokens: 0,
conversation_id: 'conv_01HZY8CONV',
request_id: 'req_01HZY8REQ'
})
};
fetch('https://api.orbit.devotel.io/api/v1/billing/agent-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.orbit.devotel.io/api/v1/billing/agent-usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => 'agent_01HZY8AGENT',
'model_id' => 'claude-sonnet-4.6',
'prompt_tokens' => 1200,
'completion_tokens' => 350,
'cache_read_tokens' => 0,
'cache_creation_tokens' => 0,
'conversation_id' => 'conv_01HZY8CONV',
'request_id' => 'req_01HZY8REQ'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant-Id: <x-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orbit.devotel.io/api/v1/billing/agent-usage"
payload := strings.NewReader("{\n \"agent_id\": \"agent_01HZY8AGENT\",\n \"model_id\": \"claude-sonnet-4.6\",\n \"prompt_tokens\": 1200,\n \"completion_tokens\": 350,\n \"cache_read_tokens\": 0,\n \"cache_creation_tokens\": 0,\n \"conversation_id\": \"conv_01HZY8CONV\",\n \"request_id\": \"req_01HZY8REQ\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant-Id", "<x-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.orbit.devotel.io/api/v1/billing/agent-usage")
.header("X-Tenant-Id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"agent_01HZY8AGENT\",\n \"model_id\": \"claude-sonnet-4.6\",\n \"prompt_tokens\": 1200,\n \"completion_tokens\": 350,\n \"cache_read_tokens\": 0,\n \"cache_creation_tokens\": 0,\n \"conversation_id\": \"conv_01HZY8CONV\",\n \"request_id\": \"req_01HZY8REQ\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/billing/agent-usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant-Id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"agent_01HZY8AGENT\",\n \"model_id\": \"claude-sonnet-4.6\",\n \"prompt_tokens\": 1200,\n \"completion_tokens\": 350,\n \"cache_read_tokens\": 0,\n \"cache_creation_tokens\": 0,\n \"conversation_id\": \"conv_01HZY8CONV\",\n \"request_id\": \"req_01HZY8REQ\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"billed": true,
"credits": 42,
"tokens_used": 1550,
"model_id": "claude-sonnet-4.6",
"fell_back": false,
"estimated_cost_usd": 0.0042
},
"meta": {
"request_id": "req_01HZY8EXAMPLE",
"timestamp": "2026-08-02T12:00:00.000Z"
}
}Report AI agent usage
Internal service-to-service endpoint (agent-runtime to billing) that meters an AI-agent invocation against the tenant’s prepaid wallet. Authenticated with a signed internal token, not a developer API key, so it is not callable with public credentials. Resolves the X-Tenant-Id header against the organization record, reserves and deducts balance for the reported usage, and writes a per-debit audit entry.
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/billing/agent-usage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant-Id: <x-tenant-id>' \
--data '
{
"agent_id": "agent_01HZY8AGENT",
"model_id": "claude-sonnet-4.6",
"prompt_tokens": 1200,
"completion_tokens": 350,
"cache_read_tokens": 0,
"cache_creation_tokens": 0,
"conversation_id": "conv_01HZY8CONV",
"request_id": "req_01HZY8REQ"
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/billing/agent-usage"
payload = {
"agent_id": "agent_01HZY8AGENT",
"model_id": "claude-sonnet-4.6",
"prompt_tokens": 1200,
"completion_tokens": 350,
"cache_read_tokens": 0,
"cache_creation_tokens": 0,
"conversation_id": "conv_01HZY8CONV",
"request_id": "req_01HZY8REQ"
}
headers = {
"X-Tenant-Id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant-Id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
agent_id: 'agent_01HZY8AGENT',
model_id: 'claude-sonnet-4.6',
prompt_tokens: 1200,
completion_tokens: 350,
cache_read_tokens: 0,
cache_creation_tokens: 0,
conversation_id: 'conv_01HZY8CONV',
request_id: 'req_01HZY8REQ'
})
};
fetch('https://api.orbit.devotel.io/api/v1/billing/agent-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.orbit.devotel.io/api/v1/billing/agent-usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => 'agent_01HZY8AGENT',
'model_id' => 'claude-sonnet-4.6',
'prompt_tokens' => 1200,
'completion_tokens' => 350,
'cache_read_tokens' => 0,
'cache_creation_tokens' => 0,
'conversation_id' => 'conv_01HZY8CONV',
'request_id' => 'req_01HZY8REQ'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant-Id: <x-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orbit.devotel.io/api/v1/billing/agent-usage"
payload := strings.NewReader("{\n \"agent_id\": \"agent_01HZY8AGENT\",\n \"model_id\": \"claude-sonnet-4.6\",\n \"prompt_tokens\": 1200,\n \"completion_tokens\": 350,\n \"cache_read_tokens\": 0,\n \"cache_creation_tokens\": 0,\n \"conversation_id\": \"conv_01HZY8CONV\",\n \"request_id\": \"req_01HZY8REQ\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant-Id", "<x-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.orbit.devotel.io/api/v1/billing/agent-usage")
.header("X-Tenant-Id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"agent_01HZY8AGENT\",\n \"model_id\": \"claude-sonnet-4.6\",\n \"prompt_tokens\": 1200,\n \"completion_tokens\": 350,\n \"cache_read_tokens\": 0,\n \"cache_creation_tokens\": 0,\n \"conversation_id\": \"conv_01HZY8CONV\",\n \"request_id\": \"req_01HZY8REQ\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/billing/agent-usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant-Id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"agent_01HZY8AGENT\",\n \"model_id\": \"claude-sonnet-4.6\",\n \"prompt_tokens\": 1200,\n \"completion_tokens\": 350,\n \"cache_read_tokens\": 0,\n \"cache_creation_tokens\": 0,\n \"conversation_id\": \"conv_01HZY8CONV\",\n \"request_id\": \"req_01HZY8REQ\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"billed": true,
"credits": 42,
"tokens_used": 1550,
"model_id": "claude-sonnet-4.6",
"fell_back": false,
"estimated_cost_usd": 0.0042
},
"meta": {
"request_id": "req_01HZY8EXAMPLE",
"timestamp": "2026-08-02T12:00:00.000Z"
}
}Authorizations
Dashboard JWT token from Clerk
Headers
Tenant id the usage is billed against; validated against the organization record.
Body
Identifier of the AI agent that produced the usage.
Model that served the turn; when omitted a baseline rate is applied.
Input tokens for the turn.
x >= 0Output tokens for the turn.
x >= 0x >= 0x >= 0Legacy blended token count; used only when the split token fields are absent.
x >= 0