Claude Code
Claude Code is Anthropic's terminal-based AI coding agent. You can configure it to use LW AI's API endpoint instead of connecting to Anthropic directly.
Prerequisites
- Node.js 18+ installed
- A LW AI API key (contact support@linkwo.com to obtain one)
Installation
npm install -g @anthropic-ai/claude-codeConfiguration
Set two environment variables to redirect Claude Code through LW AI:
macOS / Linux (zsh)
echo 'export ANTHROPIC_BASE_URL="https://openapi.linkwo.ai"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"' >> ~/.zshrc
source ~/.zshrcmacOS / Linux (bash)
echo 'export ANTHROPIC_BASE_URL="https://openapi.linkwo.ai"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"' >> ~/.bashrc
source ~/.bashrcWindows (PowerShell)
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://openapi.linkwo.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 openapi.linkwo.ai using your LW AI API key.
Notes
- The
ANTHROPIC_BASE_URLshould behttps://openapi.linkwo.ai(no/v1suffix — Claude Code appends it automatically) - Claude Code uses the Anthropic API format, not the OpenAI format
- Make sure your LW AI account supports the Claude-compatible endpoint