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

Installation

npm install -g @anthropic-ai/claude-code

Configuration

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 ~/.zshrc

macOS / Linux (bash)

echo 'export ANTHROPIC_BASE_URL="https://openapi.linkwo.ai"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"' >> ~/.bashrc
source ~/.bashrc

Windows (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 --version

If the version is displayed, the installation is successful.

Usage

cd /path/to/your/project
claude

Claude Code will now route all requests through openapi.linkwo.ai using your LW AI API key.

Notes

  • The ANTHROPIC_BASE_URL should be https://openapi.linkwo.ai (no /v1 suffix — 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
  • Cursor — Configure Cursor IDE
  • Cline — Configure Cline VS Code extension