Skip to content
Main Site News Console

Claude Code

Claude Code uses Anthropic’s native protocol, and 4ALL API’s Claude Native Format can be used directly; you only need to set two environment variables.

Configuration Steps

Terminal window
export ANTHROPIC_BASE_URL=https://api.aiproxys.net
export ANTHROPIC_AUTH_TOKEN=sk-your-key
claude

Writing this into your shell configuration file(~/.zshrc / ~/.bashrc) will make it persist long term.

Model Selection

After startup, you can use /model to switch models; the token group must include Claude series models (such as fable-5).

FAQ

  • 401 / Authentication Failed: Make sure you are using ANTHROPIC_AUTH_TOKEN (not ANTHROPIC_API_KEY which is the older variable name in older versions; setting both is the safest option);
  • Model Unavailable: The token’s model group does not include this Claude model; adjust the group in the console;
  • Long Tasks Interrupted: For CLI scenarios, it is recommended to set a more generous token quota limit to avoid failures due to insufficient quota midway.