59API

← Retour aux guides

Claude Code Setup: Windows, macOS & Linux

Claude Code · EN · 2026-09-27

1. Pick the right install method for your operating system

Claude Code is a terminal-based coding assistant, so start by opening a supported shell in the project folder where you want help. The current native installer is the easiest route because it manages the Claude Code binary without requiring a separate global npm installation.

On Windows, use a current PowerShell session rather than Command Prompt. If your organization blocks script execution, ask your administrator first; do not weaken machine-wide security settings just to install one tool.

2. Confirm that Claude Code is on your PATH

Close and reopen your terminal after installation, then run claude --version. A version number confirms that the executable is installed and your shell can find it. On macOS and Linux, command -v claude can help diagnose PATH issues. On Windows, use where.exe claude.

If the command is not found, restart the terminal first. If it still fails, check the installer output for the directory it added to PATH. Avoid installing several competing global copies through npm, Homebrew, and shell installers at the same time; that can make updates and troubleshooting unnecessarily confusing.

3. Create a 59API key before connecting Claude Code

Claude Code can work with an Anthropic-compatible API endpoint, which makes 59API a practical option for developers who want predictable pay-as-you-go usage rather than paying more than necessary for everyday coding sessions. 59API provides access to official-quality Claude models, including Opus, Sonnet, Haiku, and Fable, while also offering GPT models for teams using multiple AI tools.

Create an account in the 59API dashboard, add a small working balance, and generate an API key. Store the key in a password manager or secret manager. Never paste it into source code, commit it to Git, or put it in a shared CLAUDE.md file.

4. Point Claude Code at the 59API base URL

Set the Anthropic-compatible base URL to https://api.59api.com and set your API key as an environment variable. For a temporary macOS or Linux session, run export ANTHROPIC_BASE_URL=https://api.59api.com followed by export ANTHROPIC_API_KEY=YOUR_59API_KEY.

For a persistent setup, add those export commands to your shell profile: usually ~/.zshrc on modern macOS, ~/.bashrc on many Linux distributions, or the relevant configuration file for your preferred shell. Reload the profile with source ~/.zshrc or source ~/.bashrc after saving it.

In Windows PowerShell, run setx ANTHROPIC_BASE_URL "https://api.59api.com" and setx ANTHROPIC_API_KEY "YOUR_59API_KEY", then open a new PowerShell window. If your 59API dashboard specifies an authentication-token variable instead of an API-key variable, follow the dashboard’s exact provider configuration.

5. Start in a real Git project, not a random folder

Change into a repository and launch Claude Code with claude. Starting inside the correct project lets the assistant inspect relevant files, understand the structure, and propose focused changes. For a new repository, initialize Git first so you can review every edit with git diff and easily revert mistakes.

On the first run, ask Claude Code to explain the project or use its initialization workflow to create project guidance. A concise CLAUDE.md file can document the build command, test command, formatting rules, package manager, and architectural constraints. Keep this file specific: useful instructions improve results more than a long collection of generic AI prompts.

6. Choose models based on the task and cost

Use a fast model such as Haiku for quick codebase questions, small refactors, log analysis, and repetitive edits. Sonnet is often a strong default for feature work, debugging, and multi-file changes. Reserve Opus for difficult architectural decisions, complex reasoning, or investigations where deeper analysis is worth the additional spend.

59API is especially useful when your workload changes from day to day because it offers low-cost, pay-as-you-go access without forcing every task onto the same expensive model. Check the 59API model list and aliases before setting a permanent model override, since available names and routing options can evolve.

7. Treat permissions, tests, and usage as part of the setup

Claude Code can suggest and run commands, so read proposed actions before approving them. Be cautious with destructive operations, production credentials, database commands, and broad file deletions. Keep secrets in environment variables, use .gitignore for local configuration, and prefer least-privilege keys where possible.

Finish each coding session by running the project’s formatter, tests, and linter yourself. Review git diff before committing, especially after autonomous edits. Once your workflow is working, sign up for 59API to connect Claude Code to affordable Claude and GPT access while keeping your development tooling flexible.

Tarifs · Docs

Prêt à commencer ?

Connectez Claude et GPT en quelques minutes aux prix les plus bas, sans bridage. Inscrivez-vous pour votre clé API.

Inscription gratuite