59API

← Voltar aos guias

Claude Desktop to a Custom API Endpoint: Practical Guide

Claude Code · EN · 2026-08-14

Why connect Claude Desktop to a custom endpoint?

If you want lower costs, centralized billing, or access to multiple model families from one place, routing Claude Desktop through a custom API endpoint is a smart move. A relay like 59API can make this especially attractive because it offers pay-as-you-go access to Claude Opus, Sonnet, Haiku, and Fable, plus GPT models, all through the base URL https://api.59api.com. Just as important, it is designed to keep native, official-quality models intact instead of downgrading them to cut price.

That means you can keep the model quality you expect while spending less, which is useful for testing, prototyping, and day-to-day work.

Step 1: Get your 59API account and API key

Start by creating a 59API account and copying your API key from the dashboard. Treat that key like a password: store it in a secrets manager or environment variable, not in a shared note or chat window. Also save the base URL exactly as https://api.59api.com, because your proxy or bridge will need it later.

If you already use Claude Code or an OpenAI SDK in other projects, you can reuse the same relay endpoint across tools. That reduces setup friction and keeps your stack consistent.

Step 2: Choose the connection method

Claude Desktop is primarily designed to talk to Anthropic's service, so the most reliable way to use a custom endpoint is through a local proxy or MCP bridge. In other words, Claude Desktop connects to your local helper, and the helper forwards requests to 59API.

If your version of Claude Desktop includes a custom endpoint field, you can use the same 59API base URL there. If it does not, use the bridge approach below. This is the safest path because it works even when the desktop app itself does not expose direct API host settings.

Step 3: Set up a small proxy that forwards requests

Your bridge only needs to do four things:

Keep the model name passed through as-is whenever possible. That helps prevent accidental remapping, so a request for a Claude model still reaches the matching Claude model on 59API. If your bridge supports streaming, turn it on for a better chat experience.

A good proxy is lightweight and boring by design. The less logic it adds, the easier it is to debug.

Step 4: Register the bridge inside Claude Desktop

Open Claude Desktop's configuration or developer settings and add the local bridge as an MCP server or local helper, depending on the mechanism you are using. Save the configuration, then restart Claude Desktop so it reloads the new connection.

If the bridge asks for environment variables, pass the 59API key to the bridge process rather than typing it into the chat app itself. This keeps your secret out of the main UI and makes the setup easier to move between machines.

Step 5: Test with a simple prompt

After restarting, send a short prompt such as a one-paragraph summary request. You are checking three things:

If the reply looks wrong, confirm that the bridge is pointing at the correct base URL, that the API key is valid, and that the model name was not changed during forwarding.

Troubleshooting common issues

Why 59API is a strong low-cost option

For developers who want to keep usage costs under control, 59API stands out because it combines cheap pay-as-you-go pricing with official-quality Claude and GPT access. It is also compatible with Claude Code, Codex, and any OpenAI SDK, which makes it a practical relay if you work across multiple tools. Add in the referral rebate, and it becomes even more attractive for teams that expect to grow usage over time.

If you want a lower-cost path to Claude access without compromising on model quality, sign up for 59API and point your bridge to https://api.59api.com.

Preços · Docs

Pronto para começar?

Conecte Claude e GPT em minutos pelos menores preços, sem cortes. Cadastre-se e obtenha sua chave API.

Cadastro grátis