Integrate the Martian Gateway With Claude Desktop

Configure the Claude desktop app to use Claude models through the Martian Gateway's Anthropic-compatible Messages API.

Claude Desktop does not read Claude Code's settings.json or its environment variables. It uses the app's Third-Party Inference configuration.

Prerequisites

Install the latest Claude desktop app and get a Martian API key from the Martian Dashboard.

Enable Third-Party Inference

  1. In Claude Desktop, select Help → Troubleshooting → Enable Developer Mode.
  2. Allow the app to relaunch.
  3. From the macOS menu bar, select Developer → Configure Third-Party Inference….

This is the Developer menu in the system menu bar, not the Developer tab in Settings used for MCP servers.

Configure Martian

In the Connection section, set Inference provider to Gateway and enter:

FieldValue
Gateway base URLhttps://api.withmartian.com
Credential kindStatic API key
Gateway API keyYour Martian sk-… key
Gateway auth schemeBearer
Custom inference headersLeave empty

Use the bare origin without /v1. Claude Desktop appends /v1/messages and /v1/models itself.

Martian also accepts x-api-key, but Bearer matches the authentication used throughout these docs.

Choose Models

Claude Desktop can discover compatible Claude models from the Martian Gateway's /v1/models endpoint. Choose the model you want from the model picker.

If you configure models manually, use the exact full ID shown on Available Models. The first model is the default, the display name is cosmetic, and the optional tier alias maps Claude's sonnet, opus, or haiku selections to that model.

Only enable a 1M-context variant when the selected model's entry in Available Models reports a 1M-token context window.

Verify Your Setup

  1. Apply the configuration and allow Claude Desktop to relaunch.
  2. Start Claude Desktop in Third-Party Inference mode.
  3. Open the model picker and select a Claude model from Martian.
  4. Send a short test message.

If the app reports that the gateway is unreachable, confirm that the base URL is exactly https://api.withmartian.com and does not include /v1.


Next Steps

Configure Claude Code

Use the Martian Gateway from the Claude Code terminal CLI.

Read more

View Available Models

Browse supported models and current pricing.

Read more