Skip to main content
A VS Code extension that integrates Vercel AI Gateway models directly into VS Code’s native chat interface, enabling seamless AI-powered development workflows.

Features

Multiple AI Models

Access all Vercel AI Gateway models including GPT-4o, Claude, Gemini, and more

Native Integration

Works seamlessly with VS Code’s built-in chat interface and Copilot

Streaming Responses

Real-time streaming of AI responses for instant feedback

Tool Calling

Full support for VS Code tool integration and function calling

Installation

Install the extension from the VS Code Marketplace:
  1. Open VS Code
  2. Go to Extensions (Cmd/Ctrl + Shift + X)
  3. Search for “Vercel AI Gateway”
  4. Click Install
Or install via the command line:
code --install-extension SferaDev.vscode-extension-vercel-ai

Authentication

The extension supports two authentication methods:

API Key Authentication

The simplest way to authenticate is with a Vercel AI Gateway API key:
  1. Open Command Palette (Cmd/Ctrl + Shift + P)
  2. Search for “Vercel AI Gateway: Manage Authentication”
  3. Select “API Key”
  4. Enter your API key (starts with vck_)
You can obtain an API key from the Vercel AI Gateway dashboard.

OIDC Authentication (Vercel CLI)

For enhanced security, you can use OIDC authentication via the Vercel CLI:
  1. Ensure you’re logged in to the Vercel CLI (vercel login)
  2. Open Command Palette (Cmd/Ctrl + Shift + P)
  3. Search for “Vercel AI Gateway: Manage Authentication”
  4. Select “Vercel OIDC”
  5. Choose your team and project
OIDC tokens are automatically refreshed when they expire.

Usage

Once authenticated, the extension automatically registers as a language model provider in VS Code.

Using with VS Code Chat

  1. Open the Chat panel (Cmd/Ctrl + Shift + I)
  2. Click the model selector dropdown
  3. Choose a model from “Vercel AI Gateway”
  4. Start chatting!

Using with GitHub Copilot Chat

The extension integrates with GitHub Copilot Chat, allowing you to use Vercel AI Gateway models as an alternative to the default Copilot models.

Available Models

The extension dynamically fetches available models from the Vercel AI Gateway. Supported models include:
ProviderModels
OpenAIGPT-4o, GPT-4o Mini, GPT-4 Turbo
AnthropicClaude 3.5 Sonnet, Claude 3 Opus, Claude 3 Haiku
GoogleGemini 1.5 Pro, Gemini 1.5 Flash
And more…All models supported by Vercel AI Gateway
All models support:
  • Text generation with streaming
  • Tool calling (where supported by the underlying model)
  • Token counting

Session Management

The extension supports multiple authentication sessions, allowing you to switch between different API keys or OIDC configurations.

Managing Sessions

  1. Open Command Palette (Cmd/Ctrl + Shift + P)
  2. Search for “Vercel AI Gateway: Manage Authentication”
  3. Choose from:
    • Add new authentication - Add a new API key or OIDC session
    • Switch active session - Switch between existing sessions
    • Remove session - Delete a saved session

Troubleshooting

  1. Ensure you’re authenticated (check via “Manage Authentication” command)
  2. Try reloading VS Code (Cmd/Ctrl + Shift + P → “Reload Window”)
  3. Check the Output panel for error messages (select “Vercel AI Gateway” from the dropdown)
  1. Verify you’re logged in to the Vercel CLI: vercel whoami
  2. If not logged in, run: vercel login
  3. Ensure the project you selected has AI Gateway enabled
  1. Verify your API key starts with vck_
  2. Check that your API key has the necessary permissions
  3. Try removing and re-adding the session

Development

To contribute or run the extension locally:
# Clone the repository
git clone https://github.com/SferaDev/SferaDev.git
cd SferaDev

# Install dependencies
pnpm install

# Build the extension
pnpm --filter vscode-extension-vercel-ai build

# Open in VS Code for debugging
code apps/vscode-ai-gateway
Press F5 to launch the Extension Development Host.

Source Code

The extension is part of the SferaDev monorepo and can be found at:
apps/vscode-ai-gateway/