AGENT CLIENTS

Connect AI agent clients

No application code is required. Configure the LLMRouter endpoint, API key and model name in your agent client.

Claude Code

Set the Anthropic endpoint and API key in your terminal, then start Claude Code. The selected model must support Messages, tool calls and streaming.

  1. Create a dedicated API key and confirm the target model supports Anthropic Messages.
  2. Run the commands below in the terminal where you start Claude Code.
  3. Send a simple message and confirm that replies and tool calls work.
export ANTHROPIC_BASE_URL=https://api.llmrouter.pro/anthropic
export ANTHROPIC_AUTH_TOKEN=sk-lr-your-key

claude --model your-model

Codex

Set the OpenAI endpoint and API key in the same terminal where you start Codex. Codex uses the Responses API, so select a compatible model.

  1. Create an API key and choose a model that supports the Responses API.
  2. Run the command below and replace the model ID with the actual value.
  3. Ask Codex to inspect the current directory and confirm authentication, model access and tools work.
export OPENAI_BASE_URL=https://api.llmrouter.pro/v1
export OPENAI_API_KEY=sk-lr-your-key

codex --model your-model

Hermes

Run hermes model, select a custom endpoint and enter the URL, key and model. You can also edit ~/.hermes/config.yaml:

  1. Run the model configuration command and choose Custom Endpoint.
  2. Enter the OpenAI-compatible URL, API key and target model ID.
  3. Save, start Hermes and send a simple task to verify the connection.
model:
  default: your-model
  provider: custom
  base_url: https://api.llmrouter.pro/v1
  api_key: sk-lr-your-key

OpenClaw

Add LLMRouter as a custom provider in OpenClaw and set it as the default model. Replace your-model with a model ID from the catalog.

  1. Open the OpenClaw configuration and add the llmrouter provider.
  2. Set the endpoint, API key environment variable and available models.
  3. Set the default model to llmrouter/your-model, restart and verify.
{
  "env": {
    "LLMROUTER_API_KEY": "sk-lr-your-key"
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "llmrouter/your-model"
      }
    }
  },
  "models": {
    "mode": "merge",
    "providers": {
      "llmrouter": {
        "baseUrl": "https://api.llmrouter.pro/v1",
        "apiKey": "${LLMROUTER_API_KEY}",
        "api": "openai-completions",
        "models": [
          {
            "id": "your-model",
            "name": "Your model"
          }
        ]
      }
    }
  }
}

Other agents

If an agent supports a custom endpoint, confirm its compatible protocol first and use the matching URL:

  • OpenAI compatible: https://api.llmrouter.pro/v1
  • Anthropic compatible: https://api.llmrouter.pro/anthropic

Cline

Open the Cline panel in VS Code, go to settings and enter:

API Provider
OpenAI Compatible
Base URL
https://api.llmrouter.pro/v1
API Key
sk-lr-your-key
Model ID
your-model
  1. Open settings from the Cline panel.
  2. Choose OpenAI Compatible and enter the four settings above.
  3. Save and send a test message to confirm the connection.

Roo Code

Open Roo Code provider settings and use the OpenAI-compatible configuration:

API Provider
OpenAI Compatible
Base URL
https://api.llmrouter.pro/v1
API Key
sk-lr-your-key
Model ID
your-model
  1. Open settings in the Roo Code sidebar.
  2. Choose OpenAI Compatible and enter the endpoint, key and model ID.
  3. Save and send a test task in Ask or Code mode.

Continue

Continue can connect through the OpenAI provider apiBase setting. Add this model to config.yaml:

name: LLMRouter
version: 0.0.1
schema: v1

models:
  - name: LLMRouter Model
    provider: openai
    model: your-model
    apiBase: https://api.llmrouter.pro/v1
    apiKey: sk-lr-your-key
    roles:
      - chat
      - edit
      - apply

Create a separate API key for each agent and set model access and budget limits. First create an API key, then check the model catalog for model IDs and compatible protocols.

Troubleshooting order

  1. Check API key status and balance.
  2. Confirm the model is published and allowed for the current key.
  3. Confirm the agent protocol matches the endpoint.
  4. Review the request ID, error code and provider status in the dashboard.