{
  "slug": "vercel-ai-gateway-coding-agents-setup-configures-agent-clients-280361864094",
  "title": "vercel ai-gateway coding-agents setup configures agent clients",
  "tools": [
    "vercel"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-07-13T18:03:12.000Z",
  "announced_at": "2026-07-13T18:03:12.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "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.",
    "examples": [
      "vercel ai-gateway coding-agents setup --key <AI_GATEWAY_API_KEY> --agent <claude-code|codex|opencode|pi>"
    ],
    "gotchas": [
      "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`."
    ]
  },
  "why_it_matters": "Connect Claude Code, Codex, OpenCode, or Pi to the AI Gateway from an existing API key.",
  "sources": [
    "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"
  ],
  "rank": 0.91049,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-a0e1853aa2fa0fee-1:gate",
    "evidence_hash": "482b93973b678f2f79d01a7de5cacacb154434f267f6437e50df19fc5a27932b"
  },
  "review": {
    "draft_hash": "066b6fe85db03c6553d5fe20c00664d8b557006a87009a98ce450ed97d34d2b0",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "2 of 3 judge runs approved with p_yes >= 0.9 (mean 0.91 >= 0.9; 2 needed) and Jev gave 0.66 (>= 0.6 needed)."
  }
}
