curl --request GET \
--url https://api.aireserve.com/v1/customers/{customerId}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aireserve.com/v1/customers/{customerId}/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.aireserve.com/v1/customers/{customerId}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"customer_id": "<string>",
"period": {
"start": "<string>",
"end": "<string>"
},
"currency": "USD",
"has_pricing_rules": true,
"truncated": true,
"group_by": "feature",
"groups": [
{
"requests": 4503599627370495,
"prompt_tokens": 4503599627370495,
"completion_tokens": 4503599627370495,
"cost_usd": "<string>",
"priced": true,
"feature": "<string>",
"day": "<string>",
"billable_usd": "<string>",
"margin_usd": "<string>",
"margin_pct": 123
}
],
"totals": {
"requests": 4503599627370495,
"prompt_tokens": 4503599627370495,
"completion_tokens": 4503599627370495,
"cost_usd": "<string>",
"priced": true,
"billable_usd": "<string>",
"margin_usd": "<string>",
"margin_pct": 123
},
"monthly_flat_charges": [
{
"month": "<string>",
"day": "<string>",
"amount_usd": "<string>"
}
]
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
}
}Usage for one end customer, by feature or day
The same figures for a single end customer, broken down by the x-aireserve-feature tag (default) or by UTC day — the call to make when a customer asks what they owe. Customer ids are opaque: an id you have never tagged simply returns zeros, so ids cannot be probed.
curl --request GET \
--url https://api.aireserve.com/v1/customers/{customerId}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aireserve.com/v1/customers/{customerId}/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.aireserve.com/v1/customers/{customerId}/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"customer_id": "<string>",
"period": {
"start": "<string>",
"end": "<string>"
},
"currency": "USD",
"has_pricing_rules": true,
"truncated": true,
"group_by": "feature",
"groups": [
{
"requests": 4503599627370495,
"prompt_tokens": 4503599627370495,
"completion_tokens": 4503599627370495,
"cost_usd": "<string>",
"priced": true,
"feature": "<string>",
"day": "<string>",
"billable_usd": "<string>",
"margin_usd": "<string>",
"margin_pct": 123
}
],
"totals": {
"requests": 4503599627370495,
"prompt_tokens": 4503599627370495,
"completion_tokens": 4503599627370495,
"cost_usd": "<string>",
"priced": true,
"billable_usd": "<string>",
"margin_usd": "<string>",
"margin_pct": 123
},
"monthly_flat_charges": [
{
"month": "<string>",
"day": "<string>",
"amount_usd": "<string>"
}
]
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
}
}Authorizations
Your AI Reserve API key (aireserve_api_…) from the API Keys page in the portal (https://portal.aireserve.com/keys).
Path Parameters
Your end-customer id, URL-encoded, exactly as tagged on requests (1–128 printable characters).
1 - 128Query Parameters
Inclusive start of the period: a UTC date (2026-10-01) or an RFC 3339 timestamp. Defaults to 30 days before end.
Exclusive end of the period: a UTC date or an RFC 3339 timestamp. Defaults to now. The period may span at most 92 days.
feature (default) or day.
feature, day Response
OK
The period the figures cover.
Show child attributes
Show child attributes
USD Whether at least one of your pricing rules applies to the period. When false, billable_usd and margin fields are omitted everywhere.
True when the period held more rows than one response carries and the cheapest were dropped. Narrow the period or query one customer.
feature, day Highest cost first for features; chronological for days. Empty for an unknown customer id.
Show child attributes
Show child attributes
Sum over the customer's usage in the period.
Show child attributes
Show child attributes
Monthly flat fees booked in the period, one per calendar month with matched usage. Already included in billable_usd.
Show child attributes
Show child attributes