StartupAPI Docs

Linux

Install Claude Code on Linux

Five steps using Anthropic’s current native Linux installer and a verified StartupAPI connection.

Estimated time: under 5 minutesUbuntu 20.04+, Debian 10+, Alpine 3.19+, or a compatible x64/ARM64 distribution.Last updated: August 21, 2026

Install Claude Code

Open a Bash terminal and run:

Downloads and runs Anthropic's official native installer for Linux.

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

Confirm it installed

Run:

Prints the installed version and confirms the command 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 Bash 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 (bash)
PROFILE="$HOME/.bashrc"
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

Change to the repository you want Claude Code to use:

Makes your project the working directory for the session.

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

  • Missing Alpine packagesInstall bash, curl, libgcc, libstdc++, and ripgrep first, then set USE_BUILTIN_RIPGREP=0 in Claude Code settings.
  • Using the wrong profileBash reads ~/.bashrc; zsh normally reads ~/.zshrc.
  • Checking with a model replyA reply proves only that some endpoint answered. Use /status to verify the StartupAPI base URL.

Troubleshooting

Hit an install, PATH, authentication, or model error? Match it to the Troubleshooting guide.

Open Troubleshooting