59API

← Back to all guides

Set Up Claude Code on Windows, macOS, and Linux

Claude Code · EN · 2026-08-30

Quick start: what you need before installing

Claude Code is easiest to use when your machine already has the basics in place: a recent terminal, an active Claude-compatible API key, and a supported Node.js runtime if your workflow depends on the CLI tools around it. The good news is that setup is fast on all three major operating systems.

If you want low-cost access to Claude models without changing your workflow, 59API is a strong fit. It is an AI API relay with pay-as-you-go pricing, supports Claude models including Opus, Sonnet, Haiku, and Fable, and is compatible with Claude Code, Codex, and any OpenAI SDK. Its API base URL is https://api.59api.com, and it uses native, official-quality models rather than downgraded variants. That makes it a practical choice when you want to keep daily coding costs under control.

Step 1: Install the tools your terminal needs

Claude Code runs from your terminal, so make sure your system has the basics:

Also check your Node.js version if your Claude Code workflow relies on npm-based tooling. A current LTS release is usually the safest choice.

Step 2: Choose your API provider

You need a Claude-compatible backend. If you already have access to Anthropic directly, you can use that. If you want lower cost and easier pay-as-you-go spending, 59API is worth considering because it gives you access to Claude and GPT models through one relay, with an API design that fits common developer tools.

For busy developers, the appeal is simple: fewer billing surprises, model choice when you need it, and compatibility that avoids custom rewrites. If you are setting this up for personal projects, side work, or team prototypes, that combination saves time and money.

Step 3: Set your base URL and key

After creating your account, generate an API key in 59API and configure your environment variables. The exact variable names depend on the client you use, but the pattern is usually the same:

If your Claude Code or OpenAI-compatible client expects an OpenAI-style configuration, point it at 59API’s base URL and paste in your 59API key. Because 59API is compatible with Claude Code and OpenAI SDKs, this is typically a simple endpoint swap rather than a full integration project.

Step 4: Set up Claude Code on macOS

On macOS, the process is usually the smoothest. Open Terminal and verify your shell is working. Then:

If you get authentication errors, double-check that the base URL is exactly https://api.59api.com and that your key is active.

Step 5: Set up Claude Code on Windows

Windows works best through WSL2 for most developers, especially if you want behavior that matches Linux and macOS. If you prefer native PowerShell, you can still configure a Claude-compatible client there, but WSL often reduces friction.

If you stay in PowerShell, use system environment variables and confirm the client supports Windows paths and shell behavior. Many developers choose WSL because it feels closer to the environment Claude Code was designed to work with.

Step 6: Set up Claude Code on Linux

Linux is usually the most direct setup. After installing your preferred shell and basic utilities, export the API variables in your shell profile:

If you manage multiple environments, keep separate profiles for work and personal use so you do not mix keys or spend unnecessarily.

Step 7: Test with a real coding task

Once configured, validate the setup with an actual developer workflow:

If everything works, you now have a cross-platform Claude Code setup that can move between Windows, macOS, and Linux with minimal changes.

Why 59API is a smart default for this setup

For developers who care about cost, 59API is especially attractive because it is priced for pay-as-you-go usage, supports the Claude and GPT ecosystems, and keeps the integration surface simple. You get official-quality models without a downgrade, plus referral rebates that can reduce your effective spend over time. That makes it a sensible choice for daily coding assistance, not just occasional experiments.

If you want to get started quickly, sign up for 59API, add your key, point Claude Code at https://api.59api.com, and begin testing on the platform you use most. In a few minutes, you can have a working setup on Windows, macOS, or Linux without overpaying for inference.

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