Claude Code
Claude Code is Anthropic's terminal-based AI coding agent. You can configure it to use Link Astra's API endpoint instead of connecting to Anthropic directly.
Prerequisites
- Node.js 18+ installed
- A Link Astra API key (contact support@linkastra.ai to obtain one)
Installation
npm install -g @anthropic-ai/claude-codeConfiguration
Set two environment variables to redirect Claude Code through Link Astra:
macOS / Linux (zsh)
echo 'export ANTHROPIC_BASE_URL="https://api.linkastra.ai"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"' >> ~/.zshrc
source ~/.zshrcmacOS / Linux (bash)
echo 'export ANTHROPIC_BASE_URL="https://api.linkastra.ai"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"' >> ~/.bashrc
source ~/.bashrcWindows (PowerShell)
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.linkastra.ai", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "YOUR_API_KEY", "User")Restart your terminal after setting these variables.
Verify
claude --versionIf the version is displayed, the installation is successful.
Usage
cd /path/to/your/project
claudeClaude Code will now route all requests through api.linkastra.ai using your Link Astra API key.
Notes
- The
ANTHROPIC_BASE_URLshould behttps://api.linkastra.ai(no/v1suffix — Claude Code appends it automatically) - Claude Code uses the Anthropic API format, not the OpenAI format
- Make sure your Link Astra account supports the Claude-compatible endpoint