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.
- Create a dedicated API key and confirm the target model supports Anthropic Messages.
- Run the commands below in the terminal where you start Claude Code.
- 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-modelCodex
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.
- Create an API key and choose a model that supports the Responses API.
- Run the command below and replace the model ID with the actual value.
- 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-modelHermes
Run hermes model, select a custom endpoint and enter the URL, key and model. You can also edit ~/.hermes/config.yaml:
- Run the model configuration command and choose Custom Endpoint.
- Enter the OpenAI-compatible URL, API key and target model ID.
- 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-keyOpenClaw
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.
- Open the OpenClaw configuration and add the llmrouter provider.
- Set the endpoint, API key environment variable and available models.
- 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
- Open settings from the Cline panel.
- Choose OpenAI Compatible and enter the four settings above.
- 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
- Open settings in the Roo Code sidebar.
- Choose OpenAI Compatible and enter the endpoint, key and model ID.
- 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
- applyCreate 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
- Check API key status and balance.
- Confirm the model is published and allowed for the current key.
- Confirm the agent protocol matches the endpoint.
- Review the request ID, error code and provider status in the dashboard.