Configure Claude Code Model Provider
This setup uses environment variables only. It does not require CC Switch or another provider-management interface.
Get an API key first
Open the LAYSO AI website ↗, sign in or create an account, create an API key in the dashboard, and then return here to continue.
Connection values
| Setting | Value |
|---|---|
| Protocol | Anthropic compatible |
| Base URL | https://api.layso.ai |
| Key variable | ANTHROPIC_AUTH_TOKEN |
| Key source | LAYSO AI dashboard ↗ |
Temporary setup
export ANTHROPIC_BASE_URL="https://api.layso.ai"
export ANTHROPIC_AUTH_TOKEN="$LAYSO_API_KEY"
claudeKeep LAYSO_API_KEY in secure local storage. Never commit a real key to a repository.
Persistent setup
zsh
echo 'export ANTHROPIC_BASE_URL="https://api.layso.ai"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="$LAYSO_API_KEY"' >> ~/.zshrc
source ~/.zshrcBash
echo 'export ANTHROPIC_BASE_URL="https://api.layso.ai"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="$LAYSO_API_KEY"' >> ~/.bashrc
source ~/.bashrcWindows PowerShell
For the current window:
$env:ANTHROPIC_BASE_URL = "https://api.layso.ai"
$env:ANTHROPIC_AUTH_TOKEN = $env:LAYSO_API_KEY
claudePersist for the current user:
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.layso.ai", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", $env:LAYSO_API_KEY, "User")Reopen PowerShell and your editor after saving the variables.
Verify the setup
printf 'Base URL: %s\n' "$ANTHROPIC_BASE_URL"
test -n "$ANTHROPIC_AUTH_TOKEN" && echo 'Auth token: configured' || echo 'Auth token: missing'Test the Anthropic route directly:
curl https://api.layso.ai/models \
-H "x-api-key: $ANTHROPIC_AUTH_TOKEN" \
-H "anthropic-version: 2023-06-01"Start Claude Code and run /status inside the session.
Select a model
One LAYSO AI API key can access platform models. Successful requests have itemized charges based on the selected model's current price; failed tasks are not charged. Copy exact model IDs from the dashboard.
Authentication troubleshooting
| Error | Resolution |
|---|---|
401 / 403 | Reload the shell and verify the LAYSO AI key in ANTHROPIC_AUTH_TOKEN |
404 | Set the Base URL to https://api.layso.ai without any extra path |
| Unknown model | Use the exact model ID from the dashboard |
| Editor still uses the old endpoint | Fully restart the editor |
Next step
Optionally configure CCometixLine or create Claude Code Skills.
