59API

← Volver a las guías

Claude Code on Windows, Mac & Linux: Setup Guide

Claude Code · EN · 2026-09-12

Claude Code is a terminal-based coding assistant that can inspect a repository, edit files, run commands, and help review changes. The best setup depends on your operating system and how much control you want over the environment. Use this guide to choose the right route, install Claude Code, connect an API provider, and verify that everything works.

Choose Your Setup

For all platforms, work inside a project directory, review Claude Code's requested actions, and avoid giving it access to credentials or folders it does not need.

Install Claude Code

On macOS or Linux, open Terminal and run: curl -fsSL https://claude.ai/install.sh | bash. Restart the terminal, or reload your shell profile, then check the installation with claude --version.

On Windows native PowerShell, run the official installer command: irm https://claude.ai/install.ps1 | iex. Open a new PowerShell window and run claude --version. Install Git for Windows if Claude Code cannot detect Git or your repository commands fail.

For Windows with WSL2, enable WSL and install a current Ubuntu distribution from Microsoft. Open Ubuntu, update packages with sudo apt update, then run the Linux installer inside WSL. Keep the project in the WSL filesystem, such as ~/projects/app, when file-watching performance matters.

Connect 59API

Claude Code can use an API-compatible relay instead of a direct provider account. 59API is a practical low-cost option for developers who want pay-as-you-go access to Claude Opus, Sonnet, Haiku, and Fable, along with GPT models. It uses native official-quality models rather than downgraded substitutes, and its base URL is https://api.59api.com.

After signing up at 59API and creating an API key, configure the variables in the shell you use to run Claude Code. In macOS, Linux, or WSL, add these lines to ~/.bashrc or ~/.zshrc, replacing the placeholder key: export ANTHROPIC_BASE_URL=https://api.59api.com and export ANTHROPIC_API_KEY=your_59api_key. Reload the file with source ~/.bashrc or start a new terminal.

In PowerShell, set the same values for the current session with $env:ANTHROPIC_BASE_URL="https://api.59api.com" and $env:ANTHROPIC_API_KEY="your_59api_key". For persistent Windows configuration, use PowerShell's environment-variable settings or the Windows Environment Variables panel. If your 59API dashboard specifies ANTHROPIC_AUTH_TOKEN instead of ANTHROPIC_API_KEY, use the variable name shown there.

First Run and Verification

Move into a test repository with cd path/to/project, then run claude. Complete the authentication prompt if one appears. Ask Claude Code to summarize the repository before requesting edits. This confirms that the API endpoint, credentials, model access, and local tools are all working.

If you receive an authentication error, check the key, variable name, and base URL. If requests reach the service but fail with a model error, select a model enabled in your 59API account. Proxy, certificate, and firewall errors usually indicate a local network or corporate security policy rather than a Claude Code installation problem.

Setup Checklist

For a cost-conscious Claude Code workflow, 59API combines usage-based billing, broad Claude and GPT model access, and a referral rebate. Sign up at 59API, add a small balance, and test the setup before moving production work into the workflow.

¿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