Skip to content
Docs

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:

terminal
npx vercel ai-gateway setup

npx runs Vercel CLI without installing it globally. To keep vercel available as a global command, install or update the CLI before running setup:

terminal
npm i -g vercel@latest
vercel ai-gateway setup

The 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
Aideraider
Claude Codeclaude-code
Clinecline
Codexcodex
Continue CLIcontinue
GitHub Copilot CLIcopilot
Crushcrush
Cursorcursor
Deep Agents CLIdeepagents
DeepSeek Harnessdeepseek
Factory Droiddroid
ForgeCodeforge
fxfx
Goosegoose
gptmegptme
Grok Buildgrok
Hermeshermes
Junie CLIjunie
Kilo Codekilo
Kimi CLIkimi
ompomp
OpenClawopenclaw
OpenCodeopencode
OpenHandsopenhands
Pipi
Qwen Codeqwen
Mistral Vibevibe
ZCodezcode
Zedzed

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

Every agent above also works when you configure it by hand, and the agents the CLI doesn't cover can only be set up that way. For the full command reference, including flags, key storage, session migration, and non-interactive output, see vercel ai-gateway.

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/v1

That 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:

AgentEndpoint
Claude Codehttps://ai-gateway.vercel.sh/claude-code
OpenAI Codexhttps://ai-gateway.vercel.sh/codex/v1
Cursorhttps://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.

BenefitWithoutWith
Spend trackingSeparate dashboards per providerSingle unified view
Model accessLimited to agent's default models200+ models from all providers
BillingMultiple invoices, multiple accountsOne Vercel invoice
ReliabilitySingle point of failureAutomatic provider fallbacks
ObservabilityLimited or no visibilityFull 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=1

Once 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:

~/.codex/config.toml
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-pro

Codex 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 key

OpenCode 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 key

See 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:

  1. Open the Cline settings panel
  2. Select AI 资产生成 as your API Provider
  3. Paste your API key
  4. 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
  1. Run the CLI: vercel ai-gateway setup creates a key and configures every agent it supports. Skip to step 4 when it finishes
  2. Get an API key: to configure a tool by hand, create a key in the 资产生成 page
  3. Configure the connection: point the tool at the endpoint named on its setup page
  4. 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
Last updated September 13, 2026

Was this helpful?

supported.