Skip to Content

AI Gateway

Coding Agents


Command Code with AI Gateway

Configuring Command Code

Command Code

Use Command Code with AI Gateway for model access and spend monitoring. Command Code's bring your own key (BYOK) configuration, currently in beta, lets you set a custom provider endpoint and choose models.

Copy page

Command Code requires manual configuration. The Vercel CLI setup command does not configure it.

  1. Install Command CodeWith Node.js 22 or later installed, run:

    npm i-gcommand-code@latest

    command-code --versionThe second command prints the installed version. See the Command Code installation instructions for platform-specific details.If you haven't signed in to Command Code, run:

    command-code loginComplete the sign-in in your browser, then return to the terminal after Command Code confirms the login.
  2. Create an API keyCreate an AI Gateway API key and export it in the terminal where you run Command Code:

    export AI_GATEWAY_API_KEY="your-ai-gateway-api-key"Replace your-ai-gateway-api-key with your key.
  3. Configure the providerCreate ~/.commandcode/providers.json with the following configuration. If the file exists, add the vercel entry to its provider object:

    {

    "provider": {

    "vercel": {

    "name":"Vercel AI Gateway",

    "baseURL":"https://ai-gateway.vercel.sh/coding-agent/v1",

    "apiKey":"$AI_GATEWAY_API_KEY",

    "models": {

    "deepseek/deepseek-v4.1-flash": {}

    } } } }The baseURL uses the coding agent endpoint. Command Code uses OpenAI-compatible Chat Completions by default. Add an entry under models for each model you want to use, with its AI Gateway model ID.

  4. Start Command CodeStart a session in the same terminal:

    command-codeRun /model and select a model under Vercel AI Gateway. Requests for that model route through AI Gateway. Reopen /model after editing providers.json to load your changes.Send a prompt, then check AI Gateway logs to verify the request.

Next steps


Last updated September 13, 2026

Was this helpful?

Cross-link map: Command Code with AI Gateway (/docs/ai-gateway/coding-agents/command-code)From the Vercel docs graph (built 2026-09-21T05:26:59.511Z), spanning vercel.com docs + KB, nextjs.org, ai-sdk.dev, and other Vercel documentation sites. Full graph as JSON: https://vercel.com/docs/graph.jsonSemantically closest pagesOpenCode with AI Gateway — Connect OpenCode to AI Gateway with one CLI command, or configure it in-app.ZCode with AI Gateway — Connect ZCode to AI Gateway with the Vercel CLI or an OpenAI-compatible custom provider.ForgeCode with AI Gateway — Connect ForgeCode to AI Gateway with the Vercel CLI or custom provider and credential files.Kilo Code with AI Gateway — Connect Kilo Code to AI Gateway with the Vercel CLI or an OpenAI-compatible provider configuration. Set your API key andGitHub Copilot CLI with AI Gateway — Connect GitHub Copilot CLI to AI Gateway with the Vercel CLI or environment variables for the provider URL, API key, andThis page links to (5)AI Gateway Authentication and BYOK — Authenticate AI Gateway requests with API keys or OIDC tokens, and configure bring your own key \(BYOK\) credentials forCoding Agents and Chat Platforms with AI Gateway — Connect coding agents and chat platforms to AI Gateway. Configure Claude Code, Codex, Chatbox, Open WebUI, and more.AI Gateway Request Logs — Search, filter, and follow individual AI Gateway requests, inspect provider routing for one request, and export the resuAI Gateway Generation Lookup and Usage API — Look up an AI Gateway generation by ID to inspect its provider, latency, token usage, cost, and finish reason, or checkvercel ai-gateway — Manage AI Gateway resources from the Vercel CLI: API keys, budgets, routing rules, virtual models, models, leaderboards,Pages that link here (1)By site: vercel-docs (1)Coding Agents and Chat Platforms with AI Gateway — Connect coding agents and chat platforms to AI Gateway. Configure Claude Code, Codex, Chatbox, Open WebUI, and more.