Use Claude in Cline, Roo Code & Continue.dev with a Custom API Key

The VS Code AI coding extensions — Cline, Roo Code, and Continue.dev — are among the best ways to get agentic, tool-using AI directly inside your editor. And the feature that makes them so flexible is simple: every one of them lets you use Claude (or GPT and other models) through a custom API key and a custom base URL. Instead of being locked to one vendor, you point the extension at your own OpenAI-compatible endpoint and drive it with your own key. This guide gives you a per-extension config walkthrough so you can add ApiTopMix as the provider and run Cline, Roo Code, and Continue.dev on Claude and other models with full cost control.

Why bother with a custom API key in a VS Code AI extension? Two reasons. First, cost control: you pay per token on your own account rather than through a bundled seat. Second, model choice: one key gives you the whole Claude family plus GPT-5 and other models, and you switch between them from the extension's model picker without touching config. ApiTopMix provides an OpenAI-compatible gateway at https://apitopmix.com/v1, which is exactly the shape these extensions expect when you select their OpenAI Compatible provider.

TL;DR: In any of these extensions, choose the OpenAI Compatible provider, set the base URL to https://apitopmix.com/v1, paste your ApiTopMix sk- key, and enter a model ID such as claude-sonnet-4-6. That is the entire Cline api provider setup — and the same three values work in Roo Code, Continue.dev, Cherry Studio, and ChatBox. Prefer the terminal? See our Claude Code CLI guide; using Cursor? See Use Claude in Cursor.

Prerequisites

Before you open any extension settings, make sure you have:

That is the whole shopping list. No local proxy and, for Cline and Roo Code, no config files — everything happens in the extension's settings UI plus one paste of your key. Continue.dev uses a small config file, which we cover step by step.

Step 0: Get your ApiTopMix API key

  1. Create an account at apitopmix.com (email signup works).
  2. Open the console, go to Tokens, and click Create new token.
  3. Copy the key — it starts with sk-. You will paste it into each extension's API key field.

Keep that single sk- key handy; it is the only credential you need for every extension in this guide. One key covers them all because they are all OpenAI-compatible clients.

Cline: Claude API key + custom base URL

Cline is the flagship agentic coding extension for VS Code, and its OpenAI Compatible provider is exactly what you want for a Cline custom base url setup. Here is the full Cline api provider setup, step by step:

  1. Open Cline's settings. Click the Cline icon in the VS Code sidebar, then the settings gear at the top of the Cline panel.
  2. Set the API Provider. In the API Provider dropdown, choose OpenAI Compatible. This is the mode for any custom OpenAI-style endpoint, including ApiTopMix.
  3. Enter the Base URL. In the Base URL field, type exactly https://apitopmix.com/v1. The /v1 suffix matters — that is where the OpenAI-compatible endpoint lives — and there is no trailing slash.
  4. Paste your API key. In the API Key field, paste your ApiTopMix sk- key. This is your Cline claude api key; it authenticates against the base URL you just set.
  5. Enter the Model ID. In the Model ID field, type an exact ApiTopMix model ID, for example claude-sonnet-4-6. Cline sends this string verbatim as the model field, so it must match a real ID.
  6. Save and start a task. Save the settings, open a new Cline task, and it now plans, edits files, and runs tools through ApiTopMix on the model you chose.

Here is the whole configuration as a copy-paste reference — plug these values into the matching fields in Cline's settings:

# Cline → Settings → API Provider: OpenAI Compatible
Base URL:  https://apitopmix.com/v1
API Key:   sk-your-apitopmix-key
Model ID:  claude-sonnet-4-6   # or claude-opus-4-6, gpt-5
Cline base url claude tip: Cline appends /chat/completions to your base URL automatically. Enter only https://apitopmix.com/v1 — if you paste the full path or add a trailing slash you will see 404s. When in doubt, run the curl test below to confirm the endpoint on its own.

Roo Code: custom Claude API in a Cline fork

Roo Code is a popular fork of Cline, so a Roo Code claude api setup follows the same shape — if you have done Cline, this takes under a minute. This is the full Roo Code custom api flow:

  1. Open Roo Code's settings. Click the Roo Code icon in the VS Code sidebar and open its settings panel.
  2. Choose the provider. Set the API Provider to OpenAI Compatible.
  3. Enter the Base URL. Type https://apitopmix.com/v1 — same value as Cline, same rules (keep the /v1, no trailing slash).
  4. Paste your key. Paste the same ApiTopMix sk- key. One key serves both Cline and Roo Code.
  5. Enter the Model ID. Use a valid ID such as claude-sonnet-4-6 or claude-opus-4-6.
  6. Save. Save and start a task; Roo Code now routes its agentic work through ApiTopMix.
