Use EcoToken models from Claude Code through the Anthropic Messages-compatible endpoint.
| Base URL | Authentication | Protocol |
|---|---|---|
https://ecotoken.ecophase-ai.com | Bearer API Key | Anthropic Messages |
01 Prepare access details
Create an API key in the EcoToken console and confirm that its group can access the model you intend to use.
| Parameter | Example |
|---|---|
| API Key | YOUR_API_KEY |
| Model ID / name | deepseek-v4.1-flash |
Do not store a real key in a repository. YOUR_API_KEY is a placeholder. Prefer environment variables and never paste a key into Git or a public channel.02 Install Claude Code
Skip installation if Claude Code is already present. Version v2.1.234 or newer is recommended.
npm install -g @anthropic-ai/claude-code03 Option one: EcoToken configuration tool
ecotoken is a one-time local configuration tool, not a resident proxy. It preserves unrelated settings and updates ~/.claude/settings.json. An existing file is backed up as ~/.claude/settings.json.ecotoken.bak when a change is required.
npm install -g @ecophase-ai/ecotokenShell history may retain the key. Use the interactive menu when key secrecy is more important.
Close Claude Code completely before restoring the neighboring .ecotoken.bak file. No backup exists when the target file did not exist before first setup.
04 Option two: manual configuration
Claude Code appends /v1/messages, so use the site root and do not append /v1 yourself.
export ANTHROPIC_BASE_URL="https://ecotoken.ecophase-ai.com"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
export ANTHROPIC_MODEL="deepseek-v4.1-flash"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4.1-flash"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4.1-flash"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4.1-flash"05 Launch and verify
cd /path/to/your-project
claudeSend a short prompt. The integration is working when the Agent returns model output and the corresponding request appears under Usage & costs → Request records in the EcoToken console.
06 Common errors
401: Check that the API key is complete and active, and that the variables are set in the same terminal session that launches Claude Code.403: Check the key group, model permission, account state, and gateway policy.model not found: The model ID must exactly match the EcoToken console value.Base URL: Claude Code useshttps://ecotoken.ecophase-ai.comand appends/v1/messagesitself; do not add/v1again.
