Claude Code
Use MoxToken as the model backend for Claude Code by switching the Anthropic base URL. Works with every Claude model MoxToken supports, with no code or version changes required.
Prerequisites
- Claude Code installed
- A MoxToken API Key created in the MoxToken Console
Setup
Set the environment variables for the current terminal session:
export ANTHROPIC_BASE_URL=https://api.moxtoken.com/v1
export ANTHROPIC_API_KEY=<your-api-key> To persist across sessions, append them to your shell config:
echo 'export ANTHROPIC_BASE_URL=https://api.moxtoken.com/v1' >> ~/.zshrc
echo 'export ANTHROPIC_API_KEY=<your-api-key>' >> ~/.zshrc
source ~/.zshrc Choosing a Model
Claude Code ships with its own Claude model selector. Once configured, pick a model the way you normally would. Claude Code sends the chosen model name to MoxToken, which routes the request to the corresponding upstream provider.
Verification
Start Claude Code:
claude Send a message in the session. If you receive a normal response, MoxToken is wired up correctly.