Hard Budget Lock (max_cost_micros) Guardrails for AI Agents
Autonomous agents running unattended overnight can burn budgets rapidly if failover spills silently into expensive paid tiers. FuelRouter enforces a hard pre-dispatch max_cost_micros lock on every REST, MCP, and Causal Bazaar invocation.
Per-Pool Default & Global Hard Budget Ceilings
| Pool / Surface | Outcome Price (micros) | Default max_cost_micros | USD Equivalent | Max Wholesale Unit Cost |
|---|---|---|---|---|
| ai_chat_json | 10,000 ($0.010) | 50,000 | $0.050 | 2,500 micros ($0.0025) |
| embeddings_rerank | 4,000 ($0.004) | 20,000 | $0.020 | 600 micros ($0.0006) |
| web_search | 8,000 ($0.008) | 40,000 | $0.040 | 1,500 micros ($0.0015) |
| clean_scrape_extract | 12,000 ($0.012) | 60,000 | $0.060 | 2,200 micros ($0.0022) |
| b2b_domain_dns_enrichment | 20,000 ($0.020) | 80,000 | $0.080 | 2,500 micros ($0.0025) |
| Global Hard Cap (Causal Bazaar) | Per-pool outcome | 2,000,000 | $2.000 | Enforced across all hands |
Pre-Attempt Eligibility Filtering on Upstream Cost
Before dispatching to any upstream u, FuelRouter verifies spent_upstream_micros + u.unit_cost_micros <= max_cost_micros. Any wholesale candidate that would push cumulative attempt cost above the caller's lock is excluded before an HTTP socket is ever opened.
Because all $0 free-tier upstreams have unit_cost_micros: 0, tight budget locks allow free-tier rotation to proceed freely while blocking expensive overflow.
Zero-Cost Pre-Flight Quotes for Autonomous Budget Planners
Orchestrator agents can invoke POST /v1/router/quote (or MCP router_quote) at $0 cost to inspect estimated_outcome_price_micros, estimated_upstream_cost_micros, and cache_would_hit before approving a batch of dispatches.
If no candidate satisfies the caller's max_cost_micros lock, FuelRouter fails closed with HTTP 503 all_upstreams_exhausted, charged_micros: 0, and backoff_advice recommending wait_for_cooldown_or_expand_budget.
Enforce a Strict Free-Tier-Only or Low-Ceiling Budget Lock
curl -fsSL -X POST "https://fuelrouter.fastmesh.dev/v1/router/dispatch" \
-H "Content-Type: application/json" \
-d '{
"pool_id": "embeddings_rerank",
"tenant_id": "budget_strict_agent",
"inputs": {"texts": ["deterministic micro-USD budget lock"]},
"max_cost_micros": 4000
}'
Agent Spend Governance Checklist
- Express every budget ceiling in integer micro-USD (1 USD = 1,000,000 micros) to eliminate floating-point rounding drift.
- Pair router_quote dry runs with batch orchestrators before kicking off >1,000-call sweeps.
- Never exceed the global $2.00 (2,000,000 micros) per-call hard cap on autonomous hands.
- Log receipt_sha256 and charged_micros after every dispatch for deterministic cost accounting.
Frequently Asked Technical Questions
Why use micro-USD integers instead of floating-point dollars?
Integer micro-USD arithmetic (1,000,000 micros = $1.00) eliminates IEEE-754 rounding errors across thousands of sub-cent API calls.
What happens if my max_cost_micros is too low for wholesale fallbacks and free slots are full?
FuelRouter skips over-budget wholesale upstreams and returns HTTP 503 with charged_micros: 0 and clear backoff_advice.
Does max_cost_micros work identically on POST /mcp and REST?
Yes. Both REST /v1/router/dispatch and MCP router_dispatch enforce the exact same pre-dispatch budget filter.
Live Try-Now Console & Machine Discovery
Test failover routing, dry-run quotes, and circuit breaker metrics on the live gateway or connect via JSON-RPC 2.0 MCP.
Related FuelRouter Architecture Guides
- Detecting HTTP 200 Login Walls & Empty SPA Shells in Proxy Responses — detect HTTP 200 login wall and empty SPA shell responses
- Adaptive TTL Cache Invalidation & force_refresh Semantics — adaptive TTL cache invalidation and force_refresh API
- Prepaid Creem Credit Packs & HMAC-SHA256 Webhook Settlement — prepaid API credit packs HMAC-SHA256 webhook idempotency