Documentation Index
Fetch the complete documentation index at: https://docs.llmrouter.app/llms.txt
Use this file to discover all available pages before exploring further.
Roo Code & LLM Router
Roo Code is an intelligent VS Code extension that assists with full-project analysis, code generation, and complex refactoring.
Because Roo Code reads your local filesystem and runs terminal commands, it frequently consumes massive amounts of input tokens. By routing Roo Code through LLM Router, you automatically apply Middle-Out Context Compression to bloated files and ensure your .env secrets are Redacted before they are sent to third-party AI providers like OpenAI or Anthropic.
Important: When using LLM Router with Roo Code, you must configure the
Base URL to point to https://api.llmrouter.app/v1 instead of the default
OpenAI or Anthropic endpoints.
Step 1: Installing the Roo Code Plugin
- Launch VS Code.
- Click the Extensions Marketplace icon on the left sidebar (or press
Cmd+Shift+X).
- Enter
Roo Code in the search bar.
- Click the Install button.
Step 2: Configuring LLM Router Settings
Roo Code allows you to use custom API providers. We will configure it to use the OpenAI-compatible endpoint provided by LLM Router.
Configuration Details
Open the Roo Code settings panel (usually by clicking the gear icon in the Roo Code sidebar) and fill in the following information:
- API Provider: Select
OpenAI Compatible (Do not select OpenAI or Anthropic directly, as we need to override the Base URL).
- Base URL: Enter
https://api.llmrouter.app/v1
- API Key: Enter your LLM Router API Key (e.g.,
sk-router-...). You can generate this in your LLM Router Dashboard.
- Model ID: Enter the specific model you want to use, prefixed with the provider slug.
- Example 1:
anthropic/claude-3-5-sonnet (Highly recommended for coding).
- Example 2:
openai/gpt-4o
Advanced Planning: If you want Roo Code to use our “Chain of Thought”
planning feature for complex refactors, you can set the Model ID to:
anthropic/claude-3-5-sonnet:planning:openai/o1-mini.
Step 3: Permission Setup and Usage
Roo Code will ask for specific workspace permissions. Select the permissions you wish to enable based on your needs:
- File read/write operations
- Auto-approve terminal execution
- Project access permissions
2. Start Coding
Enter your requirements in the Roo Code chat box. Because traffic is now flowing through LLM Router, you will immediately benefit from:
- Token Savings: When Roo Code reads a massive 3,000-line file, LLM Router will dynamically compress the irrelevant middle sections if the context shifts, saving you up to 80% on API costs.
- Security: If Roo Code accidentally reads an AWS Key or Database Password from your local workspace, LLM Router’s PII engine will redact it into
[TOKEN_REDACTED] before sending the code to Anthropic or OpenAI.
- Reliability: If the primary AI provider experiences an outage, LLM Router will automatically fall back to your configured secondary provider without interrupting your VS Code session.