> ## 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.

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

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

To connect Continue CLI to BetterToken, prepare an API key, enter the Base URL shown below, and choose a current Model ID from the model plaza.

## Key settings

| Field    | Value                                                                                  |
| -------- | -------------------------------------------------------------------------------------- |
| API Key  | BetterToken API key                                                                    |
| Base URL | `https://www.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

* Install Node.js 20 or later when using the npm installation method

## Install

### Install Continue CLI

<Tabs>
  <Tab title="macOS / Linux">
    ```bash theme={null}
    curl -fsSL https://raw.githubusercontent.com/continuedev/continue/main/extensions/cli/scripts/install.sh | bash
    ```
  </Tab>

  <Tab title="Windows PowerShell">
    ```powershell theme={null}
    irm https://raw.githubusercontent.com/continuedev/continue/main/extensions/cli/scripts/install.ps1 | iex
    ```
  </Tab>

  <Tab title="npm (cross-platform)">
    ```bash theme={null}
    npm install -g @continuedev/cli
    ```
  </Tab>
</Tabs>

After installation, confirm that `cn` is available:

```bash theme={null}
cn --version
```

## Manual setup

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

### Configure API Key and Base URL

<Steps>
  <Step title="Set the API Key environment variable">
    <Tabs>
      <Tab title="macOS / Linux">
        Run this in the same terminal that will start Continue CLI:

        ```bash theme={null}
        export BETTERTOKEN_API_KEY="YOUR_API_KEY"
        ```
      </Tab>

      <Tab title="Windows PowerShell">
        Run this in the same PowerShell window that will start Continue CLI:

        ```powershell theme={null}
        $env:BETTERTOKEN_API_KEY = "YOUR_API_KEY"
        ```
      </Tab>
    </Tabs>

    Replace `YOUR_API_KEY` with your BetterToken API Key. Do not commit the key to Git or put it in a shared configuration file.
  </Step>

  <Step title="Create config.yaml">
    Create or edit this file in your user directory:

    * macOS / Linux: `~/.continue/config.yaml`
    * Windows: `%USERPROFILE%\.continue\config.yaml`

    Add this configuration:

    ```yaml theme={null}
    name: BetterToken
    version: 0.0.1
    schema: v1

    models:
      - name: BetterToken GPT
        provider: openai
        model: YOUR_MODEL_ID
        apiBase: "https://www.bettertoken.ai/v1"
        apiKey: ${{ secrets.BETTERTOKEN_API_KEY }}
        useResponsesApi: false
    ```

    `YOUR_MODEL_ID` is only an example. Replace it with a current **model ID from a supported provider** from the model plaza.
  </Step>

  <Step title="Start Continue CLI">
    <Tabs>
      <Tab title="macOS / Linux">
        ```bash theme={null}
        cn --config ~/.continue/config.yaml
        ```
      </Tab>

      <Tab title="Windows PowerShell">
        ```powershell theme={null}
        cn --config "$env:USERPROFILE\.continue\config.yaml"
        ```
      </Tab>
    </Tabs>

    You can enter your project directory first, then run the command. Once the configuration loads, enter a task directly in Continue CLI.
  </Step>
</Steps>

### Change the model

After changing `model` in `config.yaml`, end the current `cn` session and start it again. the Model ID must be compatible with the configured endpoint.

To use a separate configuration for one project, save it in that project and provide its path explicitly:

```bash theme={null}
cn --config ./continue-bettertoken.yaml
```

## 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

| Symptom                                    | What to do                                                                                                      |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| `401`, `Unauthorized`, or an API Key error | Confirm `BETTERTOKEN_API_KEY` is set in the current terminal and is a BetterToken API Key.                      |
| `model not found` or model unavailable     | Copy a current **model ID from a supported provider** from the model plaza. Do not use a Claude provider model. |
| Continue still uses an old configuration   | Start with `cn --config` and the explicit file path. Check that the filename is `config.yaml`.                  |
| Wrong request URL or `404`                 | Confirm `apiBase` is `https://www.bettertoken.ai/v1`. Do not append `/chat/completions` or a model name.        |
| The API Key variable is not resolved       | Set `BETTERTOKEN_API_KEY` in the same terminal that starts `cn`, then launch it again.                          |

### Setup FAQ

**Which Base URL should Continue CLI use?**

Use `https://www.bettertoken.ai/v1`. This is BetterToken's OpenAI-compatible Base URL.

**Can I use a BetterToken API key?**

Yes. `provider: openai` with `useResponsesApi: false` uses OpenAI-compatible Chat Completions. Get both the API Key and Model ID from BetterToken.

**How do I view or switch saved configurations?**

Enter `/config` inside a Continue CLI session to view and choose local configurations.

## 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>

### Related guides

* [Aider custom model setup](/en/ai-tools/aider)
* [Codex CLI custom provider setup](/en/ai-tools/codex)
* [Cursor custom API, Base URL, and API Key setup](/en/ai-tools/cursor)
* [Configure an OpenAI-compatible API in Cline](/en/ai-tools/cline)

## Technical details

<Accordion title="Protocol, endpoint, and internal provider fields">
  This setup uses `provider: openai`, `apiBase: "https://www.bettertoken.ai/v1"`, and `useResponsesApi: false`. Continue calls Chat Completions, so do not append `/chat/completions` to `apiBase`.
</Accordion>
