guide
A2A usage & budgets
Meter external-agent A2A traffic, set UTC daily ceilings, get soft approach alerts, and hard-cut further A2A calls with 429 + Retry-After. Configure on the project Keys tab. Agent Cards have no SLA/quota fields — limits live here.
At a glance
- Meters authenticated /api/a2a requests per UTC day (not tokens/USD).
- Budgets attach to the project API key — caller labels are display-only.
- Default project ceiling: 50,000 A2A requests/day (UTC), on by default.
- Hard cut-off: 429 + Retry-After until next UTC midnight — A2A only.
- Manage on Project → Keys → A2A usage & budgets (banner + optional email).
How it works
- What is metered
- Authenticated /api/a2a gateway traffic as request count per UTC calendar day (surface=a2a). Rows record a2aOp, skillId when known, and outcome ok or budget_denied. Not tokens or USD.
- Attribution
- Cut-off subject is the project API key (sk-as-…). Optional X-AgentSentri-A2A-Caller (Agent Card URL or label) is display-only — never the budget subject. The Agent Card describes AgentSentri, not the caller.
- Project ceiling
- On by default at 50,000 A2A requests/day (UTC). Hard reject when exceeded. Per-key daily caps are opt-in and stack with the project ceiling.
- Soft approach
- Default 80% of an active hard cap. Fires an in-app banner; email when SMTP_URL and alert recipients are set.
Budgets & cut-off
Hard deny returns HTTP 429 with Retry-After set to seconds until the next UTC midnight, and a RESOURCE_EXHAUSTED error body. Scope is A2A-only — OTLP ingest and /api/public/* stay available for the same key.
| Control | Default | Behavior |
|---|---|---|
| Project A2A daily ceiling | 50,000 on | Hard cut-off for further A2A calls when the UTC day total is reached. |
| Per-key A2A daily cap | off (opt-in) | Same unit; either key or project cap can deny. |
| Soft approach % | 80 | Banner (+ optional email) before hard reject. |
| Static hourly request cap | alert-only | Unchanged — does not cut off A2A or public REST. |
Keys UI
Project → Keys → A2A usage & budgets shows today's project usage, soft approach %, top skills, top advisory callers, project ceiling controls, alert emails, and opt-in per-key caps. Viewer+ reads; admin+ configures.
Alerts
Approach and breach alerts always appear as an in-app banner on the Keys A2A panel. Email requires SMTP_URL plus recipients in the panel.
| Alert | Fires when |
|---|---|
| a2a.budget_approach | Usage ≥ soft % of an active hard cap (key or project). |
| a2a.budget_breach | Hard cut-off fired; denied attempts record outcome=budget_denied. |
Gateway dependency
Budgets hook the thin A2A Server gateway: discover /.well-known/agent-card.json, then call /api/a2a with Bearer sk-as-…. Auth → budget decision → skill dispatch → meter. Without the gateway there is no live A2A surface to meter.