Skip to navigation

Building with coding agents

Route your IDE or terminal coding agent through Gateway with one API key

Point a coding tool’s custom provider or base URL at Gateway to use any Gateway model under one API key, with routing policies, budgets, and request logs in the dashboard. Tool pages cover only their own config.

API key

Create an organization key on the API keys page, or a project key from a project’s API keys tab. Both work everywhere; prefer a project key, which attributes requests to that project so its routing policy and budget apply.

Choose a model

Model names use provider/model form, such as anthropic/claude-opus-5, openai/gpt-5.5, or google/gemini-3.6-flash. Browse them in the model catalog, the dashboard models page, or GET /v1/models, and pick models where vendors.<vendor>.capabilities.supports_tool_calling is true, since coding agents edit files through tool calls.

Let routing choose

Any model field accepts a model alias such as @alias/coding-heavy. Each organization routing policy has one named after it, so you change models in the policy, not every developer’s config.

The model name default_routing uses the key’s project policy, or the organization default for an organization key. If neither exists, the request fails with model_required.

Scope to a project

Use a project API key, or with an organization key send the project’s ID in the X-Project-Id header (or body project_id on OpenAI-compatible endpoints). A project key locks its project: a different ID returns 400 project_mismatch.

Persist your API key

Most tools read the key from an environment variable such as MERGE_GATEWAY_API_KEY; export it in your shell profile (~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish). macOS apps launched from the Dock don’t read your shell profile.

Reference

ToolConfigure inGateway endpoint
CursorCursor Settings/v1/openai/chat/completions
Zedsettings.json/v1/openai/chat/completions
Continue.devconfig.yaml/v1/openai/chat/completions
OpenCode/connect/v1/ai-sdk
Claude CodeEnvironment variables/v1/anthropic/v1/messages
Claude DesktopThird-party inference settings or MDM/v1/anthropic/v1/messages
Codex~/.codex/config.toml/v1/openai/responses
Pi~/.pi/agent/models.json/v1/openai/chat/completions
Factory Droid~/.factory/settings.json/v1/openai/responses

Claude Code, Codex, and OpenCode sessions group under one Thread ID in Logs with no config, from their own session headers. For other tools, see tracing from coding agents.

Next steps