Answers what the CALLER has left of their plan's free-call allowance this…
Answers what the CALLER has left of their plan's free-call allowance this period, and the instant the count starts again.
GET /v1/allowance
| Address | https://api.hanzo.ai/v1/allowance |
| Method | GET |
| Operation | get_allowance |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Answers what the CALLER has left of their plan's free-call allowance this period, and the instant the count starts again.
This is the number a product shows beside the composer — "17 of 20 left today" — and the moment to offer a plan is when it reaches zero. It READS: asking does not spend, so a page that polls it costs the caller nothing.
The subject is the caller's own, resolved from the verified credential, and can never be named in the request — so this is a mirror, not a lookup of someone else. An unauthenticated caller is refused: there is no allowance without someone to hold it.
A named handler, not a closure, so zipdoc can lift this prose into the registry.
Request
GET /v1/allowance takes no parameters and no body — the credential is the whole request.
Response
| Status | Body | Meaning |
|---|---|---|
200 | Allowance | ok |
200 body — 5 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
limit | body | integer | — | calls the plan allows per period; 0 = unbounded |
plan | body | string | — | the tier the limit came from |
resets | body | integer | — | unix seconds; when the count starts again |
spent | body | boolean | — | the subject is at the limit |
used | body | integer | — | Used is how many zero-priced calls this subject has been SERVED in the period ending at Resets — the UTC calendar day. |
Failure carries the platform error shape — see Errors.
Examples
hanzo allowance getimport { Configuration, AllowanceApi } from 'hanzoai';
const api = new AllowanceApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAllowance();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AllowanceApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AllowanceApi(client).get_allowance()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.AllowanceAPI.GetAllowance(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, allowance_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = allowance_api::get_allowance(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AllowanceApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new AllowanceApi(client).getAllowance();curl https://api.hanzo.ai/v1/allowance \
-H "Authorization: Bearer $HANZO_API_KEY"Tool allowance, op get_allowance — 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": "allowance",
"arguments": {
"op": "get_allowance",
"input": {}
}
}
}'How is this guide?