Claude Desktop Third-party Gateway Configuration Guide
This guide is for users who have Claude Desktop (the GUI client) installed and want to connect it to a third-party Gateway that is compatible with the Anthropic Messages API. This article uses https://claude-code.club/api as the example.
If you are only using the Claude Code CLI, please refer to Configure Base URL and Auth Token instead.
1. Core Concepts and Address Selection
Claude Desktop’s third-party inference configuration is used to forward model requests to a custom Gateway. The Gateway must be compatible with the Anthropic Messages API; it is different from an OpenAI-style /v1/responses endpoint.
| Configuration | Recommended Value / Notes |
|---|---|
| Gateway base URL | https://claude-code.club/api |
| Authentication method | bearer (i.e. Authorization: Bearer <your API Key>) |
| Extra request headers | Generally leave blank unless the provider explicitly requires them |
Do not mix up addresses. Claude Desktop’s Gateway configuration should use an Anthropic-compatible address (e.g. https://claude-code.club/api); do not enter an OpenAI / Codex-style address (e.g. https://claude-code.club/openai) into Claude Desktop.
2. Pre-configuration Checklist
- Latest Claude Desktop is installed
- A valid API Key has been obtained (see Get API Key)
- Do not use an old Key that has already been exposed in chats, screenshots, or repositories; if leaked, invalidate it immediately and create a new one
- Able to fully quit and reopen Claude Desktop (third-party inference configurations typically require an application restart to take effect)
3. GUI Configuration (Recommended)
3.1 Open the Third-party Inference Configuration
- Open Claude Desktop
- In the menu bar, go to
Help→Troubleshooting - Enable
Enable Developer mode - Go to the menu
Developer→Configure third-party inference
3.2 Fill in Gateway Credentials
| UI Field | What to Enter |
|---|---|
Gateway base URL | https://claude-code.club/api |
Gateway API key | Your valid API Key (do not expose the real value in documentation or screenshots) |
Gateway auth scheme | bearer |
Gateway extra headers | Leave blank |
3.3 Apply the Configuration
- Prefer clicking
Apply locally - After seeing the success prompt, fully quit Claude Desktop
- Reopen Claude Desktop and send a test message
- If it replies normally, the configuration is in effect
Fully quit means you must ensure the process has ended — on macOS, use Activity Monitor to confirm the Claude process has exited; on Windows, end all Claude processes in Task Manager. Simply closing the window often does not apply the configuration.
4. Export as Fallback
If Apply locally does not work, or you need to deploy the same configuration to multiple machines in bulk, you can use Export to generate a system-level configuration file.
macOS: Export .mobileconfig
- On the
Configure third-party inferencepage, clickExport - Select
macOS configuration profile (.mobileconfig) - Save to a secure location on your machine
- Double-click the
.mobileconfigfile and follow the system prompts to install it viaSystem Settings - After installation, fully quit and reopen Claude Desktop
The .mobileconfig may contain the API Key in plain text. Only install it on trusted devices, and securely delete the original file after use.
5. Export Menu Format Reference
| Export Option | Purpose |
|---|---|
Windows registry file (.reg) | Recommended fallback format for Windows; imports into the registry |
macOS configuration profile (.mobileconfig) | Recommended fallback format for macOS; system configuration profile |
Plain JSON (.json) | Usually not imported directly; used for troubleshooting or secondary processing by management systems |
Firewall allowlist (.txt) | Firewall allowlist — not a Gateway account configuration |
Copy to clipboard (redacted) | Suitable for sharing with others for configuration troubleshooting; sensitive values are hidden, so cannot be used as a complete import |
6. CLI Environment Variables (Optional)
If you also use Claude Code CLI in the terminal, you can additionally configure environment variables. The Claude Desktop Gateway GUI configuration and CLI environment variables are two separate entry points, but it is recommended to use the same address and Key for both.
Write the variables into your zsh / bash configuration:
cat >> ~/.zshrc <<'EOF'
export ANTHROPIC_BASE_URL="https://claude-code.club/api"
export ANTHROPIC_AUTH_TOKEN="your-api-key"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"
EOF
source ~/.zshrcVerify they took effect:
echo $ANTHROPIC_BASE_URL
echo $ANTHROPIC_AUTH_TOKEN
echo $CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC7. Verification
- Claude Desktop starts normally
- After sending a message, no errors such as
authentication,invalid api key, orgateway unavailableappear - Response speed and model behavior match the Gateway service expectations
- If also using CLI, you can run
echocommands to confirm the environment variable values exist
If you have previously successfully configured via Apply locally and the conversation is working normally, the local Gateway configuration is already in effect.
8. Troubleshooting
| Symptom | Action |
|---|---|
Invalid API key | Key is wrong, expired, disabled, or does not belong to this Gateway. Regenerate and re-enter it |
Connection failed / Gateway unavailable | Check the network; verify the Gateway base URL is https://claude-code.club/api with no extra /v1/messages appended |
| Model unavailable | The current account or Gateway does not support the requested model; contact the provider to confirm available models |
Apply locally not taking effect | Fully quit Claude Desktop and restart; on Windows try .reg, on macOS try .mobileconfig |
| Configuration file still fails after import | Reopen the configuration page and check Base URL, auth scheme, and extra headers for correctness |
9. Restore Default Configuration
If a .mobileconfig profile was installed, find it in System Settings under Profiles / Device Management, delete the corresponding Claude configuration profile, then restart Claude Desktop.
The entry name may vary slightly across macOS versions (System Preferences / System Settings / Profiles).
10. Security Guidelines
- An API Key is equivalent to a password; do not write it into public documents, screenshots, or Git repositories
- Exported
.reg/.mobileconfig/.jsonfiles may contain the Key in plain text; keep them only for a short time - If a Key is copied to a chat, screenshot, log, or repository, invalidate it immediately and regenerate a new one
- When sharing configurations with a team, share only the steps and placeholders — never share the real key
11. Recommended Final Configuration
| Field | Value |
|---|---|
Gateway base URL | https://claude-code.club/api |
Gateway API key | Your valid API Key |
Gateway auth scheme | bearer |
Gateway extra headers | Leave blank |
On both Windows and macOS, prefer Apply locally first; only export the platform-specific configuration file if local apply fails, you need bulk deployment, or you need to back up the configuration.
12. References
- Get API Key — claude-code.club API Key application process
- Configure Base URL and Auth Token — Three configuration methods from the Claude Code CLI perspective
- Claude Desktop Third-party Inference / Gateway Configuration Docs
- Claude Desktop Installation Instructions