Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Model API SwitchNew to Visual Studio Code? Get it now.
Model API Switch

Model API Switch

Lane

|
1 install
| (0) | Free
一站式大模型API Key管理工具
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Model API Switch

English | 中文


English

A VSCode extension for unified API key management across multiple AI coding agents. Add your providers once, then switch any agent's configuration in one click.

Features

  • Multi-provider management — store multiple providers (name, API key, base URLs) in one place
  • One-click model switching — instantly write the selected provider/model config to Claude Code, Codex, or OpenCode
  • Per-agent configuration — each agent (Claude Code / Codex / OpenCode) tracks its own active selection independently
  • Restore defaults — switch any agent back to its original official configuration at any time
  • OpenAI & Anthropic base URL support — configure separate base URLs for OpenAI-compatible agents and Claude Code

Supported Agents

Agent Config written
Claude Code ~/.claude/settings.json
Codex ~/.codex/config.toml
OpenCode ~/.config/opencode/opencode.json

How to Use

1. Add a provider

Click the + button next to Providers in the panel. Fill in:

  • Name — a label for this provider (e.g. My OpenAI)
  • Base URL — OpenAI — for Codex / OpenCode (e.g. https://api.openai.com/v1)
  • Base URL — Anthropic — for Claude Code (e.g. https://api.anthropic.com)
  • API Key — your secret key

2. Add models to a provider

Click a provider row to expand it, then click the + at the bottom of the list to add a model name (e.g. gpt-4o, claude-opus-4-5).

3. Switch an agent

In the Switch Model section at the top:

  1. Select the Agent you want to configure
  2. Select a Provider and Model
  3. Click Switch

To restore an agent's original settings, select Default (Official) as the provider and click Switch.


中文

一款 VSCode 插件,用于统一管理多个 AI 编程助手的 API Key。只需添加一次供应商信息,即可一键切换任意 Agent 的配置。

功能特性

  • 多供应商管理 — 在一处集中存储多个供应商(名称、API Key、Base URL)
  • 一键切换模型 — 即时将所选供应商/模型配置写入 Claude Code、Codex 或 OpenCode
  • 独立 Agent 配置 — 每个 Agent 各自记录当前激活的选择,互不干扰
  • 恢复默认配置 — 随时将任意 Agent 切换回官方原始配置
  • 双协议 Base URL 支持 — 分别为 OpenAI 兼容 Agent 和 Claude Code 配置不同的 Base URL

支持的 Agent

Agent 写入的配置文件
Claude Code ~/.claude/settings.json
Codex ~/.codex/config.toml
OpenCode ~/.config/opencode/opencode.json

使用方法

1. 添加供应商

在面板 Providers 区域点击 + 按钮,填写:

  • Name — 供应商名称(如 My OpenAI)
  • Base URL — OpenAI — 用于 Codex / OpenCode(如 https://api.openai.com/v1)
  • Base URL — Anthropic — 用于 Claude Code(如 https://api.anthropic.com)
  • API Key — 你的密钥

2. 为供应商添加模型

点击供应商行展开列表,点击底部的 + 添加模型名称(如 gpt-4o、claude-opus-4-5)。

3. 切换 Agent

在顶部 Switch Model 区域:

  1. 选择要配置的 Agent
  2. 选择 Provider 和 Model
  3. 点击 Switch

如需恢复官方默认配置,将 Provider 选为 Default (Official) 后点击 Switch 即可。

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft