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
Section titled “Configuration Steps”export ANTHROPIC_BASE_URL=https://api.4allapi.comexport ANTHROPIC_AUTH_TOKEN=sk-your-keyclaudeWriting this into your shell configuration file(~/.zshrc / ~/.bashrc) will make it persist long term.
Model Selection
Section titled “Model Selection”After startup, you can use /model to switch models; the token group must include Claude series models (such as fable-5).
- 401 / Authentication Failed: Make sure you are using
ANTHROPIC_AUTH_TOKEN(notANTHROPIC_API_KEYwhich 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.