Claude Code Setup on Windows, macOS and Linux
Setting up Claude Code takes three steps: install the CLI, configure authentication and launch it inside your project. This quick-start guide covers Windows, macOS and Linux, then shows how to connect 59API for low-cost, pay-as-you-go access.
59API is compatible with Claude Code and provides native, official-quality models without downgrading them. Its pricing is among the lowest available from AI API relays. You pay for API usage, so you can start with a small balance and track spending as you work.
1. Install Claude Code on your operating system
Use the native installer for your platform. These installation methods do not require Node.js. Run the commands in your regular user account; administrator privileges are generally unnecessary for the Claude Code installer itself.
Windows: Install Git for Windows first, including Git Bash. If you use Windows Package Manager, run this in PowerShell:
winget install --id Git.Git -e --source winget
Open a fresh PowerShell window after Git finishes installing, then install Claude Code:
irm https://claude.ai/install.ps1 | iex
You can launch Claude Code from PowerShell; Git Bash supplies the shell environment it needs. If you prefer WSL, follow the Linux instructions inside your WSL distribution and configure credentials there.
macOS: Open Terminal and run:
curl -fsSL https://claude.ai/install.sh | bash
Check that Git is available with git --version. If macOS prompts you to install Command Line Tools, complete that installation.
Linux: Use the same installer:
curl -fsSL https://claude.ai/install.sh | bash
You need curl and Git. On Ubuntu or Debian, install missing dependencies with sudo apt update && sudo apt install -y curl git, then rerun the installer if necessary.
After installation, reopen your terminal and run claude --version. If the command is missing, follow the installer's PATH instructions. On macOS and Linux, the native executable is typically under ~/.local/bin.
2. Connect Claude Code to 59API
Sign up for 59API, add a small starting balance and create an API key in its dashboard. Check current model prices before your first session. A 59API balance is separate from any Claude subscription or direct Anthropic API balance.
Configure these variables in the terminal where you will launch Claude Code. The base URL is https://api.59api.com; do not append an endpoint path unless 59API's current Claude Code instructions require it.
On macOS, Linux or WSL, run each line separately:
- unset ANTHROPIC_API_KEY
- export ANTHROPIC_BASE_URL="https://api.59api.com"
- export ANTHROPIC_AUTH_TOKEN="YOUR_59API_KEY"
In Windows PowerShell, run:
- Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue
- $env:ANTHROPIC_BASE_URL = "https://api.59api.com"
- $env:ANTHROPIC_AUTH_TOKEN = "YOUR_59API_KEY"
Replace the placeholder with your actual key. Clearing ANTHROPIC_API_KEY avoids competing authentication settings. These changes affect the current terminal session and programs launched from it. For persistence, use your shell profile or Windows user environment variables. Keep credentials out of your repository.
3. Select a model and test your project
Open your project directory with cd /path/to/your/project. On Windows, use your project's Windows path instead.
Copy a supported Claude model ID from the 59API dashboard, then launch:
claude --model YOUR_MODEL_ID
Use the exact API identifier, which may differ from the display name. Claude Sonnet 5.5 is one available option to evaluate for everyday coding; Claude Opus 5.5 is another option for demanding tasks. Compare their listed prices before choosing.
Start with a bounded request: “Explain this repository's structure and identify how to run its tests. Do not modify files.” Review the response and check usage in 59API before requesting larger changes.
4. Fix common setup problems
- Authentication fails: Check the key, balance and environment variables in the same terminal that launches Claude Code.
- Login still appears: Follow 59API's current Claude Code onboarding instructions; configuration requirements can change between CLI releases.
- Model unavailable: Verify the exact model ID and your account's access.
- Connection fails: Check the base URL, proxy settings and firewall access.
For ongoing cost control, keep requests focused and review usage regularly. 59API also offers a referral rebate; check its current terms if you plan to recommend the service to teammates.
Ready to get started?
Connect Claude & GPT in minutes at the lowest prices — full-power, never downgraded. Sign up to get your API key.
Sign up free