VS Code Configuration Guide
Use OpenAI Compatible mode in VS Code + Cline to connect your LLM API Gateway Token.
**Goal: **Install Cline in VS Code and connect your LLM API Gateway Token via OpenAI Compatible mode. Once configured, you can use VS Code to let the AI read code, edit code, run commands, and explain errors.
| Option | Value | Notes |
|---|---|---|
| API Provider | OpenAI Compatible | Cline natively supports OpenAI-compatible providers. |
| Base URL | https://api.llm-token.cn/v1 | Do not enter the full /chat/completions path. |
| API Key | sk-xxxxxxxx | Paste your full key. |
| Model ID | Copy the full model name from the model list | If the model does not exist, it is almost always entered incorrectly here. |
1. Prerequisites
- Install VS Code: https://code.visualstudio.com/
- Install Git: https://git-scm.com/downloads
- Windows users should restart the computer after installing Git so the environment variables take effect.
2. Install the Cline extension
- Open VS Code and click Extensions in the left sidebar.
- Search for Cline and click Install.
- After installation, the Cline icon appears in the left sidebar.
- If the icon does not appear, restart VS Code.
Interface for searching the Cline plugin in VS Code. The icons on the le…
3. Open the Cline settings
Click the Cline icon in the left sidebar and open the settings from the Cline panel.
Screenshot of the Cline settings screen in VS Code, corresponding to the…
Settings screen for the Cline plugin in VS Code. The left side lists opt…
The image above is only for locating the fields in Cline. The third-party http://... address and model name in the image are not LLM API Gateway settings; do not copy them. Use the HTTPS Base URL from the table in this article and the model list on this site.
4. Enter the LLM API Gateway Token interface
- **API Provider: **Select OpenAI Compatible.
- **Base URL: **Enter
https://api.llm-token.cn/v1. - **API Key: **Paste your key that starts with
sk-. - **Model ID: **Enter the full model ID, for example
claude-sonnet-4-6. - Save the configuration and create a new task to test.
If saving fails: First check that the Base URL is not set to https://api.llm-token.cn/v1/chat/completions. Cline should be the API root path, i.e. /v1.
5. Testing and troubleshooting
| Symptom | Fix |
|---|---|
| Cannot enter URL | Make sure you selected OpenAI Compatible, not the regular OpenAI official provider. |
| Model Not Found | The model ID must match the model list exactly. |
| Connection failed | Check the key, Base URL, and network proxy; on a company or campus network, try a phone hotspot. |
| No Cline icon | Restart VS Code; if it still does not appear, reinstall the extension. |
Institutio configurationis OpenCode
Institutio OpenCode et mutatio exemplarium, tam in terminali quam in cliente graphico.
Tutoriale configurationis Chatbox (fons ChatGPT / versio computatralis)
Tutoriale celeris connexionis ad colloquia computatralia, translationem, scriptionem et quaestiones responsaque.