# Coding Agents

AI coding agents are transforming how developers write, debug, and refactor code. Route these agents through AI Gateway to get a single dashboard for spend tracking, access to any model, and automatic fallbacks, all while using the familiar interfaces of your favorite tools.

## Why route coding agents here?

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

## Supported agents

### Claude Code

[Claude Code](https://docs.anthropic.com/en/docs/claude-code) is Anthropic's agentic coding tool for the terminal. Configure it with environment variables:

```bash
export ANTHROPIC_BASE_URL="https://ai-gateway.vercel.sh"
export ANTHROPIC_API_KEY="your-ai-gateway-api-key"
```

Once configured, Claude Code works exactly as before, but requests route through the gateway.

See the [Claude Code documentation](/docs/ai-gateway/coding-agents/claude-code) for advanced configuration.

### OpenAI Codex

[OpenAI Codex](https://github.com/openai/codex) (also known as Codex CLI) is OpenAI's terminal-based coding agent. Configure it through its config file:

```toml filename="~/.codex/config.toml"
[profiles.vercel]
provider = "openai"
model = "anthropic/claude-sonnet-4.5"
api_key_env_var = "AI_GATEWAY_API_KEY"

[providers.openai]
base_url = "https://ai-gateway.vercel.sh/v1"
```

Then use it with the Vercel profile:

```bash
codex --profile vercel "explain this codebase"
```

See the [Codex documentation](/docs/ai-gateway/coding-agents/codex) for setup details.

### OpenCode

[OpenCode](https://github.com/opencode-ai/opencode) is an open-source, terminal-based AI coding assistant with native support. Connect directly from within the tool:

```bash
opencode
> /connect