Roll out Gateway to your fleet

Three ways to get every employee's AI client routing through Merge Gateway, and how to choose between them

Pointing one machine at Gateway takes two minutes: a base URL, an API key, a model name. Pointing every machine at it is a different problem, and what you are really choosing is how that configuration reaches the machine and what happens when someone changes it back.

There are three ways. They are not mutually exclusive, and most companies run two: a managed path for the clients that support it, and voluntary setup for the rest.

Governance is the reason to do this. Once traffic runs through Gateway you get routing policies, spend caps, model restrictions, and a per-person request log. Employee experience is the reason it lasts. A rollout that takes tools away, or makes people fight their own config, moves the work to personal accounts on personal machines, where you see none of it.

Decide the inputs once

Every AI client asks for the same three values. Settle them at the organization level and each path below becomes a delivery problem rather than a design problem.

InputValueFleet guidance
Base URLhttps://api-gateway.merge.dev/v1/openai for OpenAI-compatible clients, https://api-gateway.merge.dev/v1/anthropic for Claude Code and Claude DesktopFixed. Same for everyone. Sending an Anthropic client to the OpenAI prefix is the most common setup mistake
API keyAn organization key, or a project API key from a project’s API keys tabThe decision that matters. See below
Model nameprovider/model, or default_routingUse default_routing for fleets. Model choice then lives in your routing policy, not in nine config files you edit again next quarter

Choose your key strategy first

The key decides who gets attributed and which budget applies.

  • Organization key, shared. One key for everyone. Fast, and you get no per-person attribution and no per-team budget. Fine for a pilot, not for a fleet.
  • Project API key per team. Create a project per team and push its key to that team’s machines. The project’s routing policy and budget apply automatically with nothing else to configure. This is the right answer for the MDM and voluntary paths.
  • Per-employee key, provisioned automatically. The desktop client and the Workforce CLI both do this. The desktop client mints a key scoped to the signed-in employee’s billing project, so spend attributes to the person rather than the team, and it refuses to mint until the device is attributed to a resolved employee. The CLI mints a credential per device off the employee’s own sign-in, so there is no key for you to distribute.

If per-person spend attribution is a requirement, the desktop client and the Workforce CLI are the two paths that give it to you without minting and distributing keys by hand.

Compare the three paths

Desktop clientYour own MDMVoluntary
Who configures the machineThe Merge clientYour MDMThe employee
PrerequisiteMDM-managed fleet, SSO and SCIM connectedAny MDMNone
Clients coveredClaude Code, Codex CLIAll except CursorAll nine
Per-employee attributionYes, automaticAs granular as the key you pushYes through the Workforce CLI, otherwise no
Survives an employee changing it backYesRe-asserted on your MDM’s check-in cycleNo
Shadow AI visibilityYesNoNo
Effort to stand upHighestMedium, per clientLowest

A reasonable default: your own MDM for Claude Desktop, since it has native support and covers the largest non-technical population; the desktop client for the engineering fleet; voluntary for the long tail.

Path 1: the Merge desktop client

The client is a background service you deploy through your MDM. It provisions the governed AI stack, mints each employee’s Gateway key, and reports what AI tooling is actually installed. It needs an MDM-managed fleet, because several of the macOS permissions it uses can only be granted by a configuration profile.

1

Connect SSO and SCIM

Identity resolves against SCIM-synced employees, and access follows their Groups. Confirm your employees appear in Agent Handler before deploying anything.

2

Generate an enrollment token and download the artifacts

In Devices → Deployment. The token is organization-scoped, so one covers the fleet, and the raw value is shown once. Download the macOS package, the Windows installer, and the configuration profile, which comes pre-filled with your token, organization slug, and API URLs. See Plan your deployment for the full key reference.

3

Deploy to a canary group in observe mode

Five to ten machines in your own IT team, software provisioning only. Setting PolicyMode to observe in your MDM is a device-level ceiling the dashboard cannot override, which is how you prove the client is safe on your fleet before any enforcement can take effect.

