List rollup
Answers the caller's month: what their plan includes, what has been consumed against it, and the wallet beside it.
GET /v1/billing/usage/rollup
| Address | https://api.hanzo.ai/v1/billing/usage/rollup |
| Method | GET |
| Operation | get_billing_usage_rollup |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Answers the caller's month: what their plan includes, what has been consumed against it, and the wallet beside it.
The two blocks are SEPARATE monies and are never added. One is usage a plan granted; the other is prepaid credit bought with a card. Their sum is not a number anyone holds, and a reader that formed it would be inventing a balance.
A named handler, not a closure, so zipdoc can lift this prose into the registry.
Request
GET /v1/billing/usage/rollup takes no parameters and no body — the credential is the whole request.
Response
| Status | Body | Meaning |
|---|---|---|
200 | billing.Rollup | ok |
default | problem-details | refused |
200 body — 15 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
balance | body | billing.RollupBalance | — | |
balance.availableCents | body | integer (int64) | — | |
balance.balanceCents | body | integer (int64) | — | |
balance.holdsCents | body | integer (int64) | — | |
consumedCents | body | integer (int64) | — | |
currency | body | string | — | |
included | body | billing.RollupAllotment | — | |
included.consumedCents | body | integer (int64) | — | |
included.grantedCents | body | integer (int64) | — | |
included.monthlyCents | body | integer (int64) | — | |
included.remainingCents | body | integer (int64) | — | |
overageCents | body | integer (int64) | — | |
period | body | string | — | |
plan | body | string | — | |
user | body | string | — |
Failure carries the platform error shape — see Errors.
Examples
hanzo billing usage rollupimport { Configuration, BillingApi } from 'hanzoai';
const api = new BillingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getBillingUsageRollup();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import BillingApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = BillingApi(client).get_billing_usage_rollup()cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.BillingAPI.GetBillingUsageRollup(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, billing_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = billing_api::get_billing_usage_rollup(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.BillingApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new BillingApi(client).getBillingUsageRollup();curl https://api.hanzo.ai/v1/billing/usage/rollup \
-H "Authorization: Bearer $HANZO_API_KEY"Tool billing, op get_billing_usage_rollup — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "billing",
"arguments": {
"op": "get_billing_usage_rollup",
"input": {}
}
}
}'