Configuring Claude Code
Claude Code is an intelligent coding tool that runs in the terminal and helps developers quickly complete tasks such as code generation, debugging, and refactoring through natural language commands.
Use Claude Code through OriginRouter CLI
OriginRouter CLI provides a unified local entry point for Claude Code, connecting Cloud routes, model providers, session control, approvals, and cross-device collaboration. This path does not require manually installing Claude Code or maintaining account credentials and configuration files.
For OriginRouter CLI installation and initialization, see overview and install. If you prefer a graphical interface to start, view, and control Claude Code sessions, see Agent Control.
originrouter claude
Use OriginRouter Coding Plan through OriginRouter CLI for a 50% Credits deduction, easier model switching, and more advanced AI assistance. See quickstart for account sign-in and Cloud route initialization.
Manually install Claude Code
Prerequisites
- You need to install Node.js 18 or higher
- MacOS users are recommended to install Node.js via nvm or Homebrew
- Windows users also need to install Git for Windows
Open the command line interface and install Claude Code
npm i -g @anthropic-ai/claude-code
Run the following command to check the installation result. If a version number is displayed, the installation was successful.
claude --version
If Claude Code is not started through OriginRouter CLI, choose one of the following configuration methods.
Choose a configuration method
Quick setup is configured through environment variables and only takes effect in the current terminal session. The configuration will be lost after closing the terminal.
If you are on the pay-as-you-go API plan, use the configuration below (requests are served via the /beta endpoint and billed per request):
# 设置 OriginRouter 服务端点
export ANTHROPIC_BASE_URL=https://api.easytransnote.com/beta
# 设置 API 密钥(任选其一)
export ANTHROPIC_API_KEY=sk-v1-xxxxxx
# 或
export ANTHROPIC_AUTH_TOKEN=sk-v1-xxxxxx
# 设置主力模型
export ANTHROPIC_MODEL=claude-sonnet-4-6
# 设置快速响应模型
export ANTHROPIC_SMALL_FAST_MODEL=claude-haiku-4-5
# 跳过欢迎界面
export ANTHROPIC_HAS_COMPLETED_ONBOARDING=true
# 设置 API 请求的超时时间
export API_TIMEOUT_MS=3000000
# 禁用所有非必要的网络通信
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
If you have subscribed to the OriginRouter One coding plan, use the configuration below (requests are served via the /coding endpoint and consume your subscription quota):
# 设置 OriginRouter 服务端点
export ANTHROPIC_BASE_URL=https://api.easytransnote.com/coding
# 设置 API 密钥(任选其一)
export ANTHROPIC_API_KEY=sk-v1-xxxxxx
# 或
export ANTHROPIC_AUTH_TOKEN=sk-v1-xxxxxx
# 设置主力模型
export ANTHROPIC_MODEL=claude-sonnet-4-6
# 设置快速响应模型
export ANTHROPIC_SMALL_FAST_MODEL=claude-haiku-4-5
# 跳过欢迎界面
export ANTHROPIC_HAS_COMPLETED_ONBOARDING=true
# 设置 API 请求的超时时间
export API_TIMEOUT_MS=3000000
# 禁用所有非必要的网络通信
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
With an OriginRouter One subscription, choose the corresponding Coding API endpoint and make sure the model ID comes from the Supported Models list; with the pay-as-you-go API plan, choose the corresponding Beta API endpoint and make sure the model ID comes from the Model List; a plan and endpoint mismatch may make models unavailable or result in unexpected billing.
Start Claude Code
claude