DocsIntegrations

Using Claude Code with abliteration.ai

Configure Claude Code to use abliteration.ai as its backend. Set ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY to route Claude Code through the abliteration.ai Messages API.

Claude Code is Anthropic's agentic coding tool that lives in your terminal. It uses the Anthropic Messages API under the hood.

Because abliteration.ai exposes an Anthropic-compatible /v1/messages endpoint, you can point Claude Code at abliteration.ai by setting two environment variables — no patches or forks required.

Updated Apr 12, 2026Integrations

Quick start

Base URL
Example request
# Set environment variables and launch Claude Code
export ANTHROPIC_BASE_URL="https://api.abliteration.ai"
export ANTHROPIC_API_KEY="ak_YOUR_API_KEY"

claude

Service notes

Prerequisites

#

Configuration

#
VariableValuePurpose
ANTHROPIC_BASE_URLhttps://api.abliteration.aiDirects SDK requests to abliteration.ai instead of api.anthropic.com.
ANTHROPIC_API_KEYak_YOUR_API_KEYYour abliteration.ai API key, sent as a Bearer token.

Persistent shell configuration

#
Persistent shell configuration
# Add to ~/.bashrc, ~/.zshrc, or ~/.profile
export ANTHROPIC_BASE_URL="https://api.abliteration.ai"
export ANTHROPIC_API_KEY="ak_YOUR_API_KEY"

# Reload your shell
source ~/.zshrc   # or source ~/.bashrc

Verify the connection

#
Verify the connection
# Quick connectivity test with curl
curl -s https://api.abliteration.ai/v1/messages \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
  -d '{
    "model": "abliterated-model",
    "max_tokens": 64,
    "messages": [{"role": "user", "content": "ping"}]
  }' | python3 -m json.tool

# Then launch Claude Code — it will use the same env vars
claude

How it works

#

Using with the Anthropic SDK directly

#
Using with the Anthropic SDK directly
import anthropic

# Reads ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY from env
client = anthropic.Anthropic()

message = client.messages.create(
    model="abliterated-model",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Explain how abliteration works."}
    ],
)

print(message.content[0].text)

Troubleshooting

#

Common errors & fixes