Get started with Cline in VS Code and Berget AI
Install Cline, connect it to Berget AI, and write your first AI-assisted code, all without your data leaving Europe
In this tutorial, you'll install the Cline extension in Visual Studio Code, connect it to Berget AI, and ask it to explain a piece of code. By the end, you'll have a working AI coding assistant running entirely on European infrastructure.
Cline is a VS Code extension that brings an AI assistant directly into your editor. Connecting it to Berget AI means your code and prompts stay on European servers, not routed through US-based cloud providers.
Before you start
To complete this tutorial, you'll need:
- Visual Studio Code installed on your machine
- A Berget AI account (free to create)
- A few minutes and a file with some code in it (any language works)
Set up Cline
Install the extension, create an API key, and connect the two together.
Install the Cline extension
Open VS Code, go to the Extensions panel (Ctrl+Shift+X / Cmd+Shift+X), and search for Cline by cline.bot.
Once installed, a Cline icon appears in the left sidebar.
Create a Berget AI API key
- Go to API Keys in the Berget AI Console.
- Click + Create New Key.
- Enter a name in the Key Name field (e.g.
Cline VS Code). - Click + Create Key.
- Copy it now and store it somewhere safe. It won't be shown again.
berget api-keys create --name "Cline VS Code"The key is printed once in full (sk_ber_... format). Copy it now and store it somewhere safe. It won't be shown again.
Connect Cline to Berget AI
Click the Cline icon in the VS Code sidebar to open the panel. When prompted with "How will you use Cline?", select Bring my own API key and click Continue.
On the Configure your provider screen, set the fields as follows:
| Field | Value |
|---|---|
| API Provider | OpenAI Compatible |
| Base URL | https://api.berget.ai/v1 |
| OpenAI Compatible API Key | The key you just created |
| Model ID | zai-org/GLM-4.7 |
Expand Model Configuration and uncheck Supports Images — GLM-4.7 doesn't support image input.
Cost tracking
Cline's Input Price / 1M tokens and Output Price / 1M tokens fields expect values in USD. Berget AI prices in EUR, so these fields won't auto-populate. To track costs, find the current EUR price for GLM-4.7 in the Berget AI Console, convert to USD, and enter the values manually.
Click Continue. Cline will land on the chat panel ("What can I do for you?"), confirming the connection worked. The model ID shown at the bottom of the panel will read openai-compat:zai-org/GLM-4.7.
Try it out
Open any file in your project in VS Code so it's the active tab. Then open the Cline panel and type:
Explain what this code does, line by line.Cline reads the active file automatically and sends it to Berget AI along with your prompt. You should see a plain-language explanation appear within a few seconds. That response was generated on Berget AI's European infrastructure.
What you built
You now have a working AI coding assistant in VS Code, backed by Berget AI. Every prompt you send through Cline (your code, your questions, the responses) stays within the EU.