AISIX 1.8.0: Keep Budget Decisions Local During Control-Plane Outages

October 29, 2026

Products

A shared AI gateway should not turn a reporting outage into a refusal for every application. It also needs to keep enforcing a budget it already knows is exhausted. AISIX 1.8.0, released October 29, 2026, changes that decision path: the gateway evaluates budget documents received with its configuration instead of asking the control plane for each request.

Consider an operations team routing document-processing requests through a Model Group with two upstream credentials. One credential has exhausted its budget; the other remains eligible. The desired outcome is to exclude the exhausted credential while continuing through the alternative, including when the reporting service is unavailable. Version 1.8.0 makes that distinction explicit, with a separate policy for operators who prefer refusing budget-covered traffic when usage delivery becomes unhealthy.

Exclude the Exhausted Credential Before Attempting a Request

A hard-stop provider_key budget now applies to routing candidates using that credential. The gateway filters an exhausted candidate before dispatch, without consuming a fallback slot. Another candidate can serve only if it also passes normal routing and eligibility checks. If all budget-filtered candidates are exhausted, the request gets 429 budget_exceeded. This provider-key behavior does not apply to MCP, A2A or gateway-internal calls.

We exercised this path with the official AISIX 1.8.0 image, an isolated etcd instance and a simulated OpenAI-compatible upstream. Budget documents were manually seeded, not generated by actual spend. The group preferred demo-a, whose provider key was marked exhausted, over demo-b, with max_fallbacks: 0.

RequestConfiguration storeObserved resultUpstream request
Direct demo-aRunning429 budget_exceededNone
demo-groupRunning200Only demo-b
Direct demo-aStopped429 budget_exceededNone
demo-groupStopped200Only demo-b

These are real gateway responses and recorded mock-upstream paths. The post-stop requests were sent immediately after etcd stopped: they demonstrate continued decisions from loaded state, not a long-duration control-plane or telemetry outage test. No UI screenshot applies to this request-time filtering result; it is observable through the API response and the selected upstream.

The rejected direct request returned this shortened error object:

{ "error": { "type": "billing_error", "code": "budget_exceeded", "scope": "provider_key", "limit_usd": "10.00", "spent_usd": "10.25" } }

The amounts are illustrative values in the seeded document. They demonstrate the refusal contract, not a provider invoice, measured spend, or an exact-dollar cap.

Choose What Happens When Usage Delivery Fails

For AISIX Enterprise and AISIX Cloud budget workflows, the control plane owns spend state and pushes budget documents to gateways. The gateway's local decision uses the state it has received; it cannot learn new spend merely because it continues serving requests.

The release defines two enforcement modes:

  • sticky, the default, continues using the last pushed state. A known exhausted budget continues to block. A budget not yet marked exhausted does not become exhausted locally just because the control plane is unavailable. Continued traffic can therefore incur further spend before updated state arrives.
  • closed treats prolonged usage-delivery failure as uncertainty. After the configured grace period, a matching non-exhausted key-level budget causes 503 budget_unverified; these are scopes other than provider_key, including organization, environment, team, member, tag and API-key scopes. A covered provider key is excluded from routing candidates. Traffic outside those budget scopes can still serve. A known exhausted budget takes precedence and still produces 429.

The control-plane setting is budget_closed_grace_seconds, documented for this release with a default of 600 seconds and a range of 60–86400. The pushed gateway policy uses budget_policy.fail_mode and closed_grace_seconds. This is a delivery-health threshold, not a timer on the last budget lookup. The tagged strict-mode E2E test uses a mock control plane and an accelerated grace period to verify refusal, unaffected traffic, alternate targets and recovery; our local demonstration above did not execute that managed-mode scenario.

Monitor aisix_usage_delivery_unhealthy_seconds. When the telemetry sender records a reached batch, delivery health recovers and the strict uncertainty condition can lift. That does not prove every event was accepted or billed: the implementation also treats a 422 content rejection as reaching the control plane. Diagnose rejected events separately.

Period-bound exhaustion is evaluated against UTC periods, so a mark from an earlier period stops blocking at the next boundary without a fresh push. A mark without a period start persists; strict-mode uncertainty may still refuse a covered request. A period rollover is therefore not a universal availability guarantee.

Keep the Spend Boundary Separate from the Request Decision

The practical choice is whether to continue with potentially stale budget state or restrict affected traffic when reporting is unhealthy. Neither mode promises that an in-flight response stops at a precise dollar threshold. In particular, a stream that has delivered content cannot be treated as a zero-cost request simply because the caller disconnects before a final usage report.

Keep the caller's response, access logs, usage events and provider charges distinct. Interrupted streams can retain reported usage and estimate missing counters; an estimated gateway record is not the provider's invoice. This release's local eligibility decision does not establish immediate accounting, dashboard freshness, or a cross-replica reservation of the remaining budget.

For the document-processing service, test the exhausted direct model, the alternative target, all targets exhausted, and usage-delivery failure both inside and beyond the grace period. Include a key and an upstream that no budget covers. Verify recovery after reporting resumes, and check both completed and interrupted requests in your own usage pipeline.

Upgrade the Consumers Alongside the Gateways

Older gateways retain their earlier per-request budget check and outage behavior. They also keep the old meaning of provider_key budgets, which can refuse whole API keys instead of excluding individual candidates. Gateways in the 1.6.x/1.7.x series count the new budget documents in aisix_config_unknown_kind_resources without changing reload status. Validate a mixed-version rollout explicitly. Organizations using the previous open mode move to sticky; open is no longer accepted.

The same release includes separate changes that need operational attention:

  • Update access-log parsers: status becomes status_code, error_kind becomes error_class, model becomes requested_model, and latency_ms becomes downstream_latency_ms. Stop querying the removed aisix_llm_spend_micro_usd_total; review the release's route-label changes and removal of the budget_cache component gauge.
  • Chat debug response headers are off by default. Set proxy.expose_debug_headers: true if an integration requires them; x-aisix-request-id remains available.
  • Check startup warnings: unknown keys are now ignored. Remove retired observability blocks and AISIX_DP_BUDGET_STALE_MAX_SECONDS rather than assuming they still take effect.
  • Empty offered credential headers now cause 401; on gateway_key passthrough routes, an unusable Authorization no longer falls back to x-api-key. Use the new x-aisix-api-key for gateway credentials when keeping Authorization for the upstream.
  • For load balancers sending PROXY headers, configure proxy.real_ip.trusted_proxies; untrusted PROXY connections close. On dual-stack listeners, review IPv4-mapped allowlists because IPv4 clients now appear as plain IPv4.

MCP delegation and Entra token exchange are separate identity workflows introduced in 1.8.0, not part of this budget mechanism. Review the complete historical release and upgrade notes for their configuration and limitations, and include intervening release notes when upgrading beyond 1.8.0. For current product and deployment context, see the AISIX AI Gateway overview.

Tags:
Share article link