Use with Cline CLI
Cline is an autonomous coding agent that runs in VS Code. It sends prompts to an OpenAI-compatible API, which means it works with Routor out of the box. This guide shows you how to point Cline at Routor so every task - from a quick refactor to a multi-file architecture change - routes to the right model automatically. Roo Code (the Cline fork) uses the same configuration.Why Use Routor with Cline
Cline is token-heavy. A single task can burn through tens of thousands of tokens across tool calls, file reads, and retries. Sending all of that to one expensive model adds up fast. Routor fixes this by routing each request to the best-value model for the job. A simple “fix this typo” hits a cheap model. A complex “refactor this auth system” hits a strong one. You keep Cline’s full capabilities while cutting costs 25 to 70 percent.Setup
1. Get your API key
- Sign up at routor.ai
- Go to API Keys in the dashboard
- Create a key. It starts with
sk-routor-
2. Configure Cline
Open Cline’s settings in VS Code and set up an OpenAI-compatible provider:| Setting | Value |
|---|---|
| API Provider | OpenAI Compatible |
| Base URL | https://api.routor.ai/v1 |
| API Key | sk-routor-YOUR_KEY_HERE |
| Model | auto |
3. (Optional) Use the Anthropic-compatible endpoint
Cline also supports the Anthropic Messages API format. Routor exposes an Anthropic-compatible endpoint at/v1/messages, so you can use it directly:
| Setting | Value |
|---|---|
| API Provider | Anthropic |
| Base URL | https://api.routor.ai |
| API Key | sk-routor-YOUR_KEY_HERE |
| Model | auto |
Recommended: Set a Tier Floor
Cline tasks are almost always coding tasks. Without a floor, a trivial request might route to a NANO or SIMPLE tier model that is too weak for agentic coding. Set a tier floor so every request uses at least a capable model:Option A: In the request (per-task)
Cline does not let you set custom request body fields in its UI. Use a Routing Profile instead.Option B: With a Routing Profile (recommended)
- Go to Playground in the Routor dashboard
- Create a profile named “cline” with:
- Tier floor:
STANDARD(ensures capable coding models) - Tier ceiling:
COMPLEX(allows the strongest models when needed)
- Tier floor:
- Copy the profile’s dedicated API key
- Use that key in Cline’s settings instead of your main key
How Routor Handles Cline’s Requests
Cline wraps every request in agent scaffolding: a<task> block, an <environment_details> file dump, and tool-result blocks. This is noise that can confuse a naive router.
Routor strips this scaffolding before classification. It extracts the actual user instruction, classifies that, and routes based on the real task - not the wrapper. The full prompt (including file contents) is still sent to the model. Only the classification uses the cleaned text.
Routor also detects Cline’s tool definitions and routes to tool-capable models ranked by BFCL function-calling accuracy.
Verifying It Works
Send a task to Cline and check the dashboard. You will see:- The model Routor picked for each request
- The tier it was classified into
- The cost and savings vs the baseline
Cost Comparison
A typical Cline session on a direct Claude Opus 4.8 connection might look like:| Task | Tokens | Cost on Opus 4.8 direct |
|---|---|---|
| Fix a small typo | 12,000 | $0.30 |
| Add a unit test | 28,000 | $0.70 |
| Refactor auth system | 85,000 | $2.13 |
| Session total | $3.13 |
| Task | Routed model | Cost with Routor |
|---|---|---|
| Fix a small typo | Claude Sonnet 4.6 | $0.08 |
| Add a unit test | Kimi K2.6 | $0.03 |
| Refactor auth system | Claude Opus 4.8 | $2.13 |
| Session total | $2.24 |
Troubleshooting
Cline says the model is invalid. Make sure the model field is set toauto, not a specific model name. Routor’s auto mode is what triggers routing.
Responses feel too weak. Your tier floor is too low (or not set). Create a profile with a STANDARD or COMPLEX floor as described above.
Responses are too expensive. Your tier floor is too high. Lower it to LIGHT or remove it entirely to let Routor pick the cheapest capable model for each task.
Tool calls fail. Routor automatically filters to tool-capable models when tools are present. If a specific tool call fails, it is likely a provider issue, not a routing issue. Check the Provider Health page.