Skip to content

Claude Code Integration

Claude Code is an agentic command-line coding tool developed by Anthropic that communicates via the native Anthropic Messages API.

  1. Runtime: Ensure Node.js 18 or later is installed on your machine.
  2. Obtain API Key: Register and generate your API Key at AlphaTech Sign Up & API Keys.
  3. Install Claude Code: Install the CLI package globally:
终端窗口
npm install -g @anthropic-ai/claude-code

Run claude --version to verify that the installation succeeded.

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"

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 .claude folder, and edit or create settings.json.

Navigate to your project directory and run:

终端窗口
cd /path/to/your-project
claude

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.

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.

Verify that:

  • ANTHROPIC_AUTH_TOKEN is accurately copied with the sk- prefix and no trailing spaces.
  • The environment variable is active in your current shell session (echo $ANTHROPIC_AUTH_TOKEN).

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

需要进一步了解企业方案,或确认服务状态?