Skip to main content

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
  2. Pick a model from the model catalog
All plugins below use the same connection details:
ParameterValue
Base URLhttps://api.anyapi.ai/v1
API KeyYour AnyAPI key (sk-...)
Model IDe.g. openai/gpt-4o, anthropic/claude-sonnet-4
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.

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:
FieldValue
Base URLhttps://api.anyapi.ai/v1
API KeyYour AnyAPI key
Model IDe.g. anthropic/claude-sonnet-4
  1. 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.
Use large-context models like anthropic/claude-sonnet-4 for complex tasks and cheaper models like openai/gpt-4o-mini for quick fixes.

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+PContinue: Open configuration file)
  4. Replace the contents with:
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
  1. Reload VS Code (Cmd+Shift+PDeveloper: Reload Window)
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.

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

Setup

  1. Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
  2. Type Chat: Manage Language Models
  3. Click Add ModelsCustom Endpoint
  4. Configure the provider:
FieldValue
API KeyYour AnyAPI key
API TypeChat Completions
  1. Add a model:
FieldValue
IDanthropic/claude-sonnet-4
NameAnyAPI Claude Sonnet
URLhttps://api.anyapi.ai/v1/chat/completions
  1. Save — the model appears in the Copilot Chat model picker
This creates a chatLanguageModels.json file:
[
  {
    "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
      }
    ]
  }
]
Copilot BYOK only applies to chat and agent mode. Inline autocomplete still uses GitHub’s own models.

Option 4: VS Code Native Custom Endpoint

Built-in support for custom AI endpoints, no extensions needed.
Currently available in VS Code Insiders only.

Setup

  1. Open VS Code Insiders
  2. Click the model dropdown in Copilot Chat
  3. Select Manage Language Models…
  4. Click Add ModelsCustom Endpoint
  5. Fill in:
FieldValue
Group NameAnyAPI
Display NameGPT-4o via AnyAPI
Endpoint URLhttps://api.anyapi.ai/v1/chat/completions
API KeyYour AnyAPI key
API TypeChat 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
  2. Open Settings (Ctrl+, / Cmd+,) and search for litellm
  3. Set:
SettingValue
Base URLhttps://api.anyapi.ai
API KeyYour AnyAPI key
Default Modelopenai/gpt-4o

LiteLLM Provider for Copilot Chat

  1. Install LiteLLM Provider for Copilot Chat
  2. Cmd+Shift+PLiteLLM: 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
  2. Cmd+Shift+Pvscode-openai: Set API URLhttps://api.anyapi.ai/v1
  3. Cmd+Shift+Pvscode-openai: Set API Key → your AnyAPI key

Comparison

PluginChatAutocompleteAgentFreeRequires
ClineYesNoYesYes
Continue.devYesYesNoYesContinue account
Copilot BYOKYesNoYesNoCopilot + VS Code Insiders
VS Code NativeYesNoYesYesVS Code Insiders
LiteLLM ExtensionsYesNoNoNoCopilot
vscode-openaiYesNoNoYes

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)
ModelBest for
anthropic/claude-sonnet-4Fast edits, everyday coding
anthropic/claude-opus-4Complex architecture, deep reasoning
openai/gpt-4oMulti-modal, broad knowledge
openai/gpt-4o-miniAutocomplete, quick tasks
deepseek/deepseek-r1Algorithms, math

Troubleshooting

”Model not found”

Use the full provider/model format. Check available models:
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.

”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

Cline Guide

Quick setup guide for Cline

Continue.dev Guide

Quick setup guide for Continue.dev

All Integrations

Browse all supported tools

Model Catalog

Browse 300+ available models