Cline Integration
Use QCode.cc API with the Cline extension in VS Code
Cline Integration¶
Cline is a popular VS Code AI coding extension (millions of installs) that supports any AI model and custom API endpoints. It ships with Plan / Act dual modes, file-edit diff previews, terminal execution, and MCP tool calls. By pairing Cline with the QCode.cc API, you can use Claude, GPT, and other models in VS Code at low cost.
Why Cline?¶
-
Zero markup: No markup on model costs — you only pay QCode.cc API fees
-
Flexible model switching: Switch between
claude-opus-4-8,claude-sonnet-4-6,gpt-5.x, and more in the same interface -
Deep VS Code integration: Sidebar panel, inline code actions, file-edit diff preview, auto-approve
-
Plan / Act dual modes: Plan first, then execute — keeps complex changes under control
-
Fully open source: Transparent code, active community
-
MCP support: Connect external tools (databases, browsers, docs) via the Model Context Protocol
Installation & Configuration¶
Step 1: Install the Cline Extension¶
In VS Code:
-
Open the Extensions panel (
Ctrl+Shift+X/Cmd+Shift+X) -
Search for "Cline"
-
Click Install
-
After installing, the Cline icon appears in the left Activity Bar
Cline also offers a command-line version (Cline CLI) that reuses the same configuration in your terminal; this guide focuses on the VS Code extension.
Step 2: Configure QCode.cc API¶
A single QCode.cc API key (starts with cr_) is compatible with both the Anthropic protocol and the OpenAI protocol. Cline offers two ways to connect — pick either one:
Option A: Anthropic-compatible (recommended for Claude models)¶
In Cline's settings (gear icon), open the API Provider dropdown and select "Anthropic", then fill in:
| Setting | Value |
|---|---|
| API Key | Your QCode.cc API key (starts with cr_) |
| Use custom base URL | Check it and enter https://api.qcode.cc/api |
| Model | claude-sonnet-4-6 (recommended) or claude-opus-4-8 |
The SDK automatically appends
/v1/messagesafter the Base URL, so set the Base URL to/api— do not write/api/v1/messages, and do not include a trailing slash.
Option B: OpenAI-compatible¶
In the API Provider dropdown, select "OpenAI Compatible", then fill in:
| Setting | Value |
|---|---|
| Base URL | https://api.qcode.cc/openai/v1 |
| API Key | Your QCode.cc API key (starts with cr_) |
| Model ID | claude-sonnet-4-6, claude-opus-4-8, gpt-5.5, etc. |
OpenAI-compatible mode uses the
/chat/completionsendpoint, giving you access to the full Claude and GPT lineup from one interface.
Step 3: Verify Connection¶
Type a simple message (e.g., "Hello") in the Cline chat box. If you receive a response, the configuration is successful.
You can also self-check with curl in a terminal (a 401 means the path is correct and only auth is missing):
# Anthropic protocol
curl -i https://api.qcode.cc/api/v1/messages \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet-4-6","max_tokens":16,"messages":[{"role":"user","content":"hi"}]}'
# OpenAI protocol
curl -i https://api.qcode.cc/openai/v1/chat/completions \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"hi"}]}'
Alternative Endpoints¶
The same key works across 4 access domains, which back each other up. If the primary domain is unstable, swap api in the Base URL for the corresponding subdomain below:
| Endpoint | Anthropic Base URL | OpenAI Base URL |
|---|---|---|
| Default | https://api.qcode.cc/api |
https://api.qcode.cc/openai/v1 |
| Asia-Pacific (preferred in mainland China) | https://asia.qcode.cc/api |
https://asia.qcode.cc/openai/v1 |
| US | https://us.qcode.cc/api |
https://us.qcode.cc/openai/v1 |
| Europe | https://eu.qcode.cc/api |
https://eu.qcode.cc/openai/v1 |
Users in mainland China should prefer
asia.qcode.cc, which usually has the lowest latency. See Endpoints & API Formats for details.
Plan / Act Dual Modes¶
Cline offers a Plan / Act toggle below the chat box:
-
Plan: Cline reads the code, asks questions, and proposes an implementation plan, but does not modify files. Great for aligning on requirements before any change.
-
Act: Cline actually creates/edits files, runs commands, and calls tools. Each change is shown as a diff for you to approve or auto-approve.
A typical workflow: use Plan mode first to have the model outline and confirm an approach, then switch to Act mode to implement it step by step. For complex tasks, plan with the stronger-reasoning claude-opus-4-8, then execute with the more cost-effective claude-sonnet-4-6.
Usage Tips¶
1. Model Selection Guide¶
| Scenario | Recommended Model | Notes |
|---|---|---|
| Daily coding | claude-sonnet-4-6 |
Fast, great value, 1M context |
| Complex architecture / Plan mode | claude-opus-4-8 |
Strongest reasoning, flagship |
| Lightweight tasks / copy edits | claude-haiku-4-5 |
Lowest cost |
| Prefer GPT style | gpt-5.5 / gpt-5.4 |
Selectable under the OpenAI protocol |
See Billing for full pricing.
2. Configure MCP Tools¶
Cline supports the Model Context Protocol (MCP), letting the model call external tools (database queries, browsers, document search, etc.). Add a server in Cline's MCP Servers panel:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/project"]
}
}
}
MCP servers are decoupled from the upstream model — tool calls work whether you connect to QCode.cc via the Anthropic or OpenAI protocol. For each server's install steps and parameters, see the tool's official docs.
3. Project-Level Custom Instructions (.clinerules)¶
Create a .clinerules file in the project root to inject fixed context for that repo — code style, stack conventions, directory layout. Cline includes these rules in every conversation, so you don't have to paste them repeatedly:
# .clinerules
- Use TypeScript everywhere, strict mode
- Prefer reusing helpers under src/lib
- Run `pnpm test` before committing
For the rules file's fields and advanced usage, see Cline's official docs.
4. Image Input (Vision)¶
claude-opus-4-8, claude-sonnet-4-6, and GPT-5.x all support vision input. Drag a UI screenshot, an error screenshot, or an architecture diagram straight into the Cline chat box and let the model code from it or debug it.
Note: this is about having the model read images. To generate images, use gpt-image-2 Image Generation with the model name
gpt-image-2.
5. Auto-Approve & Cost Control¶
-
In settings you can enable Auto-approve separately for "read files", "write files", and "execute commands" to reduce interruptions; keep manual confirmation for high-risk operations.
-
Cline shows the token usage and estimated cost per request, making spend easy to track. For complex tasks, narrow scope with Plan mode first to avoid unnecessary back-and-forth.
-
For large codebases, use
@(mention a file/folder/URL) to feed precise context instead of letting the model scan the whole project — it saves tokens and stays focused.
6. Pairing with Claude Code CLI¶
Cline and Claude Code CLI each have their strengths — use them together:
| Scenario | Recommended Tool |
|---|---|
| Quick edits in VS Code | Cline |
| Complex project analysis | Claude Code CLI |
| Multi-file refactoring | Cline |
| Git operations, code review | Claude Code CLI |
| Codebase-wide migration/review | Claude Code CLI (subagents) |
| CI/CD automation | Claude Code CLI (headless mode) |
7. Shared Quota¶
Cline and Claude Code CLI use the same QCode.cc API key and share the plan quota — no need to request separate keys per tool.
FAQ¶
Connection failed / 401 / 404?¶
-
Make sure the Base URL has no trailing
/ -
In Anthropic mode, set the Base URL to
/api(the SDK appends/v1/messages) — don't write the full path manually -
In OpenAI mode, set the Base URL to
/openai/v1 -
Check that the API key starts with
cr_and was copied in full -
Try switching to an alternative endpoint (e.g.,
asia.qcode.cc) -
Confirm your network can reach QCode.cc services
Model list is empty?¶
In OpenAI-compatible mode, manually type the model name in the Model ID field (e.g., claude-sonnet-4-6) — you don't need to select from a list.
Plan mode doesn't change files?¶
That's expected. Plan mode only plans; changes are written only after switching to Act mode.
Getting 401 even though config looks right?¶
A 401 usually means the path is correct and only auth failed. Re-check that the API Key is complete and that you picked the right Provider type (Anthropic vs OpenAI Compatible) with its matching Base URL.
Next Steps¶
-
See Endpoints & API Formats for all protocols and domains
-
See Aider Integration for another open-source tool compatible with QCode.cc
-
See VS Code Integration to use the official Claude Code extension
-
See Billing for pricing details
Don't have an API key yet? See QCode.cc plans and pricing →