Cost Caps and Kill-Switch
Hard daily caps per session, per API key, or per day. When the cap hits, RelayPlane returns a 429, fires alerts, and kicks in auto-downgrade. No SaaS in the middle. The kill happens at the proxy.
Quick Start
Set a daily cap in one command:
1relayplane cap set --day 50The proxy reads the cap on the next request. No restart required.
How It Works
Every request that passes through the proxy checks the running daily total against your cap. When the cap is exceeded, the proxy returns 429 cost_cap_exceeded. The check runs locally on every call. There is no external dependency.
YAML Configuration
Full options in relayplane.config.yml:
1cost_caps:2 daily_usd: 50 # hard kill at $50/day3 session_usd: 10 # per-session kill4 soft_limit: 0.80 # auto-downgrade at 80% of cap56downgrade_ladder:7 - from: claude-opus-4-58 to: claude-sonnet-4-69 - from: claude-sonnet-4-610 to: claude-haiku-4-51112alerts:13 telegram: true # fires on cap hit14 email: trueRunaway-Loop Detection
If the same session retries N times within W seconds, RelayPlane marks it as a runaway loop, kills the session, and fires an alert. Default: 3 retries within 90 seconds.
1runaway_detection:2 retry_count: 33 window_seconds: 90Viewing Kill History
1relayplane kills --last 7dShows what was killed, why, and how much it saved. 7-day retention on Pro, 30-day on Max.