Use one API key in Cursor and Cline

I run qcode.cc, an independent API service (not official Anthropic, OpenAI or Google). The examples use QCode paths; swap the host for any compatible gateway.

The same third-party key can drive Cursor and the Cline VS Code extension if you set the matching OpenAI-compatible or Anthropic Base URL. This page is the short, vendor-neutral version of that setup, plus the mistakes that produce 404, 401 and model_not_available_on_endpoint.

Sources: Cline official OpenAI Compatible docs, OpenAI help: using OpenAI models in Cursor (BYOK scope), and — for the QCode worked example and Cursor 3.31.15 field names — QCode's Cursor guide and Cline guide (checked 2026-12-04). Cursor's own docs may change labels; confirm in Cursor Settings → Models and in Cursor's documentation. I run qcode.cc, an independent API service.

Which Base URL to paste

Editors append the API path for you. Paste only the prefix, with no trailing slash and without /chat/completions or /v1/messages.

What you want to callTypical settingQCode worked example
Claude models (Anthropic Messages)Anthropic Base URL — client appends /v1/messageshttps://api.qcode.cc/api
GPT and many Chinese-family models (OpenAI Chat Completions)OpenAI-compatible Base URL — client appends /chat/completions or /modelshttps://api.qcode.cc/openai/v1

On QCode, Claude IDs are not served on the OpenAI path and GPT IDs are not served on the Anthropic path. Sending the wrong family produces model_not_available_on_endpoint, which is a protocol error, not a bad key. Live IDs: qcode.cc/en/models. Other gateways may differ — follow their docs.

# Confirm the OpenAI-compatible path before pasting into the editor
curl -sS -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.qcode.cc/openai/v1/models
# Confirm the Anthropic path
curl -sS -X POST https://api.qcode.cc/api/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"claude-sonnet-5-5","max_tokens":16,"messages":[{"role":"user","content":"ping"}]}' 

Cursor

Open Cursor Settings → Models (on many builds, Ctrl+, / Cmd+,, or Ctrl/Cmd+Shift+J). You will typically see separate OpenAI and Anthropic API key fields, each with an "Override … Base URL" toggle.

  1. Sign in to your Cursor account first. Recent Cursor builds show a login gate before Models settings are usable; that is a Cursor account requirement, not something a third-party key replaces.
  2. For Claude: paste the key under Anthropic API, turn on Override Anthropic Base URL, and enter the Anthropic prefix (QCode: https://api.qcode.cc/api). Leave Override OpenAI Base URL off and empty. Add a Claude model id (for example claude-sonnet-5-5 or claude-opus-5-5) with + Add model if it is not already listed, enable it, then use Verify if the build still has that button.
  3. For GPT or Chinese models: paste the same key under OpenAI API, turn on Override OpenAI Base URL, and enter the OpenAI-compatible prefix (QCode: https://api.qcode.cc/openai/v1). Add the exact model id (for example gpt-6.2-sol or glm-5.3).
  4. Do not enable both overrides at once if you are calling Claude. On Cursor 3.31.15, that combination can route Claude requests to the OpenAI endpoint and fail with 422 / model_not_available_on_endpoint. Switch the override when you switch families.

Limits you should expect (from OpenAI's Cursor help article and Cursor BYOK behavior documented there):

Step-by-step screenshots for QCode: docs.qcode.cc Cursor guide.

Cline (VS Code extension)

Official setup for an OpenAI-compatible provider is in Cline's OpenAI Compatible documentation: open the Cline settings panel (gear), set API Provider to OpenAI Compatible, then fill Base URL, API Key and Model ID. The Base URL is the provider's endpoint, not https://api.openai.com/v1.

For Claude, use Cline's Anthropic provider instead, enable Use custom base URL, and paste the Anthropic prefix.

GoalAPI ProviderQCode Base URLModel ID examples
ClaudeAnthropic, with "Use custom base URL"https://api.qcode.cc/apiclaude-opus-5-5, claude-sonnet-5-5
GPT or Chinese modelsOpenAI Compatiblehttps://api.qcode.cc/openai/v1gpt-6.2-sol, glm-5.3

Screenshots for QCode: docs.qcode.cc Cline guide.

Using Cursor and Claude Code side by side

Cursor Chat / Composer follows the Models settings above. The claude CLI in the integrated terminal follows ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN (or a ~/.claude/settings.json env block). The two configs are independent and can share one key. See the environment variable reference and troubleshooting.

Related pages

Troubleshooting · Environment variables · Setup cheat sheet · How to evaluate a relay

Facts checked against docs.qcode.cc on 2026-12-05. I run qcode.cc. Pricing: qcode.cc/pricing (no free quota). Contact: hi@qcode.cc.