Claude Desktop
Anthropic’s Claude Desktop app can send all of its inference through a gateway instead of directly to Anthropic. Point it at Merge Gateway and every surface in the app (Chat, Cowork, and the built-in Claude Code) runs through your Gateway API key, with routing policies, cost governance, and full request observability in the Gateway dashboard. Use this guide to configure a single machine from the app’s built-in configuration window; the managed configuration section covers rolling the same settings out to a fleet over MDM.
Before you start
- Install Claude Desktop and sign in
- Grab an API key. An organization key from gateway.merge.dev/api-keys works everywhere; a project API key, created from a project’s API keys tab, additionally scopes every request to that project so its routing policy and budget apply automatically. See Projects
- Make sure your organization’s vendor and region restrictions leave at least one callable route for the Claude models you plan to use. Claude Desktop’s connection test sends a real inference request, and it fails if the model it picks has no vendor your organization allows
Configure Claude Desktop
Open the third-party inference window
In the menu bar, go to Developer → Configure Third-Party Inference….
If the Developer menu is hidden, enable Developer mode first (on current builds it lives under Help → Troubleshooting → Enable Developer Mode), then reopen the menu bar.
Choose Gateway as the inference provider
In the Connection section, set the inference provider dropdown to Gateway. This reveals the Gateway credentials card.
Enter the Gateway base URL and API key
Fill in the Gateway credentials:
The base URL must end in /v1/anthropic with no trailing slash; Gateway serves the Anthropic Messages API under that prefix. Gateway accepts both auth schemes, so x-api-key works too if your environment strips Authorization headers.
To sign users in with your identity provider instead of distributing a static key, set Credential kind to Interactive sign-in and follow Anthropic’s SSO setup; Gateway sits behind whichever credential the app sends.
Test the connection
Click Test connection. The app runs model discovery and then sends a small inference request through Gateway. Both checks should come back green, and the inference request appears in your Gateway dashboard within a few seconds.
If the inference check fails with vendor_restrictions_unavailable, see Troubleshooting below; the connection itself is fine.
Turn on model discovery
In the Models section, enable Model discovery and click Test model discovery. The picker auto-populates from https://api-gateway.merge.dev/v1/anthropic/v1/models at launch, so newly released Claude models show up without a config change.
Claude Desktop keeps only models it recognizes as Claude, so expect the discovered list to be the Claude family rather than Gateway’s full catalog. To offer other models (for example openai/gpt-5.5 or google/gemini-3.6-flash), add them under Model list; see Add non-Claude models below.
Apply and restart
Click Apply Locally, then fully quit and reopen Claude Desktop. Pick a model, send a prompt, and confirm the request lands in your Gateway dashboard.
Exact menu labels vary by app version, but the flow is always Developer mode → Configure third-party inference → Gateway → base URL + API key → test.
Add non-Claude models to the picker
Claude Desktop’s auto-discovery filters out model ids that are not recognizably Claude, by design on Anthropic’s side. Gateway can route the app’s requests to any model in the catalog, so to expose non-Claude models add explicit entries under Model list (the inferenceModels config key):
The first entry in the list is the picker’s default, so put the model you want new sessions to start on at the top. Enable Offer 1M-context variant (supports1m) only on models you have confirmed accept 1M-token requests through Gateway; the app cannot verify it, and requests from the 1M picker entry fail at inference time if the route does not support it.
Browse the catalog for exact ids with GET /v1/models or in the dashboard.
Scope requests to a project
Gateway’s Anthropic-compatible endpoint has no project_id request field, so scope Claude Desktop to a project in one of two ways:
- Project API key (recommended). Use a project key as the Gateway API key and every request attributes to that project automatically, with its routing policy and budget applied
- Custom inference header. Keep an organization key and add
X-Project-Idunder Custom inference headers, set to the project’s ID (shown on the project’s page)
Managed configuration (MDM, for fleets)
To roll Gateway out to many users at once, distribute a managed configuration instead of having each person open Developer mode. The in-app Export button produces a ready-to-deploy .mobileconfig (macOS) or .reg (Windows) from whatever you configured above; see Anthropic’s configuration reference for delivery details per platform. The equivalent keys:
To pin the fleet’s picker to a fixed list, set inferenceModels to the Gateway ids you want (this also covers non-Claude models). When every entry is a full model id, the app skips the discovery call entirely.
Troubleshooting
Test connection returns 401
Gateway rejected the credential. Check that the API key is a current mg_... key from gateway.merge.dev/api-keys and that the auth scheme matches how your network delivers it; Gateway accepts both bearer and x-api-key, so switching schemes rules out a stripped Authorization header.
Model discovery finds nothing or times out
The base URL must point directly at https://api-gateway.merge.dev/v1/anthropic, with no trailing slash and no redirecting proxy in between; the app treats any redirect on the discovery call as a failure. If discovery is unreachable, the picker falls back to the Model list, so an empty list plus failed discovery means an empty picker.
The picker only shows Claude models
That is Claude Desktop’s discovery filter, not a Gateway limit; the endpoint returns the full catalog. Add non-Claude models explicitly under Model list, as described in Add non-Claude models.