The four controls
Per-request cap: X-Max-Cost-USD
Add one header to your OpenAI client and every call gets a hard cost ceiling:
- PRYSM estimates cost before calling the provider (input tokens × rate + max_tokens × rate).
- If estimated cost > cap, PRYSM selects the cheapest live model that fits within the cap.
- If no model fits (extremely tight cap), PRYSM returns HTTP 402:
prysm.routing.why field tells you what happened:
Per-agent cap in LangChain
Self-throttling agent loop
TheX-Prysm-Budget-Remaining header is emitted on every authenticated response. Agents can read it and slow themselves down before hitting the monthly cap:
80% webhook
SetPRYSM_BUDGET_WEBHOOK_URL to receive a POST when your monthly spend crosses 80%:
- Send Slack/email alerts to the dev team
- Automatically switch agents to budget models
- Pause non-critical background jobs
BRAIN.md: team-level defaults
Set AgentGuard defaults for your entire team without touching agent code:CrewAI: per-agent + crew-total budget
Summary: safe defaults for new agent deployments
X-Prysm-Budget-Remaining trends after the first week and raise limits as you understand your agent’s spending patterns.