---
title: "Cline"
description: "In Cline, set API Provider to OpenAI Compatible, the Base URL to https://api.pirouter.ai/v1, and enter your pirouter API key and a model ID; the extension and the CLI then both run through pirouter."
canonical: "https://pirouter.ai/docs/integrations/cline"
last-updated: "2026-10-18"
lang: "en"
source: "content/docs/en/integrations/cline.mdx"
---

# Cline

In Cline, set API Provider to OpenAI Compatible, the Base URL to https://api.pirouter.ai/v1, and enter your pirouter API key and a model ID; the extension and the CLI then both run through pirouter.

[Cline](https://github.com/cline/cline) connects to pirouter through its **OpenAI Compatible** provider: the Base URL is `https://api.pirouter.ai/v1`, the API Key is your pirouter key, and the Model ID is a full pirouter model ID. No Cline account is needed. The VS Code extension and the Cline CLI share one configuration, so setting it up in one makes it work in the other.

## Prerequisites

- A pirouter API key. If you do not have one, create it with the [quickstart](https://pirouter.ai/docs/quickstart.md) and store it in an environment variable:

```bash
export PIROUTER_API_KEY="sk-pi-..."
```

- One of the following:
  - The Cline extension installed in VS Code.
  - The Cline CLI, which needs Node.js 20 or later: `npm install -g cline`. The CLI part of this page was verified with Cline CLI 3.0.73.

## Configure

Requests go to `POST /v1/chat/completions`. For the models you can use, see the OpenAI column of the protocol table in [Models & protocols](https://pirouter.ai/docs/models.md#which-protocols-each-model-accepts); Claude, GPT and Gemini are all there.

### VS Code extension

1. Open the Cline sidebar and click ⚙️ to open its settings.
2. Set **API Provider** to **OpenAI Compatible**.
3. Set **Base URL** to `https://api.pirouter.ai/v1`. Stop at `/v1`; do not add `/chat/completions`.
4. Set **API Key** to your pirouter key.
5. Set **Model ID** to a full model ID, such as `anthropic/claude-sonnet-5.5`.

![Illustration: the Cline settings panel with API Provider set to OpenAI Compatible, Base URL https://api.pirouter.ai/v1 and Model ID anthropic/claude-sonnet-5.5](/docs/shots/cline-settings.en.svg)

The image above is an illustration of the extension settings drawn from Cline's official docs, not a screenshot. Your installed version may look different.

### Cline CLI

In a terminal where `PIROUTER_API_KEY` is set, run once:

```bash
cline auth -p openai-compatible -k "$PIROUTER_API_KEY" -m anthropic/claude-sonnet-5.5 -b https://api.pirouter.ai/v1
```

This writes the provider, Base URL, key and model to `~/.cline/data/settings/providers.json`. The VS Code extension reads the same file, so once the CLI is set up, the extension has the same settings. The key is stored in this file in plain text: keep it out of your repositories and do not share it.

## Verify

Run with the CLI:

```bash
cline --json "Reply with exactly: OK"
```

You should see one JSON event per line. In the line whose `type` is `run_result`, `finishReason` is `completed` and the model's reply is `OK`.

To check in the VS Code extension, send `Reply with exactly: OK` from the Cline sidebar; the reply should be `OK`.

The request shows up in the console's [Logs](https://pirouter.ai/docs/guides/logs.md) with `/v1/chat/completions` under **Endpoint**.

## Troubleshooting

### The Anthropic provider takes no custom address

On the CLI, `cline auth -p anthropic` with `-b` fails straight away:

```text
error: base URL is only supported for OpenAI and OpenAI-compatible providers
```

The result is the same for `https://api.pirouter.ai` and `https://api.pirouter.ai/v1`. Use OpenAI Compatible for Claude models too, configured as above.

### 400 from GPT models

When a GPT model gets tools and `reasoning_effort` in the same request, the upstream may reject it with a `400` and "Function tools with reasoning\_effort are not supported". Almost every Cline task carries tools, so if you hit this, turn reasoning off (for example `--thinking none` on the CLI) or pick another model.

### The model writes tool calls as text instead of calling tools

Cline 4.1.11 had a regression: when a custom model's capabilities did not list tools, Cline sent no tool definitions, and the model had to write tool calls into its reply as text. Update Cline to the latest version. If it still happens, delete `~/.cline/data/settings/providers.json` so Cline rebuilds it, then configure it again as above.

## Not verified yet

- The VS Code extension's settings screen itself. The extension steps on this page follow Cline's official docs; the request path was verified with the CLI, which shares the same configuration.
- Choosing **Anthropic** as the API Provider in the extension with a custom base URL, to reach pirouter over `/v1/messages`.

## Related links

- [Cline](https://github.com/cline/cline) on GitHub
- [Cline extension](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev) on the VS Code Marketplace
- [OpenAI Compatible](https://docs.cline.bot/provider-config/openai-compatible): Cline's docs for the OpenAI Compatible provider
- [CLI reference](https://docs.cline.bot/cli/cli-reference): `cline auth` and run options
- [Configuration](https://docs.cline.bot/getting-started/config): the `~/.cline` directory and `providers.json`
