To use Claude Code with abliteration.ai, set ANTHROPIC_BASE_URL to https://api.abliteration.ai and ANTHROPIC_AUTH_TOKEN to your ak_... key, then run claude. Same Claude Code binary, same workflow, routed through abliteration.
Setup is three short steps: set the auth variables, pick how Claude Code should surface abliterated-model, then persist your config so you don’t re-export it in every terminal.
Install
curl -fsSL https://claude.ai/install.sh | bash
Step 1 — Set the auth variables
These two variables route Claude Code to abliteration.ai and authenticate the session. Every setup below needs them.
| Variable | Value | What it does |
|---|
ANTHROPIC_BASE_URL | https://api.abliteration.ai | Routes Claude Code to abliteration.ai instead of api.anthropic.com. |
ANTHROPIC_AUTH_TOKEN | ak_YOUR_API_KEY | Recommended. Sends your abliteration.ai key as the bearer Authorization header. ANTHROPIC_API_KEY=ak_... also works (sent as x-api-key); pick whichever your environment already has wired. |
Step 2 — Surface abliterated-model in Claude Code
Claude Code’s model picker is built around Claude model IDs. Two variable sets let it surface abliterated-model — pick whichever fits your workflow.
Replace the default Opus / Sonnet / Haiku models
Override the model ID Claude Code sends for each default tier so the existing picker just works. Plain claude launches into abliterated-model.
export ANTHROPIC_DEFAULT_OPUS_MODEL="abliterated-model"
export ANTHROPIC_DEFAULT_SONNET_MODEL="abliterated-model"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="abliterated-model"
claude
Add abliterated-model to the picker
Keep the default Claude tiers intact and add abliterated-model as an extra picker entry you switch to explicitly.
export ANTHROPIC_CUSTOM_MODEL_OPTION="abliterated-model"
export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="abliterated-model"
claude --model abliterated-model
You can also switch to it inside a session with /model.
Step 3 — Persist your config
Exporting variables in every new terminal gets old. Pick one place to save them so Claude Code always picks them up.
| Location | Where | Use when |
|---|
| Claude Code settings | ~/.claude/settings.json | You want the config scoped to Claude Code only. |
| Shell profile | ~/.zshrc or ~/.bashrc | You want the variables available to any Anthropic-compatible tool you run from the terminal. |
Option A — ~/.claude/settings.json
Claude Code reads an env block from its own settings file. Values here apply whenever you start claude.
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.abliteration.ai",
"ANTHROPIC_AUTH_TOKEN": "ak_YOUR_API_KEY",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "abliterated-model",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "abliterated-model",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "abliterated-model"
}
}
Option B — Shell profile
Append the same values to your shell profile so they export on every terminal launch.
# Append to ~/.zshrc, ~/.bashrc, or ~/.profile
export ANTHROPIC_BASE_URL="https://api.abliteration.ai"
export ANTHROPIC_AUTH_TOKEN="ak_YOUR_API_KEY"
export ANTHROPIC_DEFAULT_OPUS_MODEL="abliterated-model"
export ANTHROPIC_DEFAULT_SONNET_MODEL="abliterated-model"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="abliterated-model"
# Reload
source ~/.zshrc # or source ~/.bashrc
Headless mode
For CI/CD or scripts:
claude --model abliterated-model -p "summarize README.md"
Notes
- Policy rules attached to your API key apply to every Claude Code turn. See Policy Gateway.
Last modified on May 3, 2026