Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Gateway Routing

The Prism plugin supports two operating modes that control how your Claude API requests are handled.

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

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

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-code

The 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.

Switch between modes:

Terminal window
/prism:status toggle

This 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
}
ScenarioRecommended mode
Personal use, just want insightsTelemetry-only
Team with budget limitsFull governance
Enterprise with compliance requirementsFull governance
Debugging latency issuesTelemetry-only (removes gateway hop)
Air-gapped or restricted networkTelemetry-only