How to Use Claude API in VS Code — Extensions & Setup
Set up Claude API in Visual Studio Code using Continue, Cline, Roo Code, and Kilo Code. Step-by-step guide with safe LLMsRelay credential handling.
Claude in VS Code
Visual Studio Code supports Claude through several AI extensions. With a LLMsRelay API key, you can connect any of them to Claude Sonnet, Opus, or Haiku — getting AI-powered coding assistance directly in your editor.
Best VS Code Extensions for Claude
Continue
Continue is an open-source AI code assistant that supports Claude natively. It offers chat, inline editing, and autocomplete.
Setup: Install from VS Code marketplace → Settings → Add provider → Select "Anthropic" → Enter your LLMsRelay base URL and API key.
https://api.llmsrelay.com in the Continue config to use LLMsRelay.Cline
Cline is an autonomous coding agent that can create files, run commands, and build entire features. It works exceptionally well with Claude Sonnet.
Setup: Install Cline → Open settings → Select "OpenAI Compatible" → Enter your API key and set the base URL to https://api.llmsrelay.com/v1.
Roo Code
Roo Code is a fork of Cline with additional features like custom modes and MCP support. Use the same OpenAI-compatible base URL as Cline: https://api.llmsrelay.com/v1.
Kilo Code
Kilo Code supports separate custom Anthropic Messages and OpenAI Responses providers, unlike the OpenAI-compatible Cline/Roo route.
Use @ai-sdk/anthropic with a Basic key for Claude models, and @ai-sdk/openai with a separate Codex key for GPT/Codex models. Both use https://api.llmsrelay.com/v1; add keys through Kilo credentials or /connect, then select an exact ID from GET /v1/models.
See the full Kilo Code setup for the portable provider configuration and all available model IDs.
Which Model to Use
- Claude Sonnet 4.6 — recommended for most coding tasks. Best price/quality ratio.
- Claude Opus 4.7 — use for complex refactors, architecture, and multi-file changes.
- Claude Haiku 4.5 — use for autocomplete and simple inline suggestions to save costs.
Common Configuration
The gateway is the same, but the provider mode depends on the extension:
- Continue: use its Anthropic provider with the base URL expected by the installed version.
- Cline / Roo Code: use OpenAI Compatible with
https://api.llmsrelay.com/v1. - Kilo Code: use
@ai-sdk/anthropic+ Basic for Claude, or@ai-sdk/openai+ Codex for GPT/Codex withhttps://api.llmsrelay.com/v1. - API Key: add it through the extension's credential storage or UI; do not publish it in project configuration.
- Model:
claude-sonnet-4.6(or any supported model)
For the full list of models and IDs, see our Models page.
Tips
- Set per-key credit limits in your LLMsRelay dashboard to control spending
- Use the OpenAI-compatible endpoint if your extension expects an OpenAI-format API
- Check our VS Code Extensions guide for detailed configuration walkthroughs