Coding Agents and Chat Platforms with 资产生成
Route coding agents and chat platforms through 资产生成 to share model access, track spend, and configure provider fallbacks in one place.
The Vercel CLI is the recommended way to connect a coding agent. One command provisions or reuses an API key, writes each agent's configuration, and points every agent at the right gateway endpoint:
npx vercel ai-gateway setupnpx runs Vercel CLI without installing it globally. To keep vercel available as a global command, install or update the CLI before running setup:
npm i -g vercel@latest
vercel ai-gateway setupThe command detects the agents installed on your machine, shows you a diff of every planned change before it writes anything, and stores your key in the macOS Keychain instead of in plaintext config. It reuses an existing key when your configs already point at the gateway, and accepts a pasted key so you don't have to mint a new one. Model lists written into agent configs come from the 资产生成 leaderboards, so the defaults track what's actually being used. It also copies your existing Claude Desktop and Codex Desktop sessions so your history survives the provider switch.
Read the full documentation for the command.
| Agent | --agent value |
|---|---|
| Aider | aider |
| Claude Code | claude-code |
| Cline | cline |
| Codex | codex |
| Continue CLI | continue |
| GitHub Copilot CLI | copilot |
| Crush | crush |
| Cursor | cursor |
| Deep Agents CLI | deepagents |
| DeepSeek Harness | deepseek |
| Factory Droid | droid |
| ForgeCode | forge |
| fx | fx |
| Goose | goose |
| gptme | gptme |
| Grok Build | grok |
| Hermes | hermes |
| Junie CLI | junie |
| Kilo Code | kilo |
| Kimi CLI | kimi |
| omp | omp |
| OpenClaw | openclaw |
| OpenCode | opencode |
| OpenHands | openhands |
| Pi | pi |
| Qwen Code | qwen |
| Mistral Vibe | vibe |
| ZCode | zcode |
| Zed | zed |
Detection pre-selects the agents already installed on your machine, and --all covers every agent in the table. To connect a subset, name each one with --agent <value>.
Configuring an agent by hand means telling it where the gateway is. Unless the agent has an endpoint of its own, point it at the coding agent surface:
https://ai-gateway.vercel.sh/coding-agent/v1That URL passes straight through to the standard /v1 handlers, so auth, routing, billing, and errors are identical to the gateway's bare /v1 surface. Prefer it anyway because it marks the traffic as coming from a coding agent. Behavior shared across harnesses can also land there without requiring another config edit. For a client that speaks the Anthropic protocol and appends /v1/messages itself, drop the /v1 and use https://ai-gateway.vercel.sh/coding-agent.
Three agents have a dedicated endpoint, because each needs something the generic surface doesn't do:
| Agent | Endpoint |
|---|---|
| Claude Code | https://ai-gateway.vercel.sh/claude-code |
| OpenAI Codex | https://ai-gateway.vercel.sh/codex/v1 |
| Cursor | https://ai-gateway.vercel.sh/cursor/v1 |
See each agent's page for what its endpoint adds. Agents with a first-party 资产生成 provider, such as Cline, OpenCode, Pi, and omp, already know the URL and only need your API key.
| Benefit | Without | With |
|---|---|---|
| Spend tracking | Separate dashboards per provider | Single unified view |
| Model access | Limited to agent's default models | 200+ models from all providers |
| Billing | Multiple invoices, multiple accounts | One Vercel invoice |
| Reliability | Single point of failure | Automatic provider fallbacks |
| Observability | Limited or no visibility | Full request traces and metrics |
These featured integrations provide a starting point. The setup table above lists every agent supported by the Vercel CLI, and the sidebar lists all integration guides alphabetically.
Claude Code is Anthropic's agentic coding tool for the terminal. The CLI connects it for you with --agent claude-code. To configure it by hand, use environment variables:
export ANTHROPIC_BASE_URL="https://ai-gateway.vercel.sh/claude-code"
export ANTHROPIC_API_KEY=""
export ANTHROPIC_AUTH_TOKEN="your-ai-gateway-api-key"
export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1Once configured, Claude Code works exactly as before, but requests route through the gateway. /claude-code is Claude Code's own compatibility endpoint, and the discovery variable puts every gateway model in its /model picker.
See the Claude Code documentation for the dedicated Claude Code compatibility endpoint, model discovery, and advanced configuration.
OpenAI Codex is OpenAI's terminal-based coding agent. The CLI connects it for you with --agent codex. To configure it by hand, add the following to its configuration file:
model_provider = "vercel"
[model_providers.vercel]
name = "AI 资产生成"
base_url = "https://ai-gateway.vercel.sh/codex/v1"
env_key = "AI_GATEWAY_API_KEY"
wire_api = "responses"/codex/v1 is Codex's own compatibility endpoint, and wire_api = "responses" is required, since Codex no longer speaks Chat Completions.
Then start Codex, optionally on a specific model:
codex
codex --model openai/gpt-5.5-proCodex reads the gateway catalog from /codex/v1/models at startup, so /model inside a session lists every gateway model.
For full configuration options, including the dedicated Codex compatibility endpoint and profiles, see Configure OpenAI Codex.
Command Code supports manual setup with your own 资产生成 API key and a custom base URL. Add 资产生成 as a provider in ~/.commandcode/providers.json, using https://ai-gateway.vercel.sh/coding-agent/v1 as the baseURL.
Run /model to select one of your configured models under AI 资产生成.
See the Command Code documentation for the provider configuration and API key setup.
OpenCode is an open-source, terminal-based AI coding agent with native support. The CLI connects it for you with --agent opencode. You can also connect directly from within the tool:
opencode
> /connect
# Select "AI 资产生成" and enter your API keyOpenCode automatically discovers available models and lets you switch between them on the fly.
See the OpenCode documentation for more features.
Blackbox AI is a terminal-based CLI for AI-powered code generation and debugging. Configure it with the interactive setup:
blackbox configure
# Select "Configure Providers", choose "AI 资产生成", and enter your API keySee the Blackbox AI documentation for installation and setup.
Cline is a VS Code extension and CLI that provides autonomous coding assistance. The CLI connects it for you with --agent cline. To configure the extension by hand:
- Open the Cline settings panel
- Select AI 资产生成 as your API Provider
- Paste your API key
- Choose a model from the auto-populated catalog
Cline tracks detailed metrics including reasoning tokens, cache performance, and latency.
See the Cline documentation for troubleshooting tips.
Amp connects to 资产生成 through Amp's Model Routing settings. The integration is currently early access for Amp Megawatt and Gigawatt members and requires manual configuration.
See Configure Amp with 资产生成 for eligibility, setup, and model selection.
Aider is an open-source terminal pair-programming agent. The Vercel CLI configures its 资产生成 base URL, default model, model metadata, and API key environment variable.
See Configure Aider with 资产生成 for manual setup, model metadata, and model selection.
Cursor is an AI-first code editor. The Vercel CLI provisions an API key and prints the values you need to finish configuration in Cursor's account-synced settings.
See Configure Cursor with 资产生成 for the full setup and Cursor's BYOK limitations.
GitHub Copilot CLI is GitHub's terminal coding agent. Its BYOK mode uses environment variables, so the Vercel CLI can connect it without a config file or GitHub sign-in.
See Configure GitHub Copilot CLI with 资产生成 for automatic and manual setup.
Harbor runs benchmarks such as Terminal-Bench with your choice of coding-agent harness. It supports built-in adapters, including Claude Code, Codex, fx, OpenCode, and Pi, as well as custom agents. Connect a harness to 资产生成 through its adapter's provider or compatible API settings. Configure Harbor with harbor run; Harbor does not have a vercel ai-gateway setup --agent value.
See the Harbor guide for Codex, Claude Code, OpenCode, Pi, and fx examples, connection settings for more harnesses, and separate verifier credentials.
Chatbox and Open WebUI require manual configuration. OpenClaw works with vercel ai-gateway setup --agent openclaw:
- Chatbox, a cross-platform desktop chat interface
- Open WebUI, a self-hosted web interface
- OpenClaw, which connects coding agents and messaging platforms
- Run the CLI:
vercel ai-gateway setupcreates a key and configures every agent it supports. Skip to step 4 when it finishes - Get an API key: to configure a tool by hand, create a key in the 资产生成 page
- Configure the connection: point the tool at the endpoint named on its setup page
- Start using the tool: requests now route through 资产生成
Once your tools are connected, view usage in the Observability section in the sidebar:
- Spend by tool: See how much each tool costs
- Model usage: Track which models your tools use most
- Request traces: Debug issues with full request/response logs
- Connect your agents with the Vercel CLI
- Set up Claude Code
- Configure OpenAI Codex with custom profiles
- Try OpenCode for native integration
- Set up Pi for its first-class gateway provider
- Configure Cursor with a custom OpenAI base URL
- Set up Blackbox AI CLI for code generation
- Configure Cline for autonomous coding assistance
- Configure Command Code with your own API key and a custom base URL
- Install Roo Code as a VS Code extension
- Configure Conductor for parallel agents
- Configure Crush for LSP-enhanced coding
- Configure Grok Build for SpaceXAI's terminal coding agent
- Configure Hermes for Nous Research's terminal coding agent
- Configure Kilo Code as an OpenAI-compatible provider
- Configure omp for its inherited first-class gateway provider
- Configure OpenClaw for multi-provider routing
- Configure Superset for terminal-first AI coding
- Configure Aider for AI pair programming in git
- Configure Continue CLI for
cnand IDE extensions - Configure GitHub Copilot CLI for BYOK mode
- Configure Deep Agents CLI for LangChain's terminal agent
- Configure DeepSeek Harness for DeepSeek's terminal agent
- Configure Factory Droid with BYOK custom models
- Configure ForgeCode with a custom provider
- Configure fx for its native gateway support
- Configure Goose with a custom provider
- Configure gptme with a custom provider
- Configure Junie CLI with model profiles
- Configure Kimi CLI with a
[models]shortlist - Configure OpenHands for app and headless runs
- Configure Qwen Code with model providers
- Configure Mistral Vibe with a custom provider
- Configure ZCode with a custom provider
- Configure Zed with its first-party gateway provider
Was this helpful?