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

Addresshttps://api.hanzo.ai/v1/billing/usage/rollup
MethodGET
Operationget_billing_usage_rollup
AuthAuthorization: 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

StatusBodyMeaning
200billing.Rollupok
defaultproblem-detailsrefused

200 body — 15 fields.

FieldInTypeAlwaysDescription
balancebodybilling.RollupBalance—
balance.availableCentsbodyinteger (int64)—
balance.balanceCentsbodyinteger (int64)—
balance.holdsCentsbodyinteger (int64)—
consumedCentsbodyinteger (int64)—
currencybodystring—
includedbodybilling.RollupAllotment—
included.consumedCentsbodyinteger (int64)—
included.grantedCentsbodyinteger (int64)—
included.monthlyCentsbodyinteger (int64)—
included.remainingCentsbodyinteger (int64)—
overageCentsbodyinteger (int64)—
periodbodystring—
planbodystring—
userbodystring—

Failure carries the platform error shape — see Errors.

Examples

hanzo billing usage rollup
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 := 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": {}
         }
       }
     }'

Billing API · All Hanzo APIs · Interactive reference

Was this page useful?