Skip to content
Documentation menu

Budgets and guardrails

Both are optional and off by default. Changes take effect within about a minute.

Budgets

A budget stops requests once a monthly limit is reached. You can set two limits, alone or together:

  • Monthly spend limit (USD): estimated Bedrock spend.
  • Monthly request limit: answered requests.

Set one for the whole subscription on Subscriptions (the Monthly budget card), or for one API key on API keys (choose Budget on the key's row). Both apply, and the first limit reached stops the request.

When a limit is reached

Requests get 403 budget_exceeded, with a message that names the limit and when requests are accepted again. It is a 403, not a 429, so SDKs do not retry it.

{
  "error": {
    "message": "This API key has reached its monthly budget of 1,000 requests. ...",
    "type": "permission_error",
    "param": null,
    "code": "budget_exceeded"
  }
}
  • A request limit is exact. Each request is counted before it reaches a model, so parallel requests cannot go past it. A request that gets no answer gives its place back.
  • A spend limit refuses once reached; it does not cut a request off. Cost is known only after the answer, so the request that reaches the limit completes, and so do requests already in flight.
  • Spend is an estimate, at Amazon Bedrock on-demand list prices. Your AWS bill is the final figure.
  • The month is the calendar month in UTC. Refused requests do not count.

Guardrails

You can apply an Amazon Bedrock Guardrail from your own AWS account to every routed request. It works the same for every model the gateway picks.

  1. Create the guardrail in the Amazon Bedrock console, in the region you connected, and publish a version. Guardrails with cross-Region inference work too.
  2. In the dashboard, on AWS account, open Bedrock Guardrail, choose Add a guardrail, enter the Guardrail ID or ARN and the Version, and choose Check and save.

The dashboard checks the guardrail through your role before saving it. To stop, choose Remove guardrail.

What it does to responses

  • A blocked prompt or answer is not an error. You get 200 with the guardrail's blocked message and finish_reason content_filter. It counts as a routed request.
  • Streaming: each chunk is checked before it is sent, which adds some latency.
  • Guardrail errors are final: 403 bedrock_guardrail_denied or 400 bedrock_guardrail_invalid, with no fallback.

Use a numbered guardrail version, not DRAFT, so what runs is what you reviewed. AWS bills guardrail usage to your account; AI Cloud Gateway adds no charge.

Full guide: controls.md on GitHub