Skip to main content

Enforce budgets at the legacy AI Gateway

Legacy gateway

This page covers the legacy AI Gateway, which runs through the AI Gateway operator and AIGateway resources. For the current AI Gateway, see Enforce budgets at the AI Gateway. To check which gateway you run, see Identify your deployment.

The legacy AI Gateway checks available budget before sending a request and charges provider-reported usage after the response. Create the budgets themselves in Budgets and pricing or the console.

Cover every caller before you turn enforcement on

Budget enforcement denies callers without an applicable budget. Cover every caller before enabling enforcement.

Prerequisites​

Budget enforcement runs through gateway-level webhooks.

Confirm that both budget entries report probeSucceeded: true:

kubectl get aigw <NAME> -n <NAMESPACE> \
-o jsonpath='{.status.webhooks}' | jq .

A false value usually indicates mismatched audiences on the gateway and budget service.

When a budget runs out​

An exhausted budget returns a policy denial. Check the caller in the console to distinguish an exhausted budget from missing coverage.

Next steps​