# Roo Code → Settings → API Provider: OpenAI Compatible
Base URL:  https://apitopmix.com/v1
API Key:   sk-your-apitopmix-key
Model ID:  claude-sonnet-4-6

Because Roo Code shares Cline's provider model, everything you learn about one transfers to the other — including the troubleshooting below.

Continue.dev: connect Claude with a custom model

Continue.dev is configured through a small config file rather than a pure UI, which makes the Continue.dev claude api setup a copy-paste of one model block. To add a Continue custom model pointed at ApiTopMix:

  1. Open the Continue config. Open the Continue panel in VS Code and click the gear to edit its configuration (a YAML or JSON config, depending on your Continue version).
  2. Add a model entry. Add a model with provider set to openai, apiBase set to https://apitopmix.com/v1, apiKey set to your ApiTopMix key, and model set to a valid ID.
  3. Save and select. Save the config and pick your new model from Continue's model dropdown at the bottom of the chat.

YAML config (newer Continue versions):

# ~/.continue/config.yaml
models:
  - name: Claude Sonnet (ApiTopMix)
    provider: openai
    apiBase: https://apitopmix.com/v1
    apiKey: sk-your-apitopmix-key
    model: claude-sonnet-4-6

JSON config (classic config.json):

// ~/.continue/config.json
{
  "models": [
    {
      "title": "Claude Sonnet (ApiTopMix)",
      "provider": "openai",
      "apiBase": "https://apitopmix.com/v1",
      "apiKey": "sk-your-apitopmix-key",
      "model": "claude-sonnet-4-6"
    }
  ]
}
Continue custom api note: the provider: openai line is what makes Continue speak the OpenAI-compatible protocol, and apiBase is where the custom base URL goes. Add more entries with different model values (e.g. claude-opus-4-6, gpt-5) to keep several models in the picker under one key.

Also works: Cherry Studio & ChatBox

The same pattern extends beyond the coding extensions. Cherry Studio and ChatBox are popular desktop AI clients, and both accept a custom OpenAI-compatible provider:

The takeaway: any OpenAI-compatible client — coding extension or chat app — works with the same ApiTopMix key and base URL. Configure once, reuse everywhere.

Sanity-check the endpoint with curl

Before blaming any extension, confirm the key and base URL work on their own. Fire a one-line request at the OpenAI-compatible endpoint — if this returns a normal chat completion, the extensions will too:

curl https://apitopmix.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-apitopmix-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"Say hi from my VS Code setup"}]}'

A valid JSON completion proves three things at once: your sk- key is good, the https://apitopmix.com/v1 base URL is reachable, and the model ID you typed exists. That makes extension-side troubleshooting much faster, because you have already ruled out the key, the URL, and the model name.

Which models work well for agentic coding

Cline, Roo Code, and Continue.dev are all agentic — they read files, plan, and call tools in a loop — so model choice matters. A practical split you can keep in the picker:

ModelBest for agentic coding
claude-sonnet-4-6Your default. Fast, excellent at tool use, multi-file edits, writing functions and tests, and following the agent loop reliably. Best value for day-to-day work in Cline and Roo Code.
claude-opus-4-6Hard debugging, large refactors, and dense reasoning over long context. Switch to it when Sonnet stalls on a gnarly task.
gpt-5A strong second voice for planning and cross-checking. Handy to keep available for a different perspective on the same problem.

Because all of these sit behind the same ApiTopMix key and base URL, adding another model is just one more Model ID (or one more config entry) — no second provider, no second key. For current, per-model rates across the whole catalog, see the ApiTopMix pricing page, and the API documentation for exact model IDs and endpoint details. Watching costs specifically? Our cheap Claude API guide goes deeper.

Troubleshooting the extensions

Custom providers in these extensions fail in a small number of predictable ways. This table maps each symptom to the fix:

SymptomLikely causeFix
"invalid API key" / auth error Base URL wrong or key truncated Set the base URL to exactly https://apitopmix.com/v1 (no trailing slash) and re-paste the full sk- key. Confirm with the curl test.
"model not found" / model_not_found Model ID doesn't match an ApiTopMix ID The extension sends your exact string as the model. Use a valid ID like claude-sonnet-4-6 or gpt-5; check the docs or the /v1/models endpoint.
Requests 404 Base URL includes /chat/completions or an extra slash Enter only https://apitopmix.com/v1. Cline, Roo Code, and Continue append the path themselves; a full path or trailing slash breaks the route.
Provider option missing Wrong provider selected Choose OpenAI Compatible (Cline/Roo Code) or set provider: openai with apiBase (Continue.dev). Do not pick the native Anthropic provider for this route.
401 / 403 on requests Key not applied, or balance is low Re-paste the key so it binds to the custom base URL, and check your ApiTopMix balance in the console.
Streaming / tool calls behave oddly Model less suited to the agent loop Switch to claude-sonnet-4-6 or claude-opus-4-6, which handle tool use and multi-step agentic edits well.

