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

# VS Code Integration

> Use AnyAPI models in VS Code with Cline, Continue.dev, GitHub Copilot BYOK, and other AI plugins

# Use AnyAPI in VS Code

AnyAPI works with any VS Code AI plugin that supports custom OpenAI-compatible endpoints. Point the plugin at `https://api.anyapi.ai/v1`, add your API key, and you get access to 300+ models.

## Prerequisites

1. Get your API key from the [AnyAPI Dashboard](https://dash.anyapi.ai/?page=api-keys)
2. Pick a model from the [model catalog](https://anyapi.ai/ai-models)

All plugins below use the same connection details:

| Parameter    | Value                                             |
| ------------ | ------------------------------------------------- |
| **Base URL** | `https://api.anyapi.ai/v1`                        |
| **API Key**  | Your AnyAPI key (`sk-...`)                        |
| **Model ID** | e.g. `openai/gpt-4o`, `anthropic/claude-sonnet-4` |

<Note>
  AnyAPI uses `provider/model` format for model IDs. Bare names like `gpt-4o` without the vendor prefix won't work. Browse all models at [anyapi.ai/ai-models](https://anyapi.ai/ai-models).
</Note>

***

## Option 1: Cline (Recommended)

Autonomous AI coding agent. Edits files, runs terminal commands, browses the web. No sign-up required — setup takes 30 seconds.

### Setup

1. Install **Cline** from the Extensions marketplace (`Ctrl+Shift+X` / `Cmd+Shift+X`)
2. Open the Cline panel in the sidebar
3. Click the gear icon (Settings)
4. Set **API Provider** to **OpenAI Compatible**
5. Fill in:

| Field        | Value                            |
| ------------ | -------------------------------- |
| **Base URL** | `https://api.anyapi.ai/v1`       |
| **API Key**  | Your AnyAPI key                  |
| **Model ID** | e.g. `anthropic/claude-sonnet-4` |

6. Click **Save** — you're ready to go

### Usage

Type a task in the chat (e.g. "Create a REST API with Express") and Cline will autonomously create files, install dependencies, and write code. It asks for approval before each action.

<Tip>
  Use large-context models like `anthropic/claude-sonnet-4` for complex tasks and cheaper models like `openai/gpt-4o-mini` for quick fixes.
</Tip>

***

## Option 2: Continue.dev

Open-source AI assistant with chat, autocomplete, refactoring, and code explanation.

### Setup

1. Install **Continue** from the Extensions marketplace
2. Sign in with a Continue.dev account when prompted
3. Open `~/.continue/config.yaml` (`Cmd+Shift+P` → `Continue: Open configuration file`)
4. Replace the contents with:

```yaml theme={"system"}
name: AnyAPI Config
version: 1.0.0
schema: v1
models:
  - name: AnyAPI — Claude Sonnet
    provider: openai
    model: anthropic/claude-sonnet-4
    apiBase: https://api.anyapi.ai/v1
    apiKey: sk-your-anyapi-key
    roles:
      - chat
      - edit

  - name: AnyAPI — GPT-4o
    provider: openai
    model: openai/gpt-4o
    apiBase: https://api.anyapi.ai/v1
    apiKey: sk-your-anyapi-key
    roles:
      - chat
      - edit

  - name: AnyAPI Autocomplete
    provider: openai
    model: openai/gpt-4o-mini
    apiBase: https://api.anyapi.ai/v1
    apiKey: sk-your-anyapi-key
    roles:
      - autocomplete
```

5. Reload VS Code (`Cmd+Shift+P` → `Developer: Reload Window`)

<Info>
  Newer versions of Continue require signing in with a Continue.dev account on first launch. If the login hangs, reload VS Code and try again.
</Info>

### Usage

* **Chat** — Open the Continue panel, select a model, and ask questions
* **Autocomplete** — Start typing code, press `Tab` to accept suggestions
* **Refactoring** — Select code, press `Ctrl+Shift+L` / `Cmd+Shift+L` and describe the change

***

## Option 3: GitHub Copilot BYOK

Use AnyAPI models inside GitHub Copilot Chat with Bring Your Own Key.

<Warning>
  Requires **VS Code Insiders** and a GitHub Copilot subscription (Free plan or above). If the `Chat: Manage Language Models` command is not found, download [VS Code Insiders](https://code.visualstudio.com/insiders/).
</Warning>

### Setup

1. Open Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`)
2. Type `Chat: Manage Language Models`
3. Click **Add Models** → **Custom Endpoint**
4. Configure the provider:

| Field        | Value              |
| ------------ | ------------------ |
| **API Key**  | Your AnyAPI key    |
| **API Type** | `Chat Completions` |

5. Add a model:

| Field    | Value                                       |
| -------- | ------------------------------------------- |
| **ID**   | `anthropic/claude-sonnet-4`                 |
| **Name** | `AnyAPI Claude Sonnet`                      |
| **URL**  | `https://api.anyapi.ai/v1/chat/completions` |

6. Save — the model appears in the Copilot Chat model picker

This creates a `chatLanguageModels.json` file:

```json theme={"system"}
[
  {
    "vendor": "customendpoint",
    "apiKey": "sk-your-anyapi-key",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "anthropic/claude-sonnet-4",
        "name": "AnyAPI Claude Sonnet",
        "url": "https://api.anyapi.ai/v1/chat/completions",
        "toolCalling": true,
        "maxInputTokens": 200000,
        "maxOutputTokens": 16000
      }
    ]
  }
]
```

<Note>
  Copilot BYOK only applies to chat and agent mode. Inline autocomplete still uses GitHub's own models.
</Note>

***

## Option 4: VS Code Native Custom Endpoint

Built-in support for custom AI endpoints, no extensions needed.

<Warning>
  Currently available in **VS Code Insiders** only.
</Warning>

### Setup

1. Open VS Code Insiders
2. Click the model dropdown in Copilot Chat
3. Select **Manage Language Models...**
4. Click **Add Models** → **Custom Endpoint**
5. Fill in:

| Field            | Value                                       |
| ---------------- | ------------------------------------------- |
| **Group Name**   | `AnyAPI`                                    |
| **Display Name** | `GPT-4o via AnyAPI`                         |
| **Endpoint URL** | `https://api.anyapi.ai/v1/chat/completions` |
| **API Key**      | Your AnyAPI key                             |
| **API Type**     | `Chat Completions`                          |

***

## Option 5: LiteLLM Extensions

Two extensions designed for LiteLLM proxies — fully compatible with AnyAPI.

### LiteLLM Connector for Copilot

1. Install [LiteLLM Connector for Copilot](https://marketplace.visualstudio.com/items?itemName=Gethnet.litellm-connector-copilot)
2. Open Settings (`Ctrl+,` / `Cmd+,`) and search for `litellm`
3. Set:

| Setting           | Value                   |
| ----------------- | ----------------------- |
| **Base URL**      | `https://api.anyapi.ai` |
| **API Key**       | Your AnyAPI key         |
| **Default Model** | `openai/gpt-4o`         |

### LiteLLM Provider for Copilot Chat

1. Install [LiteLLM Provider for Copilot Chat](https://marketplace.visualstudio.com/items?itemName=vivswan.litellm-vscode-chat)
2. `Cmd+Shift+P` → `LiteLLM: Add Server`
3. Enter label `AnyAPI`, URL `https://api.anyapi.ai`, and your API key

Supports multiple servers, automatic model aggregation, and cheapest/fastest model selection.

***

## Option 6: vscode-openai

Lightweight extension for OpenAI-compatible APIs.

1. Install [vscode-openai](https://marketplace.visualstudio.com/items?itemName=AndrewButson.vscode-openai)
2. `Cmd+Shift+P` → `vscode-openai: Set API URL` → `https://api.anyapi.ai/v1`
3. `Cmd+Shift+P` → `vscode-openai: Set API Key` → your AnyAPI key

***

## Comparison

| Plugin                 | Chat | Autocomplete | Agent | Free | Requires                   |
| ---------------------- | ---- | ------------ | ----- | ---- | -------------------------- |
| **Cline**              | Yes  | No           | Yes   | Yes  | —                          |
| **Continue.dev**       | Yes  | Yes          | No    | Yes  | Continue account           |
| **Copilot BYOK**       | Yes  | No           | Yes   | No   | Copilot + VS Code Insiders |
| **VS Code Native**     | Yes  | No           | Yes   | Yes  | VS Code Insiders           |
| **LiteLLM Extensions** | Yes  | No           | No    | No   | Copilot                    |
| **vscode-openai**      | Yes  | No           | No    | Yes  | —                          |

### Recommendations

* **Quick start, no sign-up** — Cline
* **Autocomplete + chat** — Continue.dev
* **Already use Copilot** — BYOK or LiteLLM extensions
* **No extensions** — VS Code Native Custom Endpoint (Insiders only)

## Recommended Models for Coding

| Model                       | Best for                             |
| --------------------------- | ------------------------------------ |
| `anthropic/claude-sonnet-4` | Fast edits, everyday coding          |
| `anthropic/claude-opus-4`   | Complex architecture, deep reasoning |
| `openai/gpt-4o`             | Multi-modal, broad knowledge         |
| `openai/gpt-4o-mini`        | Autocomplete, quick tasks            |
| `deepseek/deepseek-r1`      | Algorithms, math                     |

## Troubleshooting

### "Model not found"

Use the full `provider/model` format. Check available models:

```bash theme={"system"}
curl https://api.anyapi.ai/v1/models \
  -H "Authorization: Bearer sk-your-anyapi-key"
```

### "Unauthorized" (401)

Verify your API key is correct and active in the [AnyAPI Dashboard](https://dash.anyapi.ai/?page=api-keys).

### "Payment Required" (402)

Top up your balance or check the limits on your key.

### Slow responses

* Use a faster model (`openai/gpt-4o-mini`)
* Increase the timeout in plugin settings
* Reduce `maxTokens`

## Next Steps

<CardGroup cols={2}>
  <Card title="Cline Guide" icon="robot" href="/use-cases/cline">
    Quick setup guide for Cline
  </Card>

  <Card title="Continue.dev Guide" icon="code" href="/use-cases/continue-dev">
    Quick setup guide for Continue.dev
  </Card>

  <Card title="All Integrations" icon="plug" href="/integrations/overview">
    Browse all supported tools
  </Card>

  <Card title="Model Catalog" icon="list" href="https://anyapi.ai/ai-models">
    Browse 300+ available models
  </Card>
</CardGroup>
