Alerts tell you after the money is gone.
AgentFuse returns a 402 first.
A hosted, drop-in proxy for the OpenAI and Anthropic APIs. Give every agent its own key and budget. AgentFuse meters each call, refuses the one that would breach the cap, trips when an agent loops, and alerts you.
Launching soon See the quickstart$47,000bill from four looping agents in Nov 2025. Root cause: no per-agent cap, nothing that could stop the next call. (source)
44%of organisations have AI spend guardrails (Gartner, March 2026). The rest find out from the invoice. (source)
0SDK changes: point the base URL and API key your SDK already reads at AgentFuse. Nothing to install or run.
How it works
Save your provider keySign up and paste your OpenAI or Anthropic key. It is stored encrypted and never shown again. Agents never see it.
One key per agentCreate an
af_live_ key with a monthly, daily or per-run budget, a loop threshold and an optional model allow-list.Swap two env varsPoint the SDK's base URL at AgentFuse. Calls that would break a budget get HTTP 402; a looping key trips and stays blocked until you resume it.
Quickstart
# 1. Sign up (Free plan: 3 agent keys, no card) and save your OpenAI and/or Anthropic key in the dashboard.
# 2. Create an agent key in the dashboard, e.g. $50/month and $2 per run.
# -> af_live_... (shown once)
# 3. Point your agent at AgentFuse (the dashboard shows your exact URL):
export OPENAI_BASE_URL=https://<your AgentFuse URL>/openai/v1 OPENAI_API_KEY=af_live_...
export ANTHROPIC_BASE_URL=https://<your AgentFuse URL>/anthropic ANTHROPIC_API_KEY=af_live_...
# Prefer an API to the dashboard? Create keys with your org token:
curl -s https://<your AgentFuse URL>/api/keys -H 'authorization: Bearer af_org_...' -H 'content-type: application/json' \
-d '{"name":"research-agent","policy":{"monthly_budget_usd":50,"per_run_budget_usd":2}}'
Tag requests with an X-AgentFuse-Run header to scope the per-run budget to one task.
What a stopped loop looks like
The ninth identical request in two minutes (default threshold: 8) gets this, and the key stays blocked until a human resumes it:
HTTP/1.1 402 Payment Required
x-agentfuse-blocked: loop_detected
{"type":"error","error":{"type":"agentfuse_loop_detected","code":"loop_detected",
"message":"AgentFuse blocked this request: loop_detected (identical request repeated 8x within 120s). Resume at https://<your AgentFuse URL>/keys/key_c274532666fcf149"}}
What you get
- Hard budgets per key: monthly, daily, and per run. Enforced inline on every request, not by a nightly billing export.
- Pre-flight blocking. Cost is estimated from prompt size and
max_tokens; a call that would cross the cap is refused before it is forwarded. - Loop detection. The same request N times in a window opens the breaker. The key stays blocked until a human resumes it.
- Exact metering for streamed and non-streamed responses on both providers, including cached tokens. Non-streamed responses carry
x-agentfuse-cost-usd; streamed usage is metered from the final chunk. - Alerts to Slack or any webhook at 80% of budget and on abnormal burn rate; every trip also goes out by email when configured.
- Model allow-lists, per-minute rate limits, and a route allow-list: an agent key reaches inference routes only, never files, fine-tuning or admin endpoints.
Pricing
Free
$0
- 3 agent keys
- Webhook alerts
- No card to sign up
Pro
$29/mo
- 25 agent keys
- Webhook + email alerts
Team
$99/mo
- Unlimited keys
- CSV audit export
- Priority support
On every plan, provider keys are stored encrypted per organisation (AES-256-GCM) and are never returned by the API or the dashboard.
FAQ
- Does it see my prompts?
- Request bodies pass through AgentFuse on their way to the provider and are never stored. Only the model, token counts, cost and a hash of the request are kept.
- What happens to a blocked call?
- HTTP 402 with a JSON error both SDKs surface. The message names the reason, the budget, and the link to resume the key.
- Can spend go over the cap?
- Slightly, at most. The pre-flight check uses an estimate, so the call that crosses the cap (and any call already in flight at that moment) goes through and is metered exactly; the key then trips and the next call is refused. Set
preflight: "strict"on a key to assume every call uses its fullmax_tokens. - What counts as a loop?
- The same request body sent with the same key 8 times within 120 seconds, by default. Both numbers are set per key. An agent whose context grows every turn will not repeat exactly; per-run budgets and burn-rate alerts cover that case.
- Streaming?
- Passed through byte-for-byte. Usage is read from the stream and metered after the last chunk. AgentFuse forces
include_usageon OpenAI streams so metering cannot be skipped. - What if AgentFuse is down?
- It sits in the request path, so agent calls fail rather than bypass the budget. That is the trade-off of a hard stop: nothing reaches the provider without passing the check.
- Can we run it in our own cloud?
- On the Team plan we can arrange a licensed copy that runs in your own infrastructure. It is not self-serve: ask us through the feedback form.
Give your next agent a budget it cannot exceed
Free plan: 3 agent keys, no card. No SDK changes.
Launching soon Read: how hard caps work