---
title: "Cline integration"
description: "Settings for using Cline with MiniRouter."
canonical_url: "https://minirouter.sh/docs/integrations/cline"
markdown_url: "https://minirouter.sh/docs/integrations/cline.md"
last_updated: "2026-09-26"
---

# Cline

Run the Cline coding agent on any model in the MiniRouter catalog.

[Get a key](https://minirouter.sh/key)

[Cline](https://cline.bot) is an open-source coding agent for VS Code and the terminal. Its OpenAI Compatible provider sends requests to MiniRouter's [Chat Completions endpoint](https://minirouter.sh/docs/parameters), so Cline runs on any tool-capable model in the [catalog](https://minirouter.sh/models), a [preset](https://minirouter.sh/docs/presets) or a [router](https://minirouter.sh/docs/auto-router), with one balance and per-key [spend limits](https://minirouter.sh/docs/rate-limits).

## Quick start

### 1. Install Cline

**VS Code**

Open Extensions with Cmd+Shift+X or Ctrl+Shift+X, search for Cline and click Install.

**CLI**

```sh
npm i -g cline
```

### 2. Check the key

[Create a key](https://minirouter.sh/key), export it as `MINIROUTER_KEY`, then send one request outside Cline.

```sh
curl https://api.minirouter.sh/v1/chat/completions \
  -H "Authorization: Bearer $MINIROUTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"zai/glm-5.3-flash","messages":[{"role":"user","content":"ping"}]}'
```

> **Tip:** Give Cline its own key, so its spend shows separately in [Usage](https://minirouter.sh/dashboard/usage) and a limit stops only Cline.

### 3. Enter the settings

Open Cline sidebar → ⚙ Settings → API Configuration.

| Setting | Value |
| --- | --- |
| `API Provider` | OpenAI Compatible |
| `Base URL` | `https://api.minirouter.sh/v1`. The bare host also works. Never append /chat/completions. |
| `API Key` | `mr-live-… (your key)` |
| `Model ID` | `zai/glm-5.3-flash`. Use an ID from /models. For no-deposit testing, choose minirouter/auto:free when listed; quotas and supported request features apply. |

### 4. Run a task

Ask Cline for a small change. Then open [Activity](https://minirouter.sh/dashboard/activity). The request lists its model, tokens and exact cost.

## Match the context window

1. **Open**: Model Configuration under the OpenAI Compatible provider.
2. **Copy**: Context window and output limit from the model's page in [Models](https://minirouter.sh/models).
3. **Save**: Cline now manages context against the real window.

## Plan and Act models

In API Configuration, tick Use different models for Plan and Act modes. Then set a Model ID on each tab.

| Mode | Model ID |
| --- | --- |
| Plan | `openai/gpt-5.6-sol`. Stronger reasoning for the plan. |
| Act | `zai/glm-5.3-flash`. Cheaper model for the edits. |

Check [Activity](https://minirouter.sh/dashboard/activity) after switching modes. Each request shows the model that answered.

## Routers and presets

Type any of these into Model ID.

| Model ID | Uses |
| --- | --- |
| `minirouter/auto:code` | Picks a model with reliable tool calling. See [Auto router](https://minirouter.sh/docs/auto-router). |
| `minirouter/fusion` | Picks the model and effort from the request. See [Fusion](https://minirouter.sh/docs/fusion). |
| `@preset/your-slug` | Your saved models and instructions. Edit them in [Presets](https://minirouter.sh/dashboard/presets). |

## Cline CLI

`cline auth` runs the same provider setup as the extension. Choose OpenAI Compatible and enter the values above.

```sh
cline auth
cline -m zai/glm-5.3-flash "Run tests and fix failures"
```

| Flag | Does |
| --- | --- |
| `-m` | Model ID for this run. |
| `-p` | Starts in Plan mode. |
| `--json` | Streams NDJSON. |
| `-y` | Skips approvals and exits when done. |

> **Warning:** `-y` runs every tool without asking. Give CI its own key with a spend cap.

## Keep spend in check

- [Own key](https://minirouter.sh/dashboard/keys): One key per person or pipeline.
- [Spend cap](https://minirouter.sh/docs/rate-limits): Daily or monthly limit on that key.
- [Activity](https://minirouter.sh/dashboard/activity): Every request and its cost.

Restrict models or filter content with [Guardrails](https://minirouter.sh/docs/guardrails).

## Recommended models

| Model | Why |
| --- | --- |
| [`zai/glm-5.3-flash`](https://minirouter.sh/models/zai/glm-5.3-flash) | Best current balance of coding ability, agentic performance, context and cost. |
| [`openai/gpt-5.6-sol`](https://minirouter.sh/models/openai/gpt-5.6-sol) | Higher-intelligence option when task quality matters more than spend. |
| [`spacexai/grok-4.6`](https://minirouter.sh/models/spacexai/grok-4.6) | Strong agentic alternative with a 500K-token window. |
| [`google/gemini-3.8-flash`](https://minirouter.sh/models/google/gemini-3.8-flash) | Multimodal coding alternative with a 1M-token window. |

Browse every model in the [catalog](https://minirouter.sh/models).

## Troubleshooting

### 404, HTML, or a parse error on every request

Almost always the base URL. Use https://api.minirouter.sh/v1 — the bare host without /v1 also works, but never append /chat/completions to the base URL field; the client adds that path itself.

Error: [400 `invalid_request`](https://minirouter.sh/docs/errors#invalid_request).

### 401 on every request

Wrong or rotated key. Keys start with mr-live-; after a rotation the old key keeps working for 24 hours, then dies.

Error: [401 `invalid_api_key`](https://minirouter.sh/docs/errors#invalid_api_key).

### 402 before any tokens arrive

Balance below the estimated cost of the request. Top up (from $0.50 with direct Solana payments) — and watch the x-minirouter-balance-usd header, the low-balance signal every response carries.

Error: [402 `insufficient_credits`](https://minirouter.sh/docs/errors#insufficient_credits).

### Model picker shows no minirouter models

The OpenAI Compatible provider takes a typed Model ID rather than fetching a list. Type the id exactly, author/name — e.g. zai/glm-5.3-flash.

Every error code, with its fix: [Errors](https://minirouter.sh/docs/errors).

## Next steps

- [Presets](https://minirouter.sh/docs/presets): Save a model and its settings under one name.
- [Guardrails](https://minirouter.sh/docs/guardrails): Budgets and model lists per key.
- [Auto router](https://minirouter.sh/docs/auto-router): Let MiniRouter pick the model.
