This guide walks you through pointing your existing Anthropic SDK or HTTP client at BurnGuard’s local proxy so every Claude request is metered, costed, and checked against your budget in real time — with zero changes to your business logic.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Verifieddanny/BurnGuard/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- BurnGuard installed and the proxy running (
burnguard start) - A
burnguard.yamlin your project directory (runburnguard initto generate one) - An Anthropic API key already working in your application
Configure Anthropic in burnguard.yaml
Theproviders.anthropic.base_url field tells BurnGuard where to forward requests after stripping the /anthropic path prefix. The default value is correct for the public Anthropic API — you only need to change it if you are using a custom endpoint or a private gateway.
Update Your App
Change the base URL your SDK or HTTP client uses to point at BurnGuard instead of the Anthropic API directly. That is the only change required.- Python
- TypeScript
- cURL
ANTHROPIC_API_KEY environment variable is forwarded to Anthropic unchanged. BurnGuard never stores or logs API keys.BurnGuard strips the
/anthropic prefix before forwarding the request. When
you set base_url="http://localhost:8080/anthropic", the SDK appends
/v1/messages and the full path becomes /anthropic/v1/messages. BurnGuard
removes /anthropic, forwarding /v1/messages to api.anthropic.com — the
path Anthropic expects. You do not need to set
base_url="http://localhost:8080/anthropic/v1".Supported Claude Models
BurnGuard uses the pricing table below to calculate the cost of every request. Costs are in USD per one million tokens.| Model | Input / 1M tokens | Output / 1M tokens |
|---|---|---|
claude-fable-5 | $10.00 | $50.00 |
claude-opus-4-5, claude-opus-4-5-20251101, claude-opus-4-6, claude-opus-4-7, claude-opus-4-8 | $5.00 | $25.00 |
claude-sonnet-4-5, claude-sonnet-4-5-20250929, claude-sonnet-4-6 | $3.00 | $15.00 |
claude-haiku-4-5 | $1.00 | $5.00 |
| All other models | $0.80 | $4.00 |
Cache-Aware Pricing
Anthropic’s prompt caching feature stores parts of your prompt context server-side and bills cached tokens at a different rate. BurnGuard reads thecache_creation_input_tokens and cache_read_input_tokens fields from every response and applies the correct multiplier automatically.
| Token type | Field in response | Rate applied |
|---|---|---|
| Standard input | input_tokens | 1.0× (full rate) |
| Cache creation | cache_creation_input_tokens | 1.25× (25% premium) |
| Cache read | cache_read_input_tokens | 0.10× (90% discount) |
claude-sonnet-4-5 (input rate $3.00 / 1M):
- 1,000 standard input tokens → $0.003
- 1,000 cache creation tokens → $0.00375 (1.25×)
- 1,000 cache read tokens → $0.0003 (0.10×)
SSE Streaming Support
BurnGuard fully supports Anthropic’s streaming API ("stream": true). When a response arrives with Content-Type: text/event-stream, BurnGuard wraps the response body in a streaming reader that taps each SSE event as it passes through, extracts token counts from the message_delta and message_stop events, and calculates cost — without buffering the stream or adding measurable latency to your application.
The Anthropic SDK’s stream() and stream_raw() methods both work transparently through the proxy. No additional configuration is needed.