Skip to main content

Rate Limits and Budgets

A2A agent calls pass through the same caller API key boundary as model requests. The rate limits and budgets you set on a caller API key govern that key's A2A calls with no separate A2A configuration. This page explains which controls apply, how the gateway enforces them on the A2A path, and how to verify the behavior.

For the full rate-limit field reference and counter-storage options, see Rate Limits. For budget configuration in managed deployments, see Budgets.

What the Gateway Governs

The gateway applies rate-limit and budget checks to each JSON-RPC call at /a2a/<agent>. Agent-card discovery at /a2a/<agent>/.well-known/agent-card.json is not rate-limited, so a throttled caller can still fetch the card of an agent its key allows — it just cannot invoke the agent again until the window resets.

When an A2A call is rejected — by a rate limit or a budget — the gateway returns before it contacts the upstream agent, and it still records the rejected call as a usage event.

Because an A2A call resolves no model, model-scoped rate-limit policies do not apply to it. The request-level limits on the caller API key — the key's inline rate_limit, and any api-key-, team-, or member-scope policies — do apply.

Which Rate Limits Apply

A caller API key's rate_limit object carries request-rate, token-rate, and concurrency limits. On the A2A path:

LimitApplies to A2A callsNotes
rps, rpm, rph, rpdYesEach /a2a/<agent> call counts as one request in the matching window.
concurrencyYesEach in-flight A2A call holds one concurrency permit until it returns.
tpm, tpdNot drawn downToken-rate windows count model tokens. An A2A call carries no token cost, so it adds nothing to a token window — but a window already exhausted by the key's model traffic still blocks that key's A2A calls.

Because A2A calls carry no token cost, use the request-rate limits (rps, rpm, rph, rpd) or concurrency to throttle A2A callers directly. A token limit alone does not cap A2A call volume — though an already-exhausted token window on the caller's key, filled by that key's model traffic, still rejects the key's A2A calls with HTTP 429 until the window resets.

Configure a Rate Limit

Set a rate limit on the caller API key. Updates replace the resource, so include the existing key hash, model access, and agent access along with the new rate_limit. This example limits the caller to one A2A call per minute:

export AISIX_ADMIN_KEY="YOUR_ADMIN_KEY"

curl -sS -X PUT "http://127.0.0.1:3001/admin/v1/apikeys/YOUR_API_KEY_ID" \
-H "Authorization: Bearer ${AISIX_ADMIN_KEY}" \
-H "Content-Type: application/json" \
-d '{
"key_hash": "'"${AISIX_API_KEY_HASH}"'",
"allowed_models": [],
"allowed_agents": ["invoice-processor"],
"rate_limit": {
"rpm": 1
}
}'

Verification

Call /a2a/invoice-processor with this caller API key twice within the same minute.

Expected result: the first call succeeds. A second call within the same minute is rejected with HTTP 429 before AISIX contacts the upstream agent. Fetching the agent card continues to work while the caller is throttled, because card discovery is not rate-limited.

Apply Budgets in Managed Deployments

Budgets are enforced in AISIX Cloud managed deployments. When a budget that covers the caller API key is exhausted, the gateway rejects that key's A2A calls with a budget_exceeded error before contacting the upstream agent, the same check the model path runs.

A2A calls carry no token cost, so they do not add to token-based spend themselves. A budget exhausted by the caller's model traffic still blocks that caller's A2A calls, because both share one caller API key and one budget. See Budgets for budget targets, the rejection response, and caching behavior.

Self-hosted deployments

Budget enforcement requires the AISIX Cloud control plane. In a self-hosted gateway, use caller API key rate limits to govern A2A call volume.

Manage Rate Limits and Budgets on AISIX Cloud

On AISIX Cloud, you set these controls from the caller API key form in the dashboard instead of the Admin API:

  1. Open the environment where the A2A agent is exposed and go to API keys.
  2. Create or edit the caller API key the A2A client uses. Set its agent access in the key's form; set its rate limits and budget in the sections on the key's card.
  3. In the Rate limits section, set the request limits (per second, minute, hour, or day) and concurrency. These apply to the key's A2A calls as well as its model requests. The token limits track model tokens, which A2A calls do not add to.
  4. Add a budget on the same key — or use the Budgets page for organization- and environment-wide caps. Once the key's budget is exhausted, the gateway blocks its A2A calls too.

Because agent access, rate limits, and the budget all attach to the same caller API key, you configure a key's A2A governance in one place. See AISIX Cloud.

Next Steps

  • Observability — read the usage events and metrics A2A calls emit, including rejected calls.
  • Control agent access per key — scope which agents each key may reach.
  • Rate Limits — the full rate-limit field reference and counter-storage options.
  • Budgets — configure budgets for managed deployments.
API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation