Cline · VS Code autonomous agent

Cline + Leanroute

Cline plans, edits files, runs commands, and iterates — all through tool calls. Streaming tool calls translate fully through Leanroute for OpenAI, Anthropic, Google, and every OpenAI-compatible APAC provider, so Cline gets the same agentic experience regardless of which underlying model you pick.

1. Get a gateway key

From /dashboard/keys create a key labeled "cline". Cline runs multi-step plans that can chew through tokens fast — set a daily spend cap on the key (e.g. $5/day) to keep a runaway loop from emptying your balance overnight.

2. Configure Cline's API provider

In VS Code, open the Cline sidebar (the chat-bubble icon). Click the settings gear at the top right and pick API Configuration.

  • API Provider: OpenAI Compatible
  • Base URL: https://api.leanroute.dev/v1
  • API Key: your gw_live_* key.
  • Model ID: the canonical provider/model. Anthropic Sonnet for the strongest agentic workflows: anthropic/claude-sonnet-4-6. DeepSeek-V3 for cost-optimized runs: deepseek/deepseek-v3.
  • Click Done to save. Cline persists the config across VS Code restarts.

3. Run your first task

Open Cline's sidebar, type a task like "Add an input validation function to src/utils.ts", and watch Cline plan, ask for tool-use approvals, and edit files. Each tool call streams through our SSE bridge with the OpenAI tool_calls delta format that Cline expects.

Model recommendations

  • Best agentic behavior — anthropic/claude-sonnet-4-6. Cline plans well and respects the ask-before-acting contract. Reliable tool use across multi-step refactors.
  • Cost-optimized — deepseek/deepseek-v3. ~3× cheaper than Sonnet. Tool calls work; the agent is slightly more eager to run commands without confirmation — keep Cline's "approve-each" safety flag on.
  • Long-context tasks — google/gemini-2.5-pro. When Cline has to load a big tree of context. Streaming tool-call translation is in place.

Troubleshooting

  • Cline says "tool call malformed": the model you picked likely doesn't support tool calls or the format is unstable. Try anthropic/claude-sonnet-4-6 first — it's the most reliable.
  • 429 from gateway: your RPM cap kicked in. Loosen at /dashboard/settings or wait for the rolling window.
  • 402 insufficient_credit: top up at /dashboard/billing. Cline shows the error in the chat panel.
  • Cost surprise after a session: agentic loops can spike. Set a daily cap on Cline's API key (e.g. $5/day) at /dashboard/keys.