Claude Code Integration
Claude Code is an agentic command-line coding tool developed by Anthropic that communicates via the native Anthropic Messages API.
Prerequisites
Section titled “Prerequisites”- Runtime: Ensure Node.js 18 or later is installed on your machine.
- Obtain API Key: Register and generate your API Key at AlphaTech Sign Up & API Keys.
- Install Claude Code: Install the CLI package globally:
npm install -g @anthropic-ai/claude-codeRun claude --version to verify that the installation succeeded.
Configuration Steps
Section titled “Configuration Steps”1. Set Environment Variables (Recommended)
Section titled “1. Set Environment Variables (Recommended)”Under the hood, Claude Code uses the Anthropic SDK, which automatically appends /v1/messages to requests. Therefore, the Base URL must be set to https://alphatech.net.cn without a trailing /v1.
On macOS / Linux:
export ANTHROPIC_BASE_URL="https://alphatech.net.cn"export ANTHROPIC_AUTH_TOKEN="sk-xxxx"export ANTHROPIC_MODEL="claude-new-sonnet-5"On Windows PowerShell:
$env:ANTHROPIC_BASE_URL="https://alphatech.net.cn"$env:ANTHROPIC_AUTH_TOKEN="sk-xxxx"$env:ANTHROPIC_MODEL="claude-new-sonnet-5"2. Configure via settings.json (Optional)
Section titled “2. Configure via settings.json (Optional)”Alternatively, you can configure settings in ~/.claude/settings.json (create the file if it does not exist):
{ "env": { "ANTHROPIC_BASE_URL": "https://alphatech.net.cn", "ANTHROPIC_AUTH_TOKEN": "sk-xxxx", "ANTHROPIC_MODEL": "claude-new-sonnet-5" }}Menu / Path Reference: Navigate to your user home directory (
~on Unix,%USERPROFILE%on Windows), locate the.claudefolder, and edit or createsettings.json.
3. Launch Claude Code
Section titled “3. Launch Claude Code”Navigate to your project directory and run:
cd /path/to/your-projectclaudeVerifying the Setup
Section titled “Verifying the Setup”Submit a test query inside the Claude Code prompt, for example:
> Give a one-sentence summary of this project.- Success: Claude Code streams the response smoothly, indicating calls are routed through the AlphaTech gateway.
- Console check: Log into your AlphaTech console and check the Logs tab to see incoming request entries.
Troubleshooting
Section titled “Troubleshooting”1. 404 Not Found
Section titled “1. 404 Not Found”This occurs when ANTHROPIC_BASE_URL is incorrectly set to https://alphatech.net.cn/v1. The Anthropic SDK appends /v1/messages, resulting in a non-existent /v1/v1/messages request. Change the Base URL to https://alphatech.net.cn.
2. 401 Unauthorized
Section titled “2. 401 Unauthorized”Verify that:
ANTHROPIC_AUTH_TOKENis accurately copied with thesk-prefix and no trailing spaces.- The environment variable is active in your current shell session (
echo $ANTHROPIC_AUTH_TOKEN).
3. Model not found
Section titled “3. Model not found”Make sure the selected model exists in the catalog. Recommended active models include claude-new-sonnet-5, claude-new-opus-5, or deepseek-v4.1-flash. See Models and pricing.
Reference: Official Anthropic Claude Code Documentation
Last verified on 2026-11-04