> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bettertoken.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cline setup: installation, API key, Base URL, and custom models

> Install Cline, configure the BetterToken Base URL and API key, choose a compatible provider model, and troubleshoot common errors.

To connect Cline to BetterToken, prepare an API key, enter the Base URL shown below, and choose a current Model ID from the model plaza. Compare similar UI-based setup in [Roo Code](/en/ai-tools/roo-code), [Kilo Code](/en/ai-tools/kilo-code), and [MonkeyCode](/en/ai-tools/monkeycode).

## Key settings

| Field    | Value                                                                                  |
| -------- | -------------------------------------------------------------------------------------- |
| API Key  | BetterToken API key                                                                    |
| Base URL | `https://bettertoken.ai/v1`                                                            |
| Model    | A current Model ID from the <a href={"https://bettertoken.ai/pricing"}>model plaza</a> |

## Prerequisites

* The current version of the tool is installed
* A BetterToken API key: <a href={"https://bettertoken.ai/register"}>register and get one</a>
* A Model ID from the <a href={"https://bettertoken.ai/pricing"}>model plaza</a>

### Additional requirements

* VS Code installed

## Install

### Install Cline

Open VS Code, search for **Cline** in the extensions marketplace, and install it.

## Manual setup

Complete this setup in the Cline configuration UI. You do not need to edit a configuration file.

| Field    | Value                                                                                  |
| -------- | -------------------------------------------------------------------------------------- |
| API Key  | BetterToken API key                                                                    |
| Base URL | `https://bettertoken.ai/v1`                                                            |
| Model    | A current Model ID from the <a href={"https://bettertoken.ai/pricing"}>model plaza</a> |

### Setup

<Steps>
  <Step title="Clear conflicting environment variables">
    ```bash theme={null}
    unset OPENAI_API_KEY
    unset OPENAI_BASE_URL
    ```
  </Step>

  <Step title="Open the Cline config UI">
    Click **Use your own API key** in the Cline sidebar.
  </Step>

  <Step title="Configure the API provider">
    Fill in:

    * **API Provider** → `OpenAI Compatible`
    * **Base URL** → `https://bettertoken.ai/v1`
    * **API Key** → your BetterToken API Key
    * **Model** → a **model ID from a supported provider** copied from the <a href={"https://bettertoken.ai/pricing"}>model plaza</a>
  </Step>

  <Step title="Only configure extra headers when the official docs explicitly require them">
    The official Cline OpenAI-compatible setup docs focus on the `Base URL`, API key, and model ID. You usually do not need an extra `User-Agent` when connecting BetterToken.

    If you are also using a custom gateway, tenant routing, observability, or caching layer, add headers only according to that upstream service's official docs.
  </Step>

  <Step title="Save the config">
    Click **Done**.
  </Step>

  <Step title="Restart Cline">
    After saving the config, restart VS Code or reload the Cline extension so the new settings take effect.
  </Step>
</Steps>

## Verify the connection

Send a short test prompt. If the tool returns a response without an authentication or Model ID error, the connection works. Fully restart the tool after changing its configuration.

## Switch models

Open the model selector or change the `Model` field in the configuration. Use the exact Model ID from the <a href={"https://bettertoken.ai/pricing"}>model plaza</a>, then restart the current session.

## Common errors

| Error                   | What to check                                                        |
| ----------------------- | -------------------------------------------------------------------- |
| `401` or `Unauthorized` | Check the BetterToken API key and remove leading or trailing spaces. |
| `404`                   | Check the Base URL and do not append a specific endpoint path.       |
| `model not found`       | Copy a current Model ID from the model plaza.                        |
| Changes do not apply    | Save the configuration and fully restart the tool.                   |

* [How to configure an OpenAI-compatible API in Cline](/en/faq/cline/openai-compatible-api)
* [OpenAI-compatible API vs Anthropic-compatible API](/en/faq/concepts/openai-compatible-vs-anthropic-compatible)
* [MCP vs API Key and Base URL](/en/faq/concepts/mcp-vs-api-key-base-url)
* [How to configure a custom OpenAI API in Cursor](/en/faq/cursor/custom-openai-api)

<Note>
  Check the `Base URL`, API key, model ID, and tool version first. Do not assume `User-Agent` is a required BetterToken setting.
</Note>

## Advanced setup

### Supported providers

| Provider | Status        |
| -------- | ------------- |
| Claude   | Not supported |
| GPT      | Manual setup  |
| Kimi     | Manual setup  |
| GLM      | Manual setup  |

<Note>Statuses apply to the BetterToken setup documented on this page.</Note>

<Accordion title="What the setup methods mean">
  * **Manual setup**: enter the API Key, Base URL, and Model.
  * **Not supported**: no verified direct setup is currently available.
</Accordion>

## Technical details

<Accordion title="Protocol, endpoint, and internal provider fields">
  This setup uses `https://bettertoken.ai/v1`. The tool appends the OpenAI-compatible endpoint path. Do not add `/chat/completions` or `/responses` unless a specific field explicitly requires it.
</Accordion>
