Your privacy choices

Allow optional cookies for referral attribution, visit analytics, and Google Ads purchase measurement.

VS Code Configuration Tutorial

Connect with OpenAI Compatible to the LLM API Gateway in VS Code + Cline.

Goal: Install Cline in VS Code and connect to the LLM API Gateway using the OpenAI Compatible method. After setup, you can make AI read code, edit code, write commands, and explain errors directly in VS Code.

SettingValueNotes
API ProviderOpenAI CompatibleCline officially supports OpenAI-compatible providers.
Base URLhttps://api.llm-token.cn/v1Do not enter the full /chat/completions path.
API Keysk-xxxxxxxxPaste your complete Key.
Model IDCopy the complete model name from the model listMost Model Not Found errors come from a wrong value here.

1. Prerequisites

  1. Install VS Code: https://code.visualstudio.com/
  2. Install Git: https://git-scm.com/downloads
  3. Windows users should restart the computer after installing Git so the environment variables take effect.

2. Install the Cline Extension

  1. Open VS Code and click Extensions in the left sidebar to open the marketplace.
  2. Search for Cline and click Install.
  3. After installation, the Cline icon appears on the left side.
  4. If the icon does not appear, restart VS Code.

The interface for searching the Cline plugin in VS Code. Several icons are on the left, with the Extensions icon highlighted by a red outline. The search box contains "cline", and in the results below, the Cline plugin is highlighted by a red outline; its description reads "Autonomous coding assistant that can create/edit files, run commands, use a browser, etc.", with an Install button on the right. This image relates to the "open Cline settings" step and shows the interface for searching the Cline plugin in VS Code.The interface for searching the Cline plugin in VS Code. Several icons a…

3. Open Cline Settings

Click the Cline icon on the left side, enter the Cline panel, then open Settings.

A screenshot of the Cline setup step in VS Code, matching the step of opening Cline settings in the setup tutorial. The top shows the question "How will you use Cline?" with three options from top to bottom: "Absolutely Free", "Frontier Model", and "Bring my own API key", with "Bring my own API key" selected. Below it is the description "Use Cline with your provider of choice". This step is the key choice of how to use the API key, corresponding to the step that comes before entering the LLM API Gateway interface in the setup tutorial.A screenshot of the Cline setup step in VS Code, matching the step of op…

An image showing the settings screen of the Cline plugin in VS Code. On the left are options such as "API Configuration", "Plan Mode", and "Act Mode", with "Act Mode" highlighted by a red outline. On the right, API Provider is "OpenAI Compatible", Base URL is "http://api.vectorengine.a...", the OpenAI Compatible API Key is partially covered, Model ID is "claude - opus - 4 - 6", with additional items such as Custom Headers. This image corresponds to step 4, "Enter the LLM API Gateway details", showing the settings under API Configuration.An image showing the settings screen of the Cline plugin in VS Code. On…

The image above is only for locating the fields in Cline. The third-party http://... address and model name in the image are not the LLM API Gateway configuration, so 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 Details

  1. API Provider: Select OpenAI Compatible.
  2. Base URL: Enter https://api.llm-token.cn/v1.
  3. API Key: Paste your Key beginning with sk-.
  4. Model ID: Enter the complete model ID, for example claude-sonnet-4-6.
  5. Save the configuration, then start a new task to test it.

If saving reports an error: First confirm that Base URL is not written as https://api.llm-token.cn/v1/chat/completions. Cline expects the API root path, which is /v1.

5. Testing and Troubleshooting

SymptomResolution
Cannot enter URLConfirm that OpenAI Compatible is selected, not the regular OpenAI official provider.
Model Not FoundThe model ID must exactly match the model list.
Connection failedCheck the Key, Base URL, and network proxy; on a corporate or campus network, try a hotspot instead.
No Cline iconRestart VS Code; if it is still missing, reinstall the extension.