Claude Code CLI
Use TokenOff for AI programming in Claude Code CLI.
Get API Key
Go to the API Keys page to create your API key.
Install Claude Code
Refer to the Claude Code documentation for installation.
- Official installation via
npmis no longer recommended.- Installation will verify if you're in a Claude service region. Use a VPN if needed.
If you installed Claude Code via npm, older versions (e.g., 2.1.98) may have compatibility issues. Testing has shown the following error:
There's an issue with the selected model (claude-haiku-4-5-20251001). It may not exist or you may not have access to itPlease uninstall the npm version, for example:
npm uninstall -g @anthropic-ai/claude-codeThen, reinstall Claude Code using the native installation method recommended in the official documentation, such as:
curl -fsSL https://claude.ai/install.sh | bashEnvironment Variable Configuration
After installing Claude Code, configure the following environment variables:
export ANTHROPIC_BASE_URL=https://tokenoff.com/api
export ANTHROPIC_AUTH_TOKEN=<your_api_key_here>Then enter in the command line:
claudeThis will enter interactive mode.
Environment Cleanup
If you have previously used Claude Code services from other providers, such as logging in with a Claude subscription service, please clean up your local environment as follows before using TokenOff, otherwise residual configurations may cause the API Key to be invalid.
-
Logout. After entering interactive mode, type
/logoutto logout.claude /logout -
Delete cache.
rm -rf ~/.claude rm -rf ~/.claude.json
Contact Us
If you encounter any issues while using TokenOff:
Contact us atsupport@tokenoff.comand other official channels for technical support
Submit an issue on ourGithubrepository