StartupAPI Docs

macOS

Install Claude Code on macOS

Five steps in Terminal, from Anthropic’s native installer to verified StartupAPI routing.

Estimated time: under 5 minutesmacOS 13.0 or newer.Last updated: August 21, 2026

Install Claude Code

Open Terminal (press Command+Space, type Terminal, press Return), then run:

Downloads and runs Anthropic's official installer for Claude Code.

Terminal
curl -fsSL https://claude.ai/install.sh | bash

Confirm it installed

In the same window, run:

Prints the installed version, which confirms Claude Code is on your PATH.

Terminal
claude --version
Expected output
A version such as 2.1.211 (Claude Code)

Connect StartupAPI

Replace one managed block in your zsh profile.

This replaces one clearly marked StartupAPI block in your profile. It is safe to rerun when you rotate a key or choose new model identifiers. Replace YOUR_STARTUPAPI_API_KEY with your key.

Terminal (zsh)
PROFILE="$HOME/.zshrc"
START="# >>> StartupAPI Claude Code >>>"
END="# <<< StartupAPI Claude Code <<<"
touch "$PROFILE"
TMP="$(mktemp)"
awk -v start="$START" -v end="$END" '$0 == start { skip=1; next } $0 == end { skip=0; next } !skip { print }' "$PROFILE" > "$TMP"
cat >> "$TMP" <<'STARTUPAPI_EOF'
# >>> StartupAPI Claude Code >>>
export ANTHROPIC_BASE_URL="https://startupapi.io"
export ANTHROPIC_AUTH_TOKEN="YOUR_STARTUPAPI_API_KEY"
unset ANTHROPIC_API_KEY
export ANTHROPIC_MODEL="claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-6"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5"
export CLAUDE_CODE_SUBAGENT_MODEL="claude-sonnet-4-6"
# <<< StartupAPI Claude Code <<<
STARTUPAPI_EOF
mv "$TMP" "$PROFILE"
. "$PROFILE"

Open your project

Type cd and a space, drag your project folder into Terminal, then press Return:

Moves Terminal into your project so Claude Code reads the right files.

Terminal
cd "/path/to/your-project"

Launch and verify the gateway

Start Claude Code, then inspect the active connection.

Launches an interactive Claude Code session. At the prompt, enter /status.

Terminal
claude

Common mistakes

  • Skipping the reloadThe source command reloads your profile so settings apply now.
  • Using a different shellThese steps assume zsh, the macOS default. For bash, use ~/.bashrc.
  • Running from the wrong folderStart claude from your project folder, not your home folder.

Troubleshooting

Hit an error during install or your first prompt? Match the message to a fix.

Open Troubleshooting