Cline: connecting to Claude and GPT with your own key

Cline can talk to a gateway in either Anthropic mode or OpenAI mode, and the base URL depends on which one you pick. Both paths, plus the 404 that trips people up first.

5 min · · Updated · IDE

Cline is a VS Code extension that can talk to a compatible API instead of an official Anthropic or OpenAI account. It has two separate providers with overlapping model names, and that's exactly why people mix up the base URL on first setup.

Which provider to pick

Open the gear icon in the Cline panel to get to API Configuration. Two entries in the API Provider dropdown matter here:

  • Anthropic — for Claude models over the Anthropic-compatible protocol (/v1/messages).
  • OpenAI Compatible — for GPT, GLM, or Claude again, but over /v1/chat/completions.

These are different protocols with different request bodies, and the base URL differs too:

  • Anthropic provider: https://api.zukko.pro — no /v1, Cline appends the path itself.
  • OpenAI Compatible: https://api.zukko.pro/v1 — with the suffix.

A mismatched suffix is the single most common cause of a 404 on first connection: the key is accepted, but every request lands on a path that doesn't exist.

Setting it up with the Anthropic provider

  1. API Provider: Anthropic.
  2. Anthropic API Key: your fetch_... key from https://zukko.pro/app/api-keys.
  3. Turn on "Use custom base URL" and enter https://api.zukko.pro.
  4. Model: claude-sonnet-5 or claude-opus-5-5 (Claude Opus 5.5; both have a 1,000,000-token context and accept images).

Keys are shown only once at creation. If you're not sure you copied the right one, issue a new one from the dashboard instead of guessing.

Setting it up with OpenAI Compatible

  1. API Provider: OpenAI Compatible.
  2. Base URL: https://api.zukko.pro/v1.
  3. API Key: the same fetch_... key.
  4. Model ID: for example gpt-5.6-sol, gpt-5.6-luna, glm-5.3, or glm-5.3-flash (current list: GET https://api.zukko.pro/v1/models).

This is the easiest way to switch between model families — just change the Model ID field, no need to touch the provider.

Testing the key outside of Cline

Before troubleshooting why Cline isn't responding, hit the key directly — it rules out half the possible causes:

bash
curl https://api.zukko.pro/v1/chat/completions \
  -H "Authorization: Bearer fetch_your_key" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-5","messages":[{"role":"user","content":"ping"}]}'

If curl answers but Cline doesn't, the problem is in the extension's config — wrong provider selected, a stray space in the Base URL field, or a stale cached setting. If curl doesn't answer either, the error body will tell you exactly what to fix.

Reading the common errors

  • 401 — key rejected: {"error":{"message":"Invalid API key. Use Authorization: Bearer fetch_*","type":"authentication_error"}}. Check the key isn't truncated or padded with a trailing space.
  • 402 — empty balance: {"error":{"message":"Недостаточно средств на балансе","code":"insufficient_balance"}}. The balance check happens before the request reaches the model, so a failed attempt costs nothing.
  • 404 model_not_found — a typo in the Model ID. Get the current list without a key: curl https://api.zukko.pro/v1/models.
  • 400 model_retired — the model has been retired; the response names its replacement.
  • 503 model_disabled — the model is disabled in the catalog; pick another one from /v1/models.
  • 429 — from Zukko this only means a per-key limit (key_daily_limit_reached, which resets at 00:00 UTC, or key_monthly_limit_reached) if you set one on the key's page in the dashboard; the gateway has no general rate limit, and any other 429 comes from the model provider.

Details that matter specifically in an IDE agent loop

Cline fires off a lot of consecutive requests while working agentically, so spend is worth tracking. Note that Cline receives responses as a stream (stream: true), while the X-Zukko-Cost-Micros and X-Fetch-Balance-Cents cost headers only come back on regular (non-streaming) JSON responses. So for Cline:

  • per-request spend — in the dashboard ("Usage") or via GET /v1/usage;
  • remaining balance — GET /v1/balance (the balance_cents field).

If Cline stalls partway through a long generation, it's almost never a token limit — it's usually a network client timeout or a max_tokens set too low, so check both before suspecting billing. A cutoff doesn't stop the charge, though: the gateway reads the provider's response to the end and bills the full generation.

You can top up the balance via SBP, a bank card through PayPear, crypto, or a foreign Mastercard EU card through Fride (about 13% fee, amounts $2–$594); the minimum top-up is $1. A one-time $0.50 bonus is credited for subscribing to the Telegram channel @zukkopro — link Telegram in the dashboard, subscribe, and press "Check" (once per Telegram account). There's no starting balance for a plain signup.

If Cline still stays silent after all of this, the fastest path is describing the symptom to support: https://t.me/zukkopro?direct.

Estimating cost before running a task

Before letting Cline start a long agentic task that reads dozens of files, you can check its token weight for free — the /v1/messages/count_tokens endpoint counts tokens without running the request or charging anything:

bash
curl https://api.zukko.pro/v1/messages/count_tokens \
  -H "Authorization: Bearer fetch_your_key" \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"model":"claude-sonnet-5","messages":[{"role":"user","content":"the task text for Cline"}]}'

This is useful if Cline is about to ingest a large context file whole — better to know the token cost up front than to hit the context limit halfway through the run.

Web search for models that lack it

Not every model in the catalog has built-in web search. If a Cline task needs current information and the selected model (say, GLM) doesn't search the web on its own, you can call POST /v1/web-search with the same key separately from the main conversation and feed the result back into the prompt manually.

Usage history and working as a team

The full charge history is available through GET /v1/usage, paginated with a cursor — useful for seeing exactly where the budget went during a heavy Cline session. That history covers the whole account (all keys together, no per-key filter), and the balance is account-wide too. If several people share one key, set limits on the key's dashboard page first, otherwise one long agentic run can eat the whole day's budget for everyone else. It's also worth checking the referral program: 10% of what invited teammates top up is credited to your balance automatically.

zukko

Pay 25×
less

for Claude Code & ChatGPT

One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.

Get API keyDocumentation

api.zukko.pro · fetch_*

Cline setup with a custom API key (Claude, GPT) · Zukko