For a deeper checklist on base-URL and connection errors that apply across tools, see our dedicated base URL troubleshooting guide. The same root causes — wrong path, trailing slash, bad model ID — show up whether you are in a VS Code extension or the CLI.

These extensions vs the Claude Code CLI and Cursor

This page is about the VS Code extension family. If you also work elsewhere, the setup differs by tool:

The same ApiTopMix key drives all of them, so you can set up one, several, or all — editor extensions, Cursor, and the terminal all on one credential. For a conceptual overview of what a base URL is and why it matters, see Claude API base URL explained.

Frequently asked questions

How do I add a Cline Claude API key with a custom base URL?

Open Cline's settings, set the API Provider to OpenAI Compatible, enter the base URL https://apitopmix.com/v1, paste your ApiTopMix sk- key, and type a model ID such as claude-sonnet-4-6. Cline then sends OpenAI-format requests to ApiTopMix, which routes them to Claude. The trailing /v1 is required.

What is the correct Cline custom base URL for ApiTopMix?

Use https://apitopmix.com/v1 exactly, with no trailing slash and no extra path. Cline appends /chat/completions itself, so entering the full path or an extra slash causes 404s. A curl test against https://apitopmix.com/v1/chat/completions confirms the endpoint independently.

How do I set up Roo Code with a custom Claude API?

Roo Code is a fork of Cline and configures the same way. Choose the OpenAI Compatible provider, set the base URL to https://apitopmix.com/v1, paste your ApiTopMix key, and enter a model ID like claude-sonnet-4-6 or claude-opus-4-6. The same key works in both Cline and Roo Code.

How do I connect Continue.dev to Claude with a custom model?

Edit Continue's config file and add a model with provider: openai, apiBase: https://apitopmix.com/v1, apiKey set to your sk- key, and model: claude-sonnet-4-6. Save and select the model from Continue's dropdown. That is the whole Continue custom model setup.

Do I need a separate API key for each VS Code AI extension?

No. One ApiTopMix sk- key and one base URL, https://apitopmix.com/v1, work across Cline, Roo Code, Continue.dev, Cherry Studio, and ChatBox. Any OpenAI-compatible client can reuse the same credentials.

Which model should I use for agentic coding?

For everyday agentic work, claude-sonnet-4-6 is the best default — fast, strong at tool use and multi-file edits, good value. Use claude-opus-4-6 for hard debugging or large refactors, and keep gpt-5 for a second opinion. All work behind the same key and base URL.

Why does my extension say "model not found" or "invalid API key"?

"Model not found" means the model ID doesn't match an ApiTopMix ID — use a valid one like claude-sonnet-4-6 and check the /v1/models list. "Invalid API key" usually means the base URL is wrong or the key was truncated — confirm the base URL is exactly https://apitopmix.com/v1 and re-paste the full key.

Is ApiTopMix OpenAI-compatible so these extensions can use it?

Yes. ApiTopMix exposes an OpenAI-compatible endpoint at https://apitopmix.com/v1 (including /v1/chat/completions and /v1/models). Cline, Roo Code, and Continue.dev expect exactly that shape when you select the OpenAI Compatible provider.

Run your VS Code AI extensions on your own Claude key

Grab a key, set one base URL, pick a model — and code with Claude in Cline, Roo Code, and Continue.dev on the billing you control.

Further reading

Conclusion

Using Claude in Cline, Roo Code, and Continue.dev comes down to one idea: point each extension's OpenAI Compatible provider at https://apitopmix.com/v1, paste your ApiTopMix key, and enter a model ID like claude-sonnet-4-6 or gpt-5. From there, the agent loop — reading files, editing, running tools — runs on the model and billing you control. Keep the base URL exact, use real model IDs, and lean on the curl sanity-check whenever a connection acts up.

Set it up once and your whole VS Code AI stack becomes a front-end for whatever ApiTopMix model fits the task — Sonnet for daily work, Opus for the hard problems, GPT-5 for a second opinion — all from one key. And when you move to Cursor or the terminal, the same key powers Cursor and the Claude Code CLI, so every surface stays in sync.