List authorize

Answers whether one proposed spend fits inside this org's caps.

GET /v1/billing/alerts/authorize

Addresshttps://api.hanzo.ai/v1/billing/alerts/authorize
MethodGET
Operationget_billing_alerts_authorize
AuthAuthorization: Bearer $HANZO_API_KEY

Answers whether one proposed spend fits inside this org's caps.

It is the per-request verdict the metering edge consumes before every priced call, and its caller is a SERVICE rather than a person: the platform, stating the org over the plane, with no user behind it. So this admits that principal where the CRUD beside it does not.

Every covering row is evaluated, most-restrictive-wins, and the tightest one is what capCents, spentCents and reason describe. Soft rows never deny; nor does a project-scoped enforcing row whose project axis the caller could not establish — pv=1 is how a caller states that it did, and an unproven claim must not be able to refuse traffic.

A named handler, not a closure, so zipdoc can lift this prose into the registry.

Request

4 fields.

FieldInTypeRequiredDescription
projectquerystring—Project narrows the verdict to one project's caps.
servicequerystring—Service narrows it to one service's caps.
amountquerystring—Amount is the proposed spend in cents.
pvquerystring—PV is "1" when the caller ESTABLISHED the project rather than merely carrying a claim of one.

Response

StatusBodyMeaning
200billing.CapVerdictok
defaultproblem-detailsrefused

200 body — 5 fields.

FieldInTypeAlwaysDescription
allowbodyboolean—
capCentsbodyinteger (int64)—
reasonbodystring—
spentCentsbodyinteger (int64)—
warnPctbodyinteger (int64)—

Failure carries the platform error shape — see Errors.

Examples

hanzo billing alerts authorize
import { Configuration, BillingApi } from 'hanzoai';

const api = new BillingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getBillingAlertsAuthorize();
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_alerts_authorize()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.BillingAPI.GetBillingAlertsAuthorize(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_alerts_authorize(&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).getBillingAlertsAuthorize();
curl https://api.hanzo.ai/v1/billing/alerts/authorize \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches billing through the billing tool, which names its 39 operations with its own verbs — this one among them, under a name only MCP 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": "list_billing_accounts"
         }
       }
     }'

Billing API · All Hanzo APIs · Interactive reference

Was this page useful?