Set Up Claude Code on Windows, macOS, and Linux
1) Start with the right API endpoint
Claude Code works best when your API connection is simple, stable, and compatible with Anthropic-style requests. If you want lower usage costs without changing your workflow, 59API is a strong option: itâs a pay-as-you-go AI relay with native, official-quality models, cheap rates, and support for Claude Code plus OpenAI SDKs. Use this base URL in your client or environment config: https://api.59api.com.
Why this matters: you keep the same developer experience, but you avoid paying premium direct-model prices every time you run a prompt, refactor, or code review. The referral rebate is a nice extra if you plan to share access with teammates.
2) Install the basics first
Before setting up Claude Code, make sure your machine has the core tooling installed:
- Git for cloning repos and managing changes
- Node.js if your Claude Code setup or wrapper expects it
- Python only if your automation scripts need it
Check versions in a terminal before you start. On any OS, a quick git --version and node --version saves time later.
3) Windows: use PowerShell and a clean shell setup
On Windows, the smoothest path is usually PowerShell or Windows Terminal. Install Git for Windows, then install Node.js LTS if your Claude Code tooling needs it. If you prefer a Unix-like environment, WSL2 is also a solid option, especially for projects that already assume Linux commands.
- Open PowerShell as your normal user, not as administrator unless required.
- Set your API key as an environment variable for the current session or permanently in system settings.
- Point your client or tool to https://api.59api.com when configuring the API base URL.
Tip: if your Windows shell has trouble with path or quoting issues, use WSL2 for fewer headaches. Claude Code workflows often feel more predictable there.
4) macOS: install through Homebrew when possible
On macOS, Homebrew makes setup fast and repeatable. Install Git and Node with brew if they are not already on your system. Then open Terminal or iTerm2 and configure your environment variables for the API key and base URL.
- Run your package installs in a standard user session.
- Use the same project folder structure youâd use on Linux for consistency.
- Confirm your shell profile is loaded, especially if you use zsh.
If you work across multiple Macs, keeping your Claude Code config in a shell profile or dotfile makes it easier to replicate the setup. Thatâs especially useful when you want to switch between local experiments and production-ready projects without reconfiguring everything.
5) Linux: keep it minimal and reproducible
Linux is usually the easiest environment for Claude Code because you can make everything explicit. Install Git, Node.js, and any build tools your repository needs. Then export the required variables in your shell profile or, better, load them from a project-specific .env file if your workflow supports it.
- Debian/Ubuntu users can install packages with apt.
- Fedora users can rely on dnf.
- Arch users can use pacman.
For servers and remote dev boxes, Linux plus 59API is a practical combo: you get low-cost model access, no model downgrade, and a clean setup that scales from local development to CI-style automation.
6) Configure Claude Code with the relay settings
Most issues come down to one of three things: the wrong base URL, a missing key, or a model name mismatch. Double-check that your Claude Code or compatible client is using the relay endpoint, not the default provider endpoint. For 59API, the important part is the base URL: https://api.59api.com.
- Set your API key in the environment or tool settings.
- Use a model you actually want to pay for, such as Claude Opus, Sonnet, Haiku, or Fable, depending on your task.
- Test with a small prompt first before running a large codebase analysis.
If youâre also using OpenAI-compatible tools, the same relay can simplify your stack because 59API works with Claude Code, Codex, and any OpenAI SDK.
7) Test with a real coding task, not a toy prompt
Donât stop after âhello world.â Ask Claude Code to inspect a small project, summarize a file, or suggest a refactor. That verifies your auth, base URL, and model access in one shot. A real task also helps you confirm latency and response quality before you commit to a bigger workflow.
If the response fails, check your network, your environment variables, and whether your account has the right access. With a relay like 59API, debugging is usually straightforward because the setup mirrors standard API usage.
8) Keep costs under control from day one
Claude Code can be surprisingly economical when you use the right model for the right job. Reserve top-tier models for deep reasoning, complex architecture, and tricky refactors. Use lighter models for summaries, formatting, and repetitive edits. Because 59API is already among the cheapest relays, that model discipline can stretch your budget even further.
In practice, that means more iterations, more code review, and more automation for less money. If youâre setting this up for a team or a side project, itâs a smart place to start. If you want a low-cost, official-quality setup that works across Windows, macOS, and Linux, sign up for 59API and wire it into your Claude Code workflow today.
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