---
title: "AISIX 1.8.0: Keep Budget Decisions Local During Control-Plane Outages - API7.ai"
description: "See how AISIX 1.8.0 evaluates pushed budget state locally, filters exhausted provider keys, and scopes strict-mode refusals during reporting failures."
url: "https://api7.ai/blog/aisix-1-8-0-local-budget-decisions"
---

[Blog](https://api7.ai/blog)

[Products](https://api7.ai/category/products)[Technology](https://api7.ai/category/technology)[Ecosystem](https://api7.ai/category/ecosystem)[Case Study](https://api7.ai/category/usercase)[Team & Community](https://api7.ai/category/community)

Search

⌘ + K

[Blog](https://api7.ai/blog)

Products

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

October 29, 2026

[Products](https://api7.ai/category/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](https://github.com/api7/aisix/releases/tag/v1.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`.

| Request         | Configuration store | Observed result       | Upstream request |
| --------------- | ------------------- | --------------------- | ---------------- |
| Direct `demo-a` | Running             | 429 `budget_exceeded` | None             |
| `demo-group`    | Running             | 200                   | Only `demo-b`    |
| Direct `demo-a` | Stopped             | 429 `budget_exceeded` | None             |
| `demo-group`    | Stopped             | 200                   | Only `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](https://github.com/api7/aisix/releases/tag/v1.8.0) 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](https://api7.ai/ai-gateway).

Tags:

[AISIX](https://api7.ai/tags/aisix)

[AI Gateway](https://api7.ai/tags/ai-gateway)

[API Governance](https://api7.ai/tags/api-governance)

Share article link

Share

Related Posts

[![AISIX 1.7.1: Make Cross-Provider Stream Usage an Explicit Contract](https://static.api7.ai/uploads/2026/11/26/xCF7gEgZ_aisix-1-7-1-stream-usage-contract.webp)](https://api7.ai/blog/aisix-1-7-1-stream-usage-contract)

## [AISIX 1.7.1: Make Cross-Provider Stream Usage an Explicit Contract](https://api7.ai/blog/aisix-1-7-1-stream-usage-contract)

[![AISIX 1.7.0: Turn AI Spend Into an Operating Boundary](https://static.api7.ai/uploads/2026/10/26/qZ0mRtyd_aisix-1-7-0-cost-attribution-tags.webp)](https://api7.ai/blog/aisix-1-7-0-cost-attribution-tags)

## [AISIX 1.7.0: Turn AI Spend Into an Operating Boundary](https://api7.ai/blog/aisix-1-7-0-cost-attribution-tags)

Table of Contents

- [Exclude the Exhausted Credential Before Attempting a Request](#exclude-the-exhausted-credential-before-attempting-a-request)
- [Choose What Happens When Usage Delivery Fails](#choose-what-happens-when-usage-delivery-fails)
- [Keep the Spend Boundary Separate from the Request Decision](#keep-the-spend-boundary-separate-from-the-request-decision)
- [Upgrade the Consumers Alongside the Gateways](#upgrade-the-consumers-alongside-the-gateways)

## Related Posts

[![AISIX 1.11.0: Migrate File-Based Gateway Configuration Safely](https://static.api7.ai/uploads/2026/11/24/b8SCADQk_aisix-1-11-0-file-configuration-migration.webp)](https://api7.ai/blog/aisix-1-11-0-file-configuration-migration)

Products

November 20, 2026

#### [AISIX 1.11.0: Migrate File-Based Gateway Configuration Safely](https://api7.ai/blog/aisix-1-11-0-file-configuration-migration)

Discover how AISIX 1.11.0 makes file-based configuration easier to migrate, validate, and troubleshoot before rollout.

[AISIX](https://api7.ai/tags/aisix)

[AI Gateway](https://api7.ai/tags/ai-gateway)

[![AISIX 1.10.0: Keep AI Coding Sessions on a Matched Semantic Route](https://static.api7.ai/uploads/2026/11/13/5rPD4mvs_aisix-1-10-0-semantic-routing-session-affinity.webp)](https://api7.ai/blog/aisix-1-10-0-semantic-routing-session-affinity)

Products

November 12, 2026

#### [AISIX 1.10.0: Keep AI Coding Sessions on a Matched Semantic Route](https://api7.ai/blog/aisix-1-10-0-semantic-routing-session-affinity)

AISIX 1.10.0 brings semantic routing to Messages and Responses APIs, model-group targets, and optional session affinity for supported AI coding and agent sessions.

[AISIX](https://api7.ai/tags/aisix)

[AI Gateway](https://api7.ai/tags/ai-gateway)

[Semantic Routing](https://api7.ai/tags/semantic-routing)

[![AISIX 1.9.0: Connect MCP Users with Their Own Upstream Authorization](https://static.api7.ai/uploads/2026/11/12/HBiZRdR1_aisix-1-9-0-per-user-mcp-oauth.webp)](https://api7.ai/blog/aisix-1-9-0-per-user-mcp-oauth)

Products

November 6, 2026

#### [AISIX 1.9.0: Connect MCP Users with Their Own Upstream Authorization](https://api7.ai/blog/aisix-1-9-0-per-user-mcp-oauth)

AISIX 1.9.0 adds per-user upstream MCP OAuth, allowing users to authorize an upstream service from their MCP client while AISIX manages the upstream credentials.

[AISIX](https://api7.ai/tags/aisix)

[AI Gateway](https://api7.ai/tags/ai-gateway)

[MCP](https://api7.ai/tags/mcp)
