Connecting Claude Code, Codex, Cursor & Testing Failover
Wire Claude Code, Codex CLI, OpenAI SDKs, and Cursor/GUI clients to http://127.0.0.1:41990/r/<slug>, run the 1-click Offline Failover Demo, and read the metadata-only Activity log.
1-Click Client Snippets & Live Route Test
Open your route in AI Failover (⇧⌘A) and click Agent Setup… (or Setup Guide in the toolbar) to copy pre-populated environment variables, JSON config, or a streaming cURL test command.

Claude Code expects ANTHROPIC_BASE_URL without /v1 (http://127.0.0.1:41990/r/claude-code), because it appends /v1/messages. Codex / OpenAI SDKs expect OPENAI_BASE_URL with /v1 (http://127.0.0.1:41990/r/codex/v1), because they append /chat/completions or /responses.
Shell or ~/.claude/settings.json — bashexport ANTHROPIC_BASE_URL="http://127.0.0.1:41990/r/claude-code"export ANTHROPIC_AUTH_TOKEN="<your-local-gateway-token>"
Run /status inside Claude Code to verify the active base URL is http://127.0.0.1:41990/r/claude-code.
Testing Without API Keys: The 1-Click Offline Failover Demo
Before configuring real keys, click Offline Demo in the AI Failover toolbar (or Run Offline Failover Demo in the empty state). Netspector spins up two ephemeral mock servers on 127.0.0.1—Mock Primary returning HTTP 529 Overloaded and Mock Fallback streaming HTTP 200 SSE—runs a real request through AIGatewayEngine, and verifies circuit breaking end-to-end.

Inspecting Metadata-Only Failover Activity
Select Failover Activity in the AI Failover sidebar to review request outcomes, fallback chains, HTTP status codes, and Time-To-First-Token (TTFT) timings. Only routing metadata is recorded—prompts and model responses never touch disk.
