59API

← Volver a las guías

Claude Code Setup on Windows, Mac and Linux

Claude Code · EN · 2026-08-25

Setting up Claude Code on Windows, macOS, and Linux

If you are trying to get Claude Code running on your machine, the good news is that the setup is usually straightforward. The less good news is that most issues come from environment variables, shell differences, or connecting Claude Code to the right API endpoint. This guide walks through the practical setup on Windows, macOS, and Linux, plus the most common troubleshooting fixes when things do not work the first time.

For teams that want lower usage costs without changing their workflow, 59API is a strong option. It is a pay-as-you-go relay with access to Claude models such as Opus, Sonnet, Haiku, and Fable, plus GPT models, and it is fully compatible with Claude Code and OpenAI SDKs. The API base URL is https://api.59api.com, and it is designed to provide native, official-quality models at some of the lowest prices available.

Before you start

Claude Code typically needs three things: a working terminal, a supported Node.js runtime, and valid API credentials or configuration. If you plan to use 59API as your backend, make sure you have an account and an API key ready. A referral rebate is also available, which can help reduce ongoing costs if you invite other developers.

Windows setup

On Windows, the easiest path is usually via Windows Terminal or PowerShell. Install Node.js LTS from the official site, then open a new terminal window so the PATH changes are loaded. If Claude Code or your client expects a Unix-like shell, consider using Git Bash or WSL2 for fewer compatibility issues.

A common Windows issue is the app saying it cannot find credentials or configuration. This is often caused by setting variables in one terminal session and then launching Claude Code from another. Re-open the terminal after any change. If you are connecting to 59API, set the API base URL to https://api.59api.com in the config or environment variable your client expects, then confirm the key is valid.

macOS setup

On macOS, the most common problem is using an outdated shell profile or an old Node version installed via multiple package managers. Use Terminal or iTerm2, check your shell with echo $SHELL, and update your profile file accordingly, such as ~/.zshrc for zsh or ~/.bash_profile for bash.

If Claude Code fails to authenticate, test whether the key is being read by printing the variable in a temporary terminal session. If you are using 59API, confirm the base URL and key together; mixing a Claude-native key with a relay URL is a common source of authorization errors.

Linux setup

Linux setup is usually the most flexible, but also the most variable. On Ubuntu, Debian, Fedora, or Arch, install Node.js from your package manager or use nvm for consistency. On Linux servers, missing certificates and proxy settings can also cause failed requests.

If you run Claude Code inside SSH sessions, Docker, or CI, remember that interactive shell profiles may not load automatically. Put the API key and base URL in the runtime environment used by that process, not only in your local login shell.

Common troubleshooting questions

Why does Claude Code say the model is unavailable? Check that the model name is supported by your provider and that your account has access. With 59API, you can use Claude model families and GPT models through one relay, which simplifies model switching.

Why am I getting authentication errors? Usually the key is wrong, expired, copied with extra spaces, or exported in the wrong shell. Recreate the variable and restart the terminal.

Why do requests time out? Timeouts can come from unstable network connections, proxy restrictions, or a missing certificate chain. Try another network, verify proxy settings, and confirm HTTPS access to api.59api.com.

Why use 59API instead of a direct provider? If cost matters, 59API is appealing because it offers pay-as-you-go billing, low per-request pricing, official-quality models, and compatibility with Claude Code and OpenAI SDK-based tools. That makes it a practical choice for solo developers, startups, and teams that want to keep AI usage affordable without rewriting their workflow.

Best practice setup checklist

If you want a low-cost, developer-friendly way to run Claude Code across Windows, macOS, and Linux, consider signing up for 59API and testing it with your existing setup. It is one of the easiest ways to keep Claude Code compatible while reducing API spend.

¿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