Install and configure Claude Code CLI to work via Rus-GPT API
Install Claude Code and configure it to connect to Rus-GPT API.
Install Node.js (v18+) — download the installer from the website.
Install Git — download the installer from the website.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
npm install -g @anthropic-ai/claude-code
claude --version
Install Node.js (v18+) via package manager or from the website.
npm install -g @anthropic-ai/claude-code
claude --version
Set environment variables to connect to Rus-GPT API. Claude Code uses three model slots: haiku (quick tasks), sonnet (main work) and opus (complex tasks).
Run in PowerShell:
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "rusgpt-YOUR_KEY", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://rus-gpt.com/api", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_DEFAULT_HAIKU_MODEL", "z-ai/glm-5.1", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_DEFAULT_SONNET_MODEL", "z-ai/glm-5.1", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_DEFAULT_OPUS_MODEL", "z-ai/glm-5.1", "User")
Add the following lines to your ~/.bashrc or ~/.zshrc:
export ANTHROPIC_AUTH_TOKEN="rusgpt-YOUR_KEY"
export ANTHROPIC_BASE_URL="https://rus-gpt.com/api"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="z-ai/glm-5.1"
export ANTHROPIC_DEFAULT_SONNET_MODEL="z-ai/glm-5.1"
export ANTHROPIC_DEFAULT_OPUS_MODEL="z-ai/glm-5.1"
Apply changes:
source ~/.bashrc
Replace rusgpt-YOUR_KEY with your API key. Get a key on the API Keys page. Full model list on the Models page.
claude
Open-source model from ZhipuAI. Excellent code quality at minimal cost.
ANTHROPIC_DEFAULT_HAIKU_MODEL=z-ai/glm-5.1
ANTHROPIC_DEFAULT_SONNET_MODEL=z-ai/glm-5.1
ANTHROPIC_DEFAULT_OPUS_MODEL=z-ai/glm-5.1
Official Anthropic models. Maximum quality for complex tasks.
ANTHROPIC_DEFAULT_HAIKU_MODEL=anthropic/claude-haiku-4.5
ANTHROPIC_DEFAULT_SONNET_MODEL=anthropic/claude-sonnet-4.6
ANTHROPIC_DEFAULT_OPUS_MODEL=anthropic/claude-opus-4.6
Cost estimate for a typical programming session (1-2 hours of active work, ~500K tokens):
| Model | Session Cost | Comment |
|---|---|---|
z-ai/glm-5.1 |
~200 ₽ | Best open-source coding model by ZhipuAI |
anthropic/claude-opus-4.6 |
~1500 ₽ | Top coding model. Closed-source by Anthropic |
Error cannot be loaded because running scripts is disabled on this system. Run in PowerShell: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser and restart PowerShell.
After npm install the claude command is not found. Make sure Node.js is installed and restart PowerShell. Check: node --version and npm config get prefix — the prefix path must be in your PATH variable.
Claude Code connects to Anthropic instead of Rus-GPT. Environment variables were not applied — you must restart PowerShell after setting them. Check: echo $env:ANTHROPIC_BASE_URL — should return https://rus-gpt.com/api.
EACCES or EPERM error during install. Run PowerShell as Administrator or reinstall Node.js with the "Current user only" option. If the install hangs — clear the cache: npm cache clean --force
Invalid API key. Verify the key starts with rusgpt- and is fully copied. Create new key
SyntaxError or Cannot find module 'node:fs' errors on startup. Node.js v18 or higher is required. Check your version: node --version. Download the latest LTS from nodejs.org.
Key management
API KeysAvailable models
Models and pricingBalance top-up
DepositTechnical support
TelegramAPI Documentation
API Instructionsclaude in the terminal from your project directory.