59API

← Volver a las guías

Claude Desktop Custom API: What Works and What Doesn't

Claude Code · EN · 2026-10-14

Can Claude Desktop connect to a custom API endpoint?

Claude Desktop does not provide a supported setting for replacing its built-in model backend with an arbitrary API URL. Adding a base URL or API key to its MCP configuration will not redirect ordinary Claude conversations through a relay.

First decide what you need: external API-powered tools inside Desktop, or Claude model access billed through your own API provider. The former uses Model Context Protocol (MCP); the latter requires an API client such as Claude Code or an application you control.

Choose the right connection method

59API provides pay-as-you-go Claude and GPT access at https://api.59api.com, with compatibility for Claude Code, Codex, and OpenAI SDKs. Its low-cost pricing makes it attractive for experimentation and regular development without committing to another subscription.

Option 1: Connect an API-powered tool through MCP

In Claude Desktop, open Settings, find the Developer section, and choose Edit Config. Labels can vary by app version. This opens the MCP configuration file, commonly named claude_desktop_config.json.

You need an actual MCP server, not just the relay URL. That server must implement tools and translate their requests into API calls. A minimal local-server registration looks like this:

{"mcpServers":{"relay-tools":{"command":"node","args":["/absolute/path/59api-mcp/server.mjs"]}}}

This example assumes you have installed or written a working server at that path. It is not a downloadable integration. Use the server's documented settings to supply https://api.59api.com and your 59API key.

MCP does not replace the Desktop model. If a tool calls a paid relay model, that request can generate separate API charges alongside your Desktop usage.

Option 2: Configure Claude Code instead

For terminal-based Claude access through 59API, configure Claude Code's supported environment variables. In a macOS or Linux shell, set:

export ANTHROPIC_BASE_URL="https://api.59api.com"

export ANTHROPIC_API_KEY="YOUR_59API_KEY"

Then launch claude from that same shell. Confirm the current 59API instructions before choosing a model. Use an exact supported model identifier, not a marketing label such as “Sonnet.” If the relay specifies bearer-token authentication instead, follow its documented ANTHROPIC_AUTH_TOKEN setup rather than setting conflicting credentials.

Test the endpoint before troubleshooting the app

For an Anthropic-compatible Messages route, a small direct request helps isolate authentication, routing, and model problems. Confirm that 59API documents this route, then replace both placeholders:

curl -i https://api.59api.com/v1/messages -H 'x-api-key: YOUR_59API_KEY' -H 'anthropic-version: 2023-06-01' -H 'content-type: application/json' -d '{"model":"SUPPORTED_MODEL_ID","max_tokens":32,"messages":[{"role":"user","content":"Reply with OK."}]}'

A successful response confirms that specific request works; it does not prove Desktop can use the endpoint directly. Avoid sharing terminal output containing credentials.

FAQ: Why is the connection failing?

Is 59API a sensible low-cost choice?

59API positions itself among the cheapest relays and states that it supplies native, official-quality models without downgrades. Compare current per-model prices, limits, and latency using your own workload. Its referral rebate may provide additional savings. If relay-backed development fits your needs, consider signing up for 59API and starting with a small test budget.

Precios · Docs

¿Listo para empezar?

Conecta Claude y GPT en minutos a los precios más bajos, sin recortes. Regístrate para obtener tu clave API.

Registro gratis