Answers the caller's month: what their plan includes, what has been consumed…
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 | Rollup | ok |
200 body — 21 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
balance | body | RollupBalance | — | |
balance.availableCents | body | integer | — | |
balance.balanceCents | body | integer | — | |
balance.holdsCents | body | integer | — | |
consumedCents | body | integer | — | |
currency | body | string | — | |
included | body | RollupAllotment | — | |
included.consumedCents | body | integer | — | |
included.grantedCents | body | integer | — | |
included.monthlyCents | body | integer | — | |
included.remainingCents | body | integer | — | |
overageCents | body | integer | — | |
period | body | string | — | |
plan | body | string | — | |
user | body | string | — | |
windows | body | Window[] | — | |
windows[].limit | body | integer | — | |
windows[].remaining | body | integer | — | |
windows[].resets | body | string | — | |
windows[].span | body | string | — | |
windows[].used | body | integer | — |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { 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 := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.BillingAPI.GetBillingUsageRollup(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + 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"The door reaches billing through the billing tool, which names its 9 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "get_billing_balance"
}
}
}'How is this guide?