List limits

Reads the caller's plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on.

GET /v1/ai/limits

Addresshttps://api.hanzo.ai/v1/ai/limits
MethodGET
OperationaiLimits
AuthAuthorization: Bearer $HANZO_API_KEY

Reads the caller's plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on. Shares only, never amounts.

Request

GET /v1/ai/limits takes no parameters and no body — the credential is the whole request.

Response

StatusBodyMeaning
200aiLimitsok
defaultproblem-detailsrefused

200 body — 39 fields.

FieldInTypeAlwaysDescription
actionsbodyaiAction[]—Actions are the ways on: upgrade, add prepaid credit.
actions[].kindbodystring—
actions[].labelbodystring—
actions[].planbodystring—
actions[].urlbodystring—
classesbodyobject—Classes are premium (third-party frontier models) and ours (Hanzo's), each present when the plan includes it.
classes.*bodyaiClass—
classes.*.payingbodystring—Paying is plan, prepaid, credits, or none.
classes.*.percentbodyinteger (int64)—
classes.*.resets_atbodystring—
classes.*.statebodystring—State is ok, near, or limited when the class is used up and nothing else pays.
classes.*.unboundedbodyboolean—Unbounded says the plan includes all of this class's use: there is no share to use up, and Percent is 0.
classes.*.windowbodyaiWindow—
classes.*.window.percentbodyinteger (int64)—Percent is the share used, 0 to 100, rounded up to the next five so any use shows.
classes.*.window.resets_atbodystring—ResetsAt is when the window starts again (RFC3339), null for a session that is not running: it starts at the next request.
classes.*.window.statebodystring—State is ok, near (four fifths used) or limited (used up).
daybodyaiWindow—
day.percentbodyinteger (int64)—Percent is the share used, 0 to 100, rounded up to the next five so any use shows.
day.resets_atbodystring—ResetsAt is when the window starts again (RFC3339), null for a session that is not running: it starts at the next request.
day.statebodystring—State is ok, near (four fifths used) or limited (used up).
limitedbodyaiLimited—
limited.classesbodystring[]—
limited.messagebodystring—
limited.reasonbodystring—Reason is plan_allowance_used.
pausedbodyaiPaused[]—Paused are the models whose share of the plan is used for now: each is answered by its fallback in chat until its share resets.
paused[].fallbackbodystring—Fallback is the Hanzo model that answers a conversation in its place.
paused[].modelbodystring—Model is the model id, or a pattern ending in * naming a family of them.
paused[].resets_atbodystring—ResetsAt is when its share resets (RFC3339).
paysbodyobject—Pays is who pays for the next priced request of each class, on any plan or none: plan (its included usage), prepaid (funds the caller added), credits (granted credit, where it pays for the class) or none (nothing does: a request of the class is refused 402 insufficient_balance until funds are added, the topup action).
pays.*bodystring—
period_endbodystring—
period_startbodystring—PeriodStart and PeriodEnd bound the month the plan's usage renews over (RFC3339): the billing period, or one month of a yearly one.
planbodystring—Plan is the plan the caller is served as ("dev", "max-5x", "max-20x", "team", "agency", "advisory", "dedicated", ...), "free" when none counts.
sessionbodyaiWindow—
session.percentbodyinteger (int64)—Percent is the share used, 0 to 100, rounded up to the next five so any use shows.
session.resets_atbodystring—ResetsAt is when the window starts again (RFC3339), null for a session that is not running: it starts at the next request.
session.statebodystring—State is ok, near (four fifths used) or limited (used up).
statebodystring—State is the worst class's: ok, near or limited.
upgradebodystring—Upgrade is the plan that raises these limits, absent at the top.

Failure carries the platform error shape — see Errors.

Examples

hanzo ai limits get
import { Configuration, AiApi } from 'hanzoai';

const api = new AiApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.aiLimits();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AiApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AiApi(client).ai_limits()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AiAPI.AiLimits(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, ai_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = ai_api::ai_limits(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AiApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AiApi(client).aiLimits();
curl https://api.hanzo.ai/v1/ai/limits \
  -H "Authorization: Bearer $HANZO_API_KEY"

Tool ai, op aiLimits — 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": "ai",
         "arguments": {
           "op": "aiLimits",
           "input": {}
         }
       }
     }'

AI API · All Hanzo APIs · Interactive reference

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.