vercel ai-gateway coding-agents setup configures agent clients
Introduced 2026-07-13 · score 0.91
HOW TO USE IT
When connecting Claude Code, Codex, OpenCode, or Pi with an existing AI Gateway key, run the setup command with `--key <key>` and select the client with `--agent <name>` if needed. The command configures the selected client without pinning a default model, as stated in the release note.
vercel ai-gateway coding-agents setup --key <AI_GATEWAY_API_KEY> --agent <claude-code|codex|opencode|pi>WHY THIS HELPS
Connect Claude Code, Codex, OpenCode, or Pi to the AI Gateway from an existing API key.
REQUIREMENTS AND LIMITATIONS
- Version: 56.0.0
- --key <KEY>: Use an existing AI Gateway API key instead of creating one.
- --agent <NAME>: Select an agent to configure; repeatable. Supported values: claude-code, codex, opencode, pi.
- Claude Code configuration honors `CLAUDE_CONFIG_DIR`; edits existing config in place, preserves keys and formatting, skips unparseable configs, masks the key in output, is idempotent, and emits a structured JSON result in non-interactive mode.
- Codex writes a `vercel` model provider with an OpenAI-compatible base URL and `responses` wire API, honors `CODEX_HOME` and fish/`ZDOTDIR`, and edits existing assignments in place while preserving comments and formatting.
- OpenCode honors `XDG_CONFIG_HOME`; with macOS Keychain in use, the key stays out of config and is resolved at runtime from `AI_GATEWAY_API_KEY` exported by the shell rc.
- Pi creates `~/.pi/agent/auth.json` with mode `0600` and honors `PI_CODING_AGENT_DIR`.
FIRST-PARTY EVIDENCE
- https://github.com/vercel/vercel/releases/tag/vercel%4056.0.0
- https://github.com/vercel/vercel/blob/vercel%4056.0.0/packages/cli/src/commands/ai-gateway/command.ts
Check the installed version and the source before using it. Entry JSON