# Cline

<Callout type="info" title="Note">
  AI Gateway is part of [AI Governance](/beta-docs/ai-coder/ai-governance/), which is
  included with a Premium license.
</Callout>

Cline supports both OpenAI and Anthropic models and can be configured to use AI Gateway by setting providers.

## Configuration [#configuration]

To configure Cline to use AI Gateway, follow these steps:
![Cline Settings](/beta-docs/images/aibridge/clients/cline-setup.png)

## Centralized API Key [#centralized-api-key]

<Tabs items="[&#x22;OpenAI Compatible&#x22;, &#x22;Anthropic&#x22;]" groupId="coder-docs-tab:anthropic-openai-compatible" persist="true">
  <Tab value="OpenAI Compatible">
    1. Open Cline in VS Code.
    2. Go to **Settings**.
    3. **API Provider**: Select **OpenAI Compatible**.
    4. **Base URL**: Enter `https://coder.example.com/api/v2/ai-gateway/openai/v1`.
    5. **OpenAI Compatible API Key*&#x2A;: Enter your &#x2A;*[Coder API token](/beta-docs/admin/users/sessions-tokens/#generate-a-long-lived-api-token-on-behalf-of-yourself)**.
    6. **Model ID** (Optional): Enter the model you wish to use (e.g., `gpt-5.2-codex`).

    ![Cline OpenAI Settings](/beta-docs/images/aibridge/clients/cline-openai.png)
  </Tab>

  <Tab value="Anthropic">
    1. Open Cline in VS Code.
    2. Go to **Settings**.
    3. **API Provider**: Select **Anthropic**.
    4. **Anthropic API Key**: Enter your **Coder API token**.
    5. **Base URL**: Enter `https://coder.example.com/api/v2/ai-gateway/anthropic&#x60; after checking &#x2A;**Use custom base URL***.
    6. **Model ID** (Optional): Select your desired Claude model.

    ![Cline Anthropic Settings](/beta-docs/images/aibridge/clients/cline-anthropic.png)
  </Tab>
</Tabs>

## BYOK (Personal API Key) [#byok-personal-api-key]

<Tabs items="[&#x22;OpenAI Compatible&#x22;]" groupId="coder-docs-tab:openai-compatible" persist="true">
  <Tab value="OpenAI Compatible">
    1. Open Cline in VS Code.
    2. Go to **Settings**.
    3. **API Provider**: Select **OpenAI Compatible**.
    4. **Base URL**: Enter `https://coder.example.com/api/v2/ai-gateway/openai/v1`.
    5. **OpenAI Compatible API Key**: Enter your personal OpenAI API key.
    6. **Model ID** (Optional): Enter the model you wish to use (e.g., `gpt-5.2-codex`).
    7. **Custom Headers**: Add `X-Coder-AI-Governance-Token&#x60; with your &#x2A;*[Coder API token](/beta-docs/admin/users/sessions-tokens/#generate-a-long-lived-api-token-on-behalf-of-yourself)**.

    ![Cline BYOK OpenAI Settings](/beta-docs/images/aibridge/clients/cline-byok-openai.png)
  </Tab>
</Tabs>

**References:** [Cline Configuration](https://github.com/cline/cline)
