Loading
Skip to content
RedRouterRedRouter
Dashboard ↗

Claude Code

Run Claude Code against RedRouter's Messages-compatible endpoint with an explicit text model. The setup below is a configuration recipe, not a live-tested compatibility result.

Install and set the gateway

Install Claude Code with the official macOS/Linux installer, or follow its installation guide for your platform:

curl -fsSL https://claude.ai/install.sh | bash
export REDROUTER_API_KEY="your-redrouter-api-key"
export ANTHROPIC_BASE_URL="https://redrouter.org"
export ANTHROPIC_AUTH_TOKEN="$REDROUTER_API_KEY"
export ANTHROPIC_API_KEY=""
export ANTHROPIC_MODEL="red-cyber-1"
export ANTHROPIC_DEFAULT_SONNET_MODEL="red-cyber-1"
export ANTHROPIC_DEFAULT_OPUS_MODEL="red-cyber-1"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="red-cyber-1"
export ANTHROPIC_DEFAULT_FABLE_MODEL="red-cyber-1"
export CLAUDE_CODE_SUBAGENT_MODEL="red-cyber-1"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"

Use the origin without /v1: Claude Code appends /v1/messages. Mapping the model tiers keeps model aliases on an explicit RedRouter catalog ID. These settings do not make the model a Claude model or grant access through an Anthropic subscription.

Start in a project you intend to share with the model:

claude --model red-cyber-1 --permission-mode plan \
  -p "Read this project's README and describe its purpose. Do not edit files or run commands."

Expected result: Claude Code returns a text description through RedRouter. Review proposed tool use in the client. Keep manual permissions enabled; RedRouter does not supply server-side tool safety classification.

Understand the adapter

The Messages adapter translates system text, conversation turns, tool declarations, tool calls, and tool results. Your local Claude Code process executes permitted tools. RedRouter does not execute terminal commands, fetch web pages, or run hosted Anthropic tools.

red-cyber-1 supports tool calling and structured output, but it cannot inspect images. Supply source text or descriptions instead of screenshots. Other models may support image input.

Thinking settings, effort, and cache-control markers are accepted for compatibility and ignored. They do not establish a reasoning budget or reserve a prompt cache. Read reasoning and prompt caching for the actual behavior. Token counting is a conservative estimate, not exact tokenizer output.

Resolve startup and agent failures

  • A 401 usually means the exported key is missing, revoked, or for another service. Use your RedRouter key as ANTHROPIC_AUTH_TOKEN.
  • A 404 can come from a doubled /v1/v1 path. Keep ANTHROPIC_BASE_URL at the origin.
  • A 400 naming safeguards means the client requested unavailable server-side safety classification. Select a manual permission mode.
  • A truncated tool call needs a shorter task or smaller tool output. The model's output cap still applies during streaming.

Client releases can introduce new request fields. Save the client version and RedRouter request ID when reporting an issue, without sharing your key or sensitive prompt content. See troubleshooting and data handling.

References: Claude Code installation, gateway connection, and gateway protocol.

↑ ↓ to select · Enter to open · Esc to close