Gateway Routing
The Prism plugin supports two operating modes that control how your Claude API requests are handled.
Telemetry-only mode
Section titled “Telemetry-only mode”Gateway routing: disabled
Your Claude API requests go directly to Anthropic. The plugin only captures telemetry (OTEL logs, metrics, traces) and prompt text — sent to the Prism ingest service in the background.
What you get:
- PRISM scoring and coaching
- Token and cost tracking
- Waste and throttle detection
- All plugin commands work normally
What you don’t get:
- Budget enforcement (soft/hard caps)
- Guardrails (DLP, PII detection, prompt injection guard)
- Request-level access control
Full governance mode
Section titled “Full governance mode”Gateway routing: enabled (default)
Your Claude API requests route through the Optra gateway before reaching Anthropic. The gateway applies policies, then forwards the request.
What you get (in addition to telemetry):
- Budget enforcement — soft warnings and hard blocks at spend limits
- Guardrails — DLP, PII detection, content filtering, prompt injection guard
- Model access control — restrict which models developers can use
- Request logging — full request/response capture at the gateway level
How it works
Section titled “How it works”When gateway routing is enabled, the plugin sets two environment variables on session start via CLAUDE_ENV_FILE:
ANTHROPIC_BASE_URL={gateway_url}ANTHROPIC_CUSTOM_HEADERS=X-Gateway-Api-Key: {api_key}x-prism-source: claude-codeThe gateway URL is resolved automatically from your API key via the config endpoint — you don’t need to configure it manually.
Claude Code picks these up and routes all API calls through the gateway instead of directly to api.anthropic.com.
Toggling
Section titled “Toggling”Switch between modes:
/prism:status toggleThis flips enableGateway in your config and prompts you to restart Claude Code for the change to take effect.
You can also edit the legacy config directly:
{ "enableGateway": false}When to use each mode
Section titled “When to use each mode”| Scenario | Recommended mode |
|---|---|
| Personal use, just want insights | Telemetry-only |
| Team with budget limits | Full governance |
| Enterprise with compliance requirements | Full governance |
| Debugging latency issues | Telemetry-only (removes gateway hop) |
| Air-gapped or restricted network | Telemetry-only |