Fuselee

Using Fuselee

Route Claude Code / Codex through Fuselee

One environment variable puts your coding agent behind the gateway: attribution, loop killer, response cache, session caps. Attribution and metering on every plan; the guard rails on Pro and Team.

One env var

Issue an fsl_ gateway key on the provider page (proxy mode; the provider’s inference key must be saved in Connect Provider). Then point the tool at the Fuselee gateway instead of the provider. Your fsl_ key goes where the provider key used to go.

# Claude Code (Anthropic)
export ANTHROPIC_BASE_URL=https://<your-worker>/gateway/anthropic
export ANTHROPIC_API_KEY=fsl_...

# Codex / OpenAI SDKs
export OPENAI_BASE_URL=https://<your-worker>/gateway/openai/v1
export OPENAI_API_KEY=fsl_...

# optional: label the project on every request
export FUSELEE_PROJECT=my-repo   # sent as X-Fuselee-Project by tools that forward extra headers

What Dev Guard does with the traffic

  • Attribution: every request is tagged with the tool (from the User-Agent: claude-code, codex, cursor, SDKs) and a project (X-Fuselee-Project header, or the label on the key).
  • Exact metering: tokens and cost come only from the provider’s usage block, for JSON and for streamed responses (Anthropic message_start/message_delta; OpenAI streams need stream_options.include_usage). A response without a usage block is recorded as unmetered, never estimated.
  • Loop killer: N near-identical prompts (whitespace, case and sampling settings ignored) inside a sliding window pause the key with a 429 and an instant alert that ignores quiet hours; one click resumes it. Keys whose connection is on a never-touch list are alerted, never paused.
  • Response cache (opt-in per key): byte-identical, non-streaming requests are served from cache for the TTL; each hit is booked as an exact saving of the original response’s tokens and cost.
  • Session caps: a daily cap per key with the budget thresholds (warn 50%, alert 80%, pause at 100%), computed from exact metered cents.
  • Savings ledger + digest: exact cache savings and labelled loop estimates are never summed into one number; a daily digest (weekly on Mondays) goes through your notification channels.

Session audit

The Dev Guard page shows, per key: the context-bloat trend (average input tokens per request per day), the model mix with overkill hints (premium models answering in a few tokens), the duplicate rate, cache hits and stopped loops.