4

Have those employees sign in once from the menu bar

This resolves identity and provisions their Gateway key. Claude Code and Codex CLI then each show a Use Gateway action in the menu bar panel that switches the client over in one click, with the key already in place.

5

Confirm traffic is arriving

A provisioned employee runs Claude Code and the request appears in the Gateway dashboard within a few seconds, attributed to them.

6

Expand in rings

Widen the deployment, then lift the PolicyMode ceiling wave by wave.

What the client covers. It routes Claude Code and Codex CLI. Every other AI client it finds is reported to you as a device finding with remediation steps rather than switched automatically, because the rest keep their base URL in a GUI or an OS keychain where no config file can reach it.

Automatic install and re-install on removal is configurable now and not yet in force: the setting is saved and the settings page says so. Enforcement travels in a signed policy document that is waiting on production signing keys. Until then, the one-click Use Gateway action above is what routes a client.

Path 2: your own MDM

No Merge client on the machine. Your MDM writes each client’s own configuration, the same values a developer would set by hand. What is possible depends entirely on where the client keeps its settings.

The rest of this section is the summary. Deploy with your MDM is the full guide: the delivery mechanism for each client, a worked re-assertion script, and how the payload maps onto Jamf, Intune, Mosyle, Workspace ONE, and Group Policy.

Native MDM support

Claude Desktop is the best-supported client by a wide margin, and it covers Chat, Cowork, and the built-in Claude Code surface. Configure one machine through Developer → Configure Third-Party Inference, then use the app’s Export button to produce a ready-to-deploy .mobileconfig or .reg. The keys:

1{
2 "inferenceProvider": "gateway",
3 "inferenceGatewayBaseUrl": "https://api-gateway.merge.dev/v1/anthropic",
4 "inferenceGatewayApiKey": "mg_your_key",
5 "inferenceGatewayAuthScheme": "bearer",
6 "modelDiscoveryEnabled": true
7}

Leave discovery on and the picker populates itself from Gateway at launch, so new models appear without a config change. Before you push this, confirm your vendor and region restrictions leave at least one callable route for the models the app will pick: its connection test sends a real inference request and fails if the model it chooses has no allowed vendor. Full setup in the Claude Desktop guide.

Environment variables

Claude Code is configured entirely by environment variables, which your MDM can set with a profile or a login script:

$export ANTHROPIC_BASE_URL="https://api-gateway.merge.dev/v1/anthropic"
$export ANTHROPIC_AUTH_TOKEN="mg_your_key"
$export ANTHROPIC_API_KEY=""
$export ANTHROPIC_DEFAULT_OPUS_MODEL="default_routing"
$export ANTHROPIC_DEFAULT_SONNET_MODEL="default_routing"
$export ANTHROPIC_DEFAULT_HAIKU_MODEL="anthropic/claude-haiku-4-5-20251001"

ANTHROPIC_API_KEY must be explicitly empty. If it is set to anything, Claude Code prefers it and bypasses Gateway, which is the most common silent failure in a fleet rollout. Setting the tier variables to default_routing hands model choice to your routing policy; leaving the haiku tier pinned keeps Claude Code’s frequent background tasks cheap and predictable.

Zed, OpenCode, Pi, and Factory Droid also read their key from MERGE_GATEWAY_API_KEY, so the same mechanism delivers the credential for all of them.

Configuration file drops

These clients read a file in the user’s home directory, which your MDM writes with a script on its check-in cycle. The files are user-owned, so an employee can edit them between runs and the script re-asserts on the next one.

