# Cline + NezhaGate: Code with DeepSeek, Kimi, GLM, Qwen

Set up Cline in VS Code with NezhaGate as an OpenAI-compatible provider and code with DeepSeek, Kimi, GLM, Qwen or Claude on one key. Cost tips included.

> https://nezhagate.com/es/docs/integrations/cline

## What you need

- **VS Code** installed (Windows, macOS or Linux).

- A NezhaGate account and API key (step 1 shows you how).

- About 10 minutes.

## Step 1: Sign up for NezhaGate and create an API key

1. Open [nezhagate.com](https://nezhagate.com/es/) and click **Sign up free** in the top-right corner. Email works, and so does one-click sign-in with Google or GitHub.

2. Go to **Console → API Keys**. Under **Create API Key**, name the key (for example `cline`). Cline calls the model many times in a row, so set a **Per-Key Limit** (say 5) to keep a runaway task from overspending. Then click **Create Key**.

3. A key starting with `sk-` appears. **Copy it right away**: it is shown only once.

Check and top up your balance on the **Billing** page. You pay only for what you use, and failed requests are never billed. Per-model rates are on the [pricing page](https://nezhagate.com/es/pricing).

## Step 2: Install Cline in VS Code

1. Open VS Code and press `Ctrl+Shift+X` (`Cmd+Shift+X` on macOS) to open Extensions.

2. Search for **Cline**, make sure the publisher is saoudrizwan, and click **Install**.

3. When it finishes, click the new Cline icon in the left activity bar to open the Cline panel.

Prefer the command line? This does the same:

```
code --install-extension saoudrizwan.claude-dev
```

## Step 3: Point Cline at NezhaGate

1. On first launch Cline asks **How will you use Cline?**. Choose **Bring my own API key** and click **Continue** to reach the provider setup. (To change it later: the gear at the top right of the Cline panel → **API Configuration**.)

2. **API Provider**: search for and select **OpenAI Compatible**.

3. **Base URL**: enter the address below.

```
https://nezhagate.com/v1
```

1. **OpenAI Compatible API Key**: paste the key from step 1.

2. **Model ID**: the list loads by itself; pick `deepseek-v4.1-flash`. If the model you want is not listed, choose **Use custom model ID…** and type its ID.

3. Expand **MODEL CONFIGURATION**:

   - **Supports Images**: **untick** it for DeepSeek, GLM, Kimi and Qwen (they do not read images); keep it ticked for Claude.

   - **Context Window Size**: keep the default 128000.

   - **Input Price / 1M tokens** and **Output Price / 1M tokens**: optionally copy them from the [pricing page](https://nezhagate.com/es/pricing) (US dollars per million tokens). They only drive the cost Cline displays, not what you are billed; left empty, Cline shows $0.

4. Click **Continue** (or close the settings) to save.

Stop the address at `/v1`; do not add `/chat/completions`.

## Step 4: Run your first task

1. Open a folder in VS Code (an empty one is fine).

2. Next to Cline's task box (Type your task here...), pick a mode: **Plan** works out an approach with you first; **Act** gets straight to changing code. Use Act for this first run.

3. Type `Create hello.py that prints Hello, NezhaGate` and press Enter.

4. Before Cline writes a file or runs a command it asks for your approval. Look over what it proposes and approve it. When it is done, `hello.py` is in your folder.

## Recommended models

Cline relies on **tool calling** (function calling) to read and write files and run commands. All of these support it:

| Model ID | Best for | Notes |
| --- | --- | --- |
| `deepseek-v4.1-flash` | Everyday coding at the lowest cost | Thinks before acting by default; cheap enough for most tasks. |
| `glm-5.3` | Coding and agent tasks | The GLM-5 flagship, built for coding and agent workflows; always thinks first. |
| `kimi-k3` | Big projects, long context | Strong long-context understanding and tool use; supports prompt caching. |
| `qwen3.7-max` | Hard reasoning and coding | Dependable in English and Chinese; supports prompt caching. |
| `claude-opus-5` | The hardest engineering work | The steadiest on complex engineering and agents; priced higher. |

A thrifty setup: tick **Use different models for Plan and Act modes**, plan with `kimi-k3` or `glm-5.3`, and let `deepseek-v4.1-flash` do the work in Act mode.

## About cost

- At every step Cline sends the task's context to the model again, so token use grows quickly on long tasks. Start a new task when one is finished instead of continuing in the same one.

- Kimi K3, Qwen3.7 Max and GLM-5.3 support prompt caching: a repeated long prefix is billed at the cache rate, far below the normal input rate.

- The per-key limit from step 1 is the simplest safety net: once it is reached, requests return 402 and nothing more is charged.

## Common problems and errors

| What you see | What to do |
| --- | --- |
| The Model ID list fails to load, and an Enter Model ID... box appears with an error | Check the Base URL and key. You can also type the model ID straight into the box, for example `deepseek-v4.1-flash`. |
| 401 | The key is wrong or was deleted. Create a new one in the console and copy it. |
| 402 | Your balance ran out, or the key hit the limit you set. Top up on the Billing page or raise the key's limit. |
| 404 | The Base URL ends in `/chat/completions`. Change it to `https://nezhagate.com/v1`. |
| 400 mentioning an image | The model cannot read images: untick Supports Images under MODEL CONFIGURATION. |
| Cline keeps failing or tool calls break | Switch to one of the models above. Image and video models do not work in Cline. |
| Cost always shows $0 | Expected when no prices are filled in; your real spend is in the NezhaGate console. |

Still stuck? See the [API docs](https://nezhagate.com/es/docs-guide) or the [FAQ](https://nezhagate.com/es/faq).
