Replace limits

Sets the payer's choice to keep using a model on credits once the plan's included usage of it is spent.

PUT /v1/ai/limits

Addresshttps://api.hanzo.ai/v1/ai/limits
MethodPUT
OperationaiSetLimits
AuthAuthorization: Bearer $HANZO_API_KEY

Sets the payer's choice to keep using a model on credits once the plan's included usage of it is spent. A pooled org wallet is its org admin's to set; a person's own wallet is theirs. Every change is on the audit trail, before and after; no trail, no change. Answers the limits as they read after it.

Request

1 field, body application/json (required).

FieldInTypeRequiredDescription
creditsAfterAllowancebodyboolean—CreditsAfterAllowance keeps a model working once the plan's included usage of it is spent, paid from prepaid credit (and granted credit where the model takes it), when true; when false the conversation moves to a Hanzo model and other calls are refused until the plan resets.

Response

StatusBodyMeaning
200aiLimitsok
defaultproblem-detailsrefused

200 body — 37 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.*.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).
credits_after_allowancebodyboolean—CreditsAfterAllowance is the payer's choice to keep using a model on credits once the plan's included usage of it is spent (PUT /v1/ai/limits sets it).
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).
period_endbodystring—
period_startbodystring—PeriodStart and PeriodEnd bound the billing period (RFC3339).
planbodystring—Plan is the plan the caller is served as ("dev", "max-5x", "max-20x", "team", "team-annual", "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 has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.

import { Configuration, AiApi } from 'hanzoai';

const api = new AiApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.aiSetLimits({ creditsAfterAllowance: false });
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_set_limits(credits_after_allowance=False)
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AiAPI.AiSetLimits(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_set_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).aiSetLimits();
curl -X PUT https://api.hanzo.ai/v1/ai/limits \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "creditsAfterAllowance": false
     }'

MCP declares no tool for ai — tools/list on https://api.hanzo.ai/v1/mcp names the products it does reach. Use HTTP or an SDK.


AI API · All Hanzo APIs · Interactive reference

Was this page useful?