Building with coding agents
Most coding tools, from OpenAI-compatible IDEs like Cursor and Zed to terminal agents like OpenCode, Claude Code, Codex, and Factory Droid, let you plug in a custom provider. Point that provider at Merge Gateway and you get every model Gateway supports, including OpenAI, Anthropic, Google, and Kimi, through a single API key. Routing policies, cost governance, and full request observability come built in, visible in the Gateway dashboard.
The three inputs
The OpenAI-compatible IDE guides on this page (Cursor, Zed, Continue.dev) all ask for the same three values:
Either key type works in every tool. A project API key additionally scopes all of the tool’s usage to that project, so the project’s routing policy and budget apply with nothing else to configure; that’s the recommended way to track and govern coding-agent traffic. Setting the model name to default_routing hands model selection to your routing policy (the key’s project policy or the org default) instead of pinning one model.
Get the full list of available models from GET /v1/models or the models page in the dashboard.
OpenCode, Claude Code, Codex, Pi, and Factory Droid follow different setup shapes (a custom provider in opencode.json, an ANTHROPIC_BASE_URL override, a model provider + profile in ~/.codex/config.toml, a custom provider in ~/.pi/agent/models.json, and a custom model in ~/.factory/settings.json respectively); see their dedicated guides below for the exact config.
Desktop apps route through Gateway too. The Codex desktop app uses top-level keys in ~/.codex/config.toml, and Anthropic’s Claude Desktop (Chat, Cowork, and the built-in Claude Code surface) has its own third-party inference settings and MDM export pointed at Gateway’s Anthropic endpoint.
Supported tools
Override OpenAI Base URL in Cursor Settings. Supports Ask and Plan modes.
Add Gateway as an OpenAI-compatible provider in settings.json
One-entry config.yaml change. Works in VS Code and JetBrains.
Add Merge Gateway as a custom provider in opencode.json. Works for tool calls and file edits.
Override ANTHROPIC_BASE_URL and auth token. Works for tool calls and file edits.
Point the app’s Gateway inference provider at Merge Gateway, with model discovery and MDM export
Register Merge Gateway in ~/.codex/config.toml and opt in via codex --profile merge_gateway
Add Gateway as a custom provider, then filter /model on merge
Add Gateway as a Factory custom model in ~/.factory/settings.json