Hanzo
OpenapiBilling

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

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: a service token plus the gateway-pinned org, 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
projectquerystringProject narrows the verdict to one project's caps.
servicequerystringService narrows it to one service's caps.
amountquerystringAmount is the proposed spend in cents.
pvquerystringPV is "1" when the caller ESTABLISHED the project rather than merely carrying a claim of one.

Response

StatusBodyMeaning
200CapVerdictok

200 body — 5 fields.

FieldInTypeAlwaysDescription
allowbodyboolean
capCentsbodyinteger
reasonbodystring
spentCentsbodyinteger
warnPctbodyinteger

Failure carries the platform error shape — see Errors.

Examples

hanzo billing alerts authorize

Billing API · All Hanzo APIs · Interactive reference

How is this guide?

On this page