# Cline

> Configure the VS Code AI coding extension's OpenAI Compatible provider to point at this gateway

来源：https://zhonkemodel.dflop.top/en/docs/integrations/cline

> Cline is an AI coding extension for VS Code with native support for a custom API provider.

## Install

```text
VS Code → Extensions → search "Cline" → Install
(Marketplace ID: saoudrizwan.claude-dev)
```

Or visit [marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev).

## Setup

1. Open Cline's settings (extension icon → ⚙️)
2. Set **API Provider** to **OpenAI Compatible**
3. Fill in:
   - Base URL: `https://zhonkezhonkeapi.dflop.top/v1`
   - API Key: `sk-gpushare-<64 hex characters>` (create one at [zhonkemodel.dflop.top/dashboard/keys](https://zhonkezhonkemodel.dflop.top/dashboard/keys); you can re-reveal it on its detail page any time)
   - Model ID: `claude-sonnet-4-6`, or whichever model you want
4. Save and start using it

## Which model to pick

Cline runs multi-file edits and agentic loops, which demand strong reasoning:

| Job | Suggested model |
|---|---|
| Complex refactors / multi-file edits | `claude-opus-4-8`, `claude-opus-4-7` |
| Everyday coding | `claude-sonnet-4-6`, `gpt-5.5` |
| Fast responses | `gemini-2.5-flash`, `grok-4-fast-non-reasoning` |
| Reasoning-heavy work | `grok-4-fast-reasoning`, `deepseek-v4-pro` |
| Long context (large codebases) | `gemini-2.5-pro` (2M), `kimi-k2.6` (256K) |

> Small-context models (the 32K-window tier) are a poor fit for Cline: the system prompt plus multi-file context easily runs to tens of thousands of tokens and overflows the window.

Full list: [Models](../reference/models.md).

## What actually goes through the gateway

Cline speaks the **OpenAI Chat protocol** plus **function tools**. All 103 text models work; whether a given model supports function tools is shown by the `supports_tools` flag in the model list (almost all do). Image, video and embedding SKUs don't use the chat path and aren't applicable to Cline — see [Image / video / music APIs](../reference/media-apis.md).

## Things to know

### Cline plus tool use across vendors

Cline leans heavily on function tools, and the gateway's translation paths support that fully:

- With a Claude model → gateway T1 translation (OpenAI Chat → Anthropic Tool Use)
- With a Gemini model → gateway T2 translation (OpenAI Chat → Gemini Native)
- With GLM / Grok / DeepSeek / Kimi and other OpenAI-compatible upstreams → passed through natively, no translation

See [Tool calling](../guides/tool-calling.md).

### Watching the cost

A single Cline task can make 10–50 model calls, so spend adds up faster than you'd expect. Billing uses **one account balance** (a USD wallet): every API key draws on it and no key has its own budget pool — any key can spend the balance down to zero, so creating a separate key **does not** cap your exposure. What we suggest:

1. Create a dedicated key for Cline — the value is **usage isolation and observability** (per-key billing on the [usage page](https://zhonkezhonkemodel.dflop.top/dashboard/usage)), plus an optional `allowed_models` allowlist
2. Manage keys at [zhonkemodel.dflop.top/dashboard/keys](https://zhonkezhonkemodel.dflop.top/dashboard/keys) and top up at dflop.top/dashboard/billing (Stripe, $1 minimum; sign-up includes $0.30 of trial credit)
3. Prefer cheaper models (`gpt-5.5` over `claude-opus`)

**Watch out for the 402 pre-check**: before calling upstream the gateway estimates this request's **worst-case** cost and returns `402` immediately if it exceeds your balance. Output is estimated as follows: if the client **passes** `max_tokens`, that value is used in full; if it **doesn't**, the estimate is `min(the model's default_max_tokens, 32768)` — a model's real output ceiling can be far higher (128K for gpt-5.x and Claude Opus), and the estimate deliberately doesn't assume the ceiling so low-balance accounts aren't rejected for no reason. For example `claude-opus-4-6` bills output at $75/1M, so without `max_tokens` the worst-case estimate is roughly $2.46 plus input (about $1.47 during the 40%-off promotion). Passing a large explicit `max_tokens` (say 64000) is estimated in full. When your balance is tight: lower Cline's max output tokens, or top up.

## Troubleshooting

| Symptom | What to check |
|---|---|
| 401 `invalid_api_key` | Key invalid, revoked, expired, or the account isn't active; first confirm you copied the whole key |
| 402 `quota_exceeded` | Insufficient balance, or the worst-case estimate exceeds it (see above); lower `max_tokens` or top up |
| 400 `model_not_found` | Model ID spelling — especially Claude models with a date suffix |
| 400 `model_not_allowed` | This key has an `allowed_models` allowlist that excludes the model |
| 403 | Essentially always passed through from upstream; the gateway doesn't generate 403s |
| 503 `no_channel_available` | No channel serves that model on this protocol; switch model and retry, and report it if it persists |
| The task ran away and got expensive | Switch to a cheaper model / lower max_tokens |

Full error list: [Error codes](../reference/errors.md).

## Other clients

- [Claude Code](./claude-code.md) — AI coding on the command line
- [Cursor](./cursor.md) — AI built into the IDE
- [Continue.dev](./continue.md) — VS Code / JetBrains
- [Open WebUI](./open-webui.md) — self-hosted ChatGPT UI
- [FlopCode](./flopcode.md) — this platform's official fork
