Synrouter Docs

Agent clients

Most agent clients only need a compatible base URL and a Synrouter API key. Switch your API endpoint to Synrouter and keep your existing client setup — no code changes required.

Compatibility modes

OpenAI-compatible

Use https://synrouter.ai/api/v1 for any client that speaks the OpenAI Chat Completions protocol.

Anthropic-compatible

Use https://synrouter.ai/api/anthropic for clients that speak the Anthropic Messages protocol.

Claude Code

Claude Code uses the Anthropic Messages API. Set the base URL to Synrouter and use your sk-sr-* key.

bash
1# Set in ~/.claude/settings.json or environment
2export ANTHROPIC_API_KEY="sk-sr-..."
3export ANTHROPIC_BASE_URL="https://synrouter.ai/api/anthropic"

Codex CLI

Codex CLI supports custom model providers. Add Synrouter as a provider in your Codex configuration file.

toml
1[model_providers.synrouter]
2name = "Synrouter"
3base_url = "https://synrouter.ai/api/v1"
4api_key = "sk-sr-..."
5wire_api = "chat"

OpenAI-compatible environment variables

Most CLI tools and SDK-based agents read these standard environment variables. Works with Codex, Kilo Code, Hermes, and any OpenAI SDK-based agent.

bash
1export OPENAI_API_KEY="sk-sr-..."
2export OPENAI_BASE_URL="https://synrouter.ai/api/v1"

Anthropic-compatible environment variables

For Anthropic SDK-based agents like Claude Code:

bash
1export ANTHROPIC_API_KEY="sk-sr-..."
2export ANTHROPIC_BASE_URL="https://synrouter.ai/api/anthropic"

Hermes

Hermes is an open-source general-purpose agent. Configure it via environment variables pointing to Synrouter.

bash
1# Hermes agent configuration
2OPENAI_API_KEY=sk-sr-...
3OPENAI_BASE_URL=https://synrouter.ai/api/v1

Kilo Code

Kilo Code is a VS Code extension for AI-assisted coding. Update settings to route through Synrouter.

json
1# Kilo Code settings
2"kilo-code.apiKey": "sk-sr-...",
3"kilo-code.baseURL": "https://synrouter.ai/api/v1"

Model selection

Pick a model ID from GET /v1/models. For OpenAI endpoints, use any model ID. For Anthropic endpoints, use an Anthropic model:

  • OpenAI-compatible: deepseek/deepseek-v4-flash, openai/gpt-5.5, google/gemini-3.5-flash
  • Anthropic-compatible: anthropic/claude-sonnet-X.X, anthropic/claude-opus-X.X