> This page is for Gateway.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Claude Desktop

> Configure Claude Desktop's third-party inference settings so Chat, Cowork, and the built-in Claude Code surface route through Gateway, on one machine or across a fleet with MDM.

Claude Desktop can route all its inference (Chat, Cowork, and the built-in Claude Code surface) through Gateway. Configure one machine in the app, or a fleet with [MDM](#managed-configuration-mdm-for-fleets). Shared setup: [Building with coding agents](/merge-gateway/coding-agents/overview).

## Configure Claude Desktop

1. Open **Developer → Configure Third-Party Inference**. If it's hidden, first enable **Help → Troubleshooting → Enable Developer Mode**.
2. In **Connection**, set the inference provider to **Gateway**
3. Fill in the Gateway credentials card from the table below
4. Click **Test connection**, which runs model discovery and then a real inference request
5. In **Models**, turn on **Model discovery** and click **Test model discovery**
6. Click **Apply Locally**, restart the app, and send a prompt

| Field               | Value                                                                       |
| ------------------- | --------------------------------------------------------------------------- |
| Credential kind     | **Static API key**                                                          |
| Gateway base URL    | `https://api-gateway.merge.dev/v1/anthropic`, with no trailing slash        |
| Gateway API key     | Your `mg_...` key                                                           |
| Gateway auth scheme | **bearer**, or **x-api-key** if your network strips `Authorization` headers |

For identity-provider sign-in, set **Credential kind** to **Interactive sign-in** and follow Anthropic's [SSO setup](https://claude.com/docs/third-party/claude-desktop/gateway#single-sign-on-with-your-identity-provider).

## Model discovery

With discovery on, the picker loads from `https://api-gateway.merge.dev/v1/anthropic/v1/models` at launch, so new models appear without config changes. Desktop normally hides non-Claude models, so Gateway formats the list to keep the full chat catalog, your organization's aliases, and `default_routing`, omitting image, audio, video, and embedding models since they can't answer chat. If a Desktop update hides non-Claude models before Gateway catches up, pin a model list.

## Pin a fixed model list

Add entries under **Model list** (`inferenceModels`) to curate the picker. Each takes a **Model ID** (the exact Gateway ID, such as `openai/gpt-5.5`) and a **Display name**, and the first is the default for new sessions. A non-empty list replaces discovery, so include every model you want.

Turn on **Offer 1M-context variant** (`supports1m`) only for models confirmed to take 1M-token requests through Gateway. The app can't check, and the entry fails otherwise.

## Scope to a project

The Anthropic endpoint has no `project_id` body field. Use a project API key, or with an organization key add `X-Project-Id` under **Custom inference headers**.

## Managed configuration (MDM, for fleets)

**Export** produces a `.mobileconfig` (macOS) or `.reg` (Windows) from the settings above; Anthropic's [configuration reference](https://claude.com/docs/third-party/claude-desktop/configuration) covers delivery. The equivalent keys:

```json
{
  "inferenceProvider": "gateway",
  "inferenceGatewayBaseUrl": "https://api-gateway.merge.dev/v1/anthropic",
  "inferenceGatewayApiKey": "mg_...",
  "inferenceGatewayAuthScheme": "bearer",
  "modelDiscoveryEnabled": true
}
```

Set `inferenceModels` to pin the fleet's picker; if every entry is a full model ID, the app skips discovery.

## Troubleshooting

| Symptom                                                          | Cause and fix                                                                                                                                                                                                              |
| ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Inference check fails with 400 `vendor_restrictions_unavailable` | The model the app picked has no vendor your organization's [vendor or region restrictions](/merge-gateway/cost/cost-governance-and-savings) allow. Relax the restriction, or pin an allowed model first in **Model list**. |
| Test connection returns 401                                      | The key is wrong or revoked. Check it on the [API keys](https://gateway.merge.dev/api-keys) page, and try the other auth scheme in case a proxy strips `Authorization`.                                                    |
| Discovery finds nothing or times out                             | The base URL must be exactly `https://api-gateway.merge.dev/v1/anthropic` with no redirecting proxy, since the app treats a redirect as failure. With discovery failing and an empty **Model list**, the picker is empty.  |
| A chat model is missing from the picker                          | Pin it under **Model list** with its exact Gateway ID                                                                                                                                                                      |

## Next steps

#### [Building with coding agents](/merge-gateway/coding-agents/overview)

Keys, models, aliases, and project scoping

#### [Roll out to your company](/merge-workforce/rollout/models)

Deploy Gateway to every employee's desktop