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
- In Claude Desktop, select Help → Troubleshooting → Enable Developer Mode.
- Allow the app to relaunch.
- 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:
| Field | Value |
|---|---|
| Gateway base URL | https://api.withmartian.com |
| Credential kind | Static API key |
| Gateway API key | Your Martian sk-… key |
| Gateway auth scheme | Bearer |
| Custom inference headers | Leave 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
- Apply the configuration and allow Claude Desktop to relaunch.
- Start Claude Desktop in Third-Party Inference mode.
- Open the model picker and select a Claude model from Martian.
- 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.