Cline Integration

Applicable role: Developer Last updated: 2026-07-15

Cline is an open-source AI coding assistant that runs as a VS Code extension. It supports Agent capabilities such as file editing, terminal command execution, and browser operations, and it can be flexibly configured with third-party OpenAI-compatible endpoints.


Prerequisites

  • VS Code is installed
  • The Cline extension is installed from the VS Code Extensions Marketplace
  • An API Key has been created in the platform console
  • The Base URL has been confirmed

Configuration Steps

Step 1: Open the Cline settings panel

Click the Cline icon in the Activity Bar on the left side of VS Code to open the Cline side panel. Click the gear icon at the top of the panel to enter the Provider settings.

Step 2: Select the OpenAI Compatible provider

In the Provider settings panel, set the API Provider dropdown to OpenAI Compatible.

Step 3: Fill in the connection information

Field What to enter Example
Base URL The platform's API address YOUR_API_BASE_URL/v1
API Key The platform's API Key sk-xxxxxxxx
Model ID The name of the model to use claude-sonnet-4-6

Step 4: Configure model parameters

After selecting OpenAI Compatible, Cline cannot automatically detect the model's capability parameters and will use conservative defaults. We recommend manually configuring the following parameters for the best experience:

Parameter Recommended value Description
Context Window Set according to the model's actual value (e.g., 200000 for Claude Sonnet) The model's maximum input token count
Max Output Tokens Set according to the model's actual value (e.g., 16384) The maximum token count per reply
Supports Images Enable based on the model's capabilities Whether image input is supported
Supports Computer Use Recommended to enable Only when enabled can Cline perform Agent operations such as file editing and terminal commands; when disabled, only the chat function is available

The Supports Computer Use option is easy to overlook. If it is not enabled, Cline will treat the model as a pure chat model, and Agent features such as file editing and terminal commands will silently fail.

Step 5: Test the conversation

After configuration, send a test message in the Cline panel (e.g., "Hello, please introduce yourself") to confirm that you can receive a normal reply.


About Function Calling Support

Cline's Agent features (file editing, terminal execution, browser operations) rely on OpenAI's Function Calling (Tool Use) protocol. Your API endpoint must support the tools parameter; otherwise, the Agent features will not work properly.

The platform's OpenAI-compatible endpoint supports Function Calling, so Cline's Agent features can be used normally.


Roo Code (Cline fork)

Roo Code is a community fork of Cline, and the configuration process is identical. If you are using the Roo Code extension, simply follow the steps above.

Roo Code also supports the OpenAI Compatible provider option, with the same configuration fields as Cline.


FAQ

Q: What should I do if Cline can chat but cannot edit files after configuration? A: Check whether the Supports Computer Use option is enabled. This option controls whether Cline runs in Agent mode. When it is disabled, Cline only handles conversations and will not attempt file operations.

Q: What should I do if I get a "context window exceeded" error? A: Manually set the Context Window parameter to the model's actual value. Cline uses a conservative default context window for OpenAI Compatible providers, which may be much smaller than the size the model actually supports.

Q: Should the Base URL include /v1? A: Yes. Cline appends /chat/completions to the Base URL, so the Base URL should be YOUR_API_BASE_URL/v1.

Q: Can I switch between different models in Cline? A: Yes. Change the Model ID field in the Provider settings to switch. You can also switch using the model selector at the top of the Cline panel (if multiple models are configured).

Q: What is the difference between Cline and Roo Code? A: Roo Code is a community fork of Cline, with essentially the same features and configuration process. You can use either one; there is no difference in how they connect to the platform's API.