Cline in VS Code: How to Connect an API and Verify a Request

Cline is a VS Code extension that sends a task to an external model API and displays the answer in the editor. To use it with BetterToken, select OpenAI Compatible in Cline and enter the Base URL, API Key, and Model ID. This guide takes you from installing the extension to verifying a request in BetterToken Dashboard.

What Cline is and how it relates to VS Code

Three separate layers are involved:

  • VS Code is the editor that hosts extensions. It does not call the model API by itself.
  • Cline is the extension that accepts a task in the editor and calls the selected model API. The extension itself is not a language model.
  • The model API is the external service that receives Cline's requests. BetterToken provides an OpenAI-compatible interface that Cline can use.

Cline is not built into VS Code and is not a BetterToken extension. This separation helps with troubleshooting: Cline handles the task submission, while API request status and token usage are checked on the BetterToken side.

What you need before connecting the API

Prepare three things:

  1. VS Code installed on your computer. The official extension installation path is documented in the Cline installation guide.
  2. A BetterToken API Key from your own account. If you do not have an account yet, register and create an API Key.
  3. A Model ID copied from the Codex group in the current BetterToken model list. Do not reuse a fixed model name from an old tutorial; copy an available ID before configuring Cline.

Connections to the BetterToken API endpoint from Russia do not require a VPN or a foreign bank card. This applies to the BetterToken API connection itself; third-party tools and their official websites may have different access conditions.

Create a BetterToken API Key and configure Cline with the current guide: docs.bettertoken.ai/en/ai-tools/cline

How to configure BetterToken in Cline

Step 1. Install the extension

Open VS Code and press Ctrl+Shift+X on Windows or Linux, or Cmd+Shift+X on macOS. Search for Cline, install the extension, and open it from the activity bar.

If the icon is not visible, open the Command Palette with Ctrl+Shift+P or Cmd+Shift+P and run Cline: Open In New Tab.

Step 2. Check for conflicting environment variables

If you previously configured another OpenAI-compatible endpoint with environment variables, close VS Code, clear them in the same shell, and start the editor again:

unset OPENAI_API_KEY
unset OPENAI_BASE_URL

Skip this step if those variables were never set.

Step 3. Open the settings

On first launch, click Use your own API key in the Cline panel. If a provider is already configured, open the settings with the gear icon.

Step 4. Select the provider

Set API Provider to OpenAI Compatible.

Step 5. Enter the connection settings

Field Value
Base URL https://www.bettertoken.ai/v1
API Key your BetterToken API Key, for example your_api_key_here
Model ID an exact model ID from the Codex group

Use the Base URL exactly as shown. Extra headers, including User-Agent, are not required for a normal BetterToken connection. Add headers only when the official documentation for another gateway in your request path requires them.

Step 6. Save and reload

Click Done, then restart Cline or reload the VS Code window from the Command Palette with Developer: Reload Window.

How to verify Cline with a low-risk task

Use a task that does not need write access for the first check. Open a file in VS Code and send this prompt to Cline:

Read the currently open file and explain its purpose in two or three sentences. Do not modify files or run commands.

Approve file reading only. If Cline requests permission to change a file or run a command, reject that action; it is not needed for this test.

Then open BetterToken Dashboard and inspect the request history. The matching entry should show:

  • the request status;
  • the model used, matching the Model ID configured in Cline;
  • input and output token usage for the operation.

If the entry matches your test, the Model ID is correct, and the status is successful, the Cline → BetterToken API chain is working.

What to check if the request is missing from Dashboard

If there is no entry, BetterToken did not record the test request. Check the Cline configuration and network path first:

  • API Key: copy the key again and remove leading or trailing spaces.
  • Base URL: it must be exactly https://www.bettertoken.ai/v1.
  • Model ID: copy an available ID from the Codex group in the BetterToken model list.
  • Saved settings: click Done, then restart Cline or run Developer: Reload Window.
  • Environment variables: make sure old OPENAI_API_KEY and OPENAI_BASE_URL values do not override the current setup.
  • Network: check the firewall and proxy if Cline reports a connection error.

If a request appears in Dashboard but Cline shows an error:

Open the entry and inspect its status first. If the API status is successful, recheck the Cline version and selected Model ID. If the status is an error, use the request time and error code for further diagnosis.

If Dashboard shows an API error:

Check the API Key, account balance, and Model ID. The current model list is available on the pricing page.

Official sources