ClientFileWhat to write
Codex CLI~/.codex/config.toml and ~/.codex/merge_gateway.config.tomlA [model_providers.merge-gateway] block, and a profile file naming the provider and model
Codex desktop app~/.codex/config.toml, top levelThe same provider block plus top-level model and model_provider. The desktop app does not accept --profile
Zedsettings.jsonA language_models.openai_compatible entry with api_url and your model list
Continue.dev~/.continue/config.yamlOne entry per model, provider: openai, apiBase pointed at Gateway
Pi~/.pi/agent/models.jsonA merge-gateway provider with baseUrl and your model list
Factory Droid~/.factory/settings.jsonA customModels entry with provider: "openai" and baseUrl
OpenCodeNone requiredGateway is a registered provider. Export the key and the employee runs /connect once

macOS GUI apps do not inherit your shell environment, so an app launched from the Dock will not see MERGE_GATEWAY_API_KEY from a shell profile. Use launchctl setenv, delivered as a LaunchAgent that runs at login.

Not deployable

Cursor cannot be configured this way. Its base URL override and API key are entered through the GUI and held in encrypted local app state. Your options are the Cursor Business or Enterprise team admin settings, or network policy. Separately, Cursor’s Agent mode does not accept custom API keys at all, so only Ask and Plan modes route through Gateway on any path.

Path 3: voluntary adoption

Employees configure their own tools. This is the fastest way to cover the clients the other two paths cannot reach, and it is how most companies should handle their long tail.

Remove the two things that actually stop people:

  1. Give them credentials they do not have to ask for. Where employees are comfortable in a terminal, the Workforce CLI is the cleaner option: they sign in against your identity provider and get a per-device credential, so there is no key for you to hand out and spend still attributes to the person. Otherwise create a project per team and put its project API key where the team already looks, and the project’s routing policy and budget apply automatically.
  2. Send one link, not a wiki page. Every client has a dedicated setup guide, each about five minutes end to end

Then measure it. The Gateway dashboard shows who is actually routing, which is the only number that tells you whether voluntary adoption is working. If a team stays flat after two weeks, that is the signal to move them onto a managed path rather than send another reminder.

Voluntary gives you coverage, not control. Anyone can stop routing by editing their own config, and you will not know, because a client that is not routing produces no Gateway telemetry. Absence of traffic looks the same as absence of work.

Client coverage

ClientWhere its config livesDesktop clientYour MDMVoluntary
Claude CodeEnvironment variablesYesYesYes
Codex CLI~/.codex/*.tomlYesYesYes
Codex desktop app~/.codex/config.tomlNoYesYes
Claude DesktopGUI, with MDM exportNoYes, best-supportedYes
Zedsettings.jsonNoYesYes
Continue.dev~/.continue/config.yamlNoYesYes
OpenCodeRegistered providerNoPartialYes
Pi~/.pi/agent/models.jsonNoYesYes
Factory Droid~/.factory/settings.jsonNoYesYes
CursorGUI, encrypted app stateNoNoAsk and Plan only

Verify the rollout

Configuration pushed is not traffic routed. Check all three:

  1. The Gateway dashboard. Requests appear within a few seconds. This is the only source that proves traffic is flowing, and it needs nothing on the endpoint.
  2. The client’s own check. Claude Code’s /status should report Auth token: ANTHROPIC_AUTH_TOKEN and the Gateway base URL. Claude Desktop’s Test connection runs discovery and a real inference request.
  3. Coverage, not only success. Compare who is routing against your employee list. The fleet view does this for you, including devices that enrolled but never resolved an identity.

Limits worth stating up front

Tell your security team these before they find them:

  • Every path short of network blocking is client-side. Someone with local admin can edit a config file inside your MDM’s check-in window. Managed configuration makes compliance the default and drift visible and reversible. It does not make bypass impossible.
  • The controls that cannot be bypassed from the endpoint are server-side: Gateway’s own authentication and your network egress policy. An unmanaged config cannot mint a Merge key.
  • Cursor Agent mode and Cursor Tab never route through Gateway, on any path. That is a Cursor-side restriction.
  • Coverage is not enforcement. Until direct provider endpoints are blocked, a routed client is a client that is currently choosing to route

Next steps