NewGLM-5.3 is live as Abliterated Large v2.Try it now
Docs

OpenClaw custom Anthropic provider

Manually configure abliteration.ai as a custom Anthropic-compatible provider in OpenClaw. Add a models.providers entry, set baseUrl and apiKey, select abliterated-model.

Updated 2026-08-04

This guide shows how to use OpenClaw with abliteration.ai as a custom Anthropic-compatible model provider. For the packaged provider, use the OpenClaw ClawHub plugin guide. This page is the manual ~/.openclaw/openclaw.json setup.

OpenClaw is an open-source personal AI assistant that runs on macOS, Linux, and Windows (via WSL2). Its model layer reads custom provider definitions from ~/.openclaw/openclaw.json, so you can point its agent at any Anthropic- or OpenAI-compatible gateway.

abliteration.ai exposes the Anthropic Messages surface at /v1/messages and /v1/messages/count_tokens, which matches OpenClaw's anthropic-messages adapter one-for-one. Setup is entirely declarative: add one provider block under models.providers, register abliterated-model in its catalog, and set agents.defaults.model.primary.

Use openclaw onboard for guided setup, or edit ~/.openclaw/openclaw.json (JSON5) directly using the provider block below.

// ~/.openclaw/openclaw.json
{
  models: {
    mode: "merge",
    providers: {
      abliteration: {
        baseUrl: "https://api.abliteration.ai/v1",
        apiKey: "${ABLITERATION_API_KEY}",
        api: "anthropic-messages",
        models: [
          {
            id: "abliterated-model",
            name: "Abliterated Model",
            reasoning: false,
            input: ["text"],
            contextWindow: 128000,
            maxTokens: 8192,
            cost: {
              input: 0.005,
              output: 0.005,
            },
          },
        ],
      },
    },
  },
  agents: {
    defaults: {
      model: {
        primary: "abliteration/abliterated-model",
      },
    },
  },
}

Prerequisites

Before you start, make sure the basics are in place.

Provider settings

OpenClaw's model layer reads custom providers from models.providers.<name> inside ~/.openclaw/openclaw.json. For abliteration.ai, use the anthropic-messages adapter so OpenClaw talks to /v1/messages and /v1/messages/count_tokens.

SettingValuePurpose
models.providers.abliteration.baseUrlhttps://api.abliteration.ai/v1Targets the public abliteration.ai API under /v1. OpenClaw appends /messages and /messages/count_tokens.
models.providers.abliteration.apiKey${ABLITERATION_API_KEY}Sends your ak_ API key as the bearer token. The ${VAR} syntax reads the value from your shell at runtime.
models.providers.abliteration.apianthropic-messagesTells OpenClaw to speak the Anthropic Messages protocol to this provider.
models.providers.abliteration.models[].idabliterated-modelThe model id published by abliteration.ai. Must match exactly.
models.modemergeKeeps OpenClaw's built-in providers available alongside your custom provider. Use replace if you want to expose only abliteration.ai.
agents.defaults.model.primaryabliteration/abliterated-modelSelects abliteration.ai as the default model for new agent runs.

Configure openclaw.json

OpenClaw reads its primary config from ~/.openclaw/openclaw.json (legacy path ~/.clawdbot/clawdbot.json is still symlinked on upgraded installs). The file is JSON5, so comments, unquoted keys, and trailing commas are allowed.

Export your API key first so the ${ABLITERATION_API_KEY} interpolation resolves at runtime.

# Put this in ~/.bashrc, ~/.zshrc, or ~/.profile
export ABLITERATION_API_KEY="ak_YOUR_API_KEY"

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

# Open the config in your editor
${EDITOR:-vi} ~/.openclaw/openclaw.json

Provider block

Paste this provider block into ~/.openclaw/openclaw.json. The merge mode keeps OpenClaw's built-in providers intact so you can still switch to other models from openclaw onboard.

{
  models: {
    mode: "merge",
    providers: {
      abliteration: {
        baseUrl: "https://api.abliteration.ai/v1",
        apiKey: "${ABLITERATION_API_KEY}",
        api: "anthropic-messages",
        models: [
          {
            id: "abliterated-model",
            name: "Abliterated Model",
            reasoning: false,
            input: ["text"],
            contextWindow: 128000,
            maxTokens: 8192,
            cost: {
              input: 0.005,
              output: 0.005,
            },
          },
        ],
      },
    },
  },
  agents: {
    defaults: {
      model: {
        primary: "abliteration/abliterated-model",
        fallbacks: [],
      },
    },
  },
}

Validate the config

OpenClaw can dump its live JSON schema and validate the current config before you launch an agent.

# Print the schema OpenClaw uses to validate the config
openclaw config schema | less

# Show the resolved (merged) config that OpenClaw will use
openclaw config show

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

Run the agent

Once the provider is in place and agents.defaults.model.primary is set, OpenClaw's agent uses abliteration.ai automatically. The agent command does not accept a positional prompt or a per-run --model flag — pass the prompt with --message and select an agent profile with --agent. The reserved default agent id is main.

To switch models, edit agents.defaults.model.primary in ~/.openclaw/openclaw.json, or create a dedicated agent profile with openclaw agents add that pins its own model.

# List available agents (main is the reserved default id)
openclaw agents list

# Send a one-off message to the default agent using the primary model
openclaw agent --agent main --message "summarize this directory"

# Raise the reasoning effort for a single run
openclaw agent --agent main --thinking high --message "refactor foo.py for readability"

# Emit structured JSON instead of the default formatted output
openclaw agent --agent main --json --message "list the files in this repo"

# Bypass the gateway and run the embedded agent directly
openclaw agent --agent main --local --message "ping"

How it works

OpenClaw's anthropic-messages adapter is a drop-in client for Anthropic-compatible gateways. The custom provider you defined has the same contract as OpenClaw's built-in Anthropic support.

Alternative: OpenAI-compatible wire format

If you prefer to route OpenClaw through the OpenAI Chat Completions surface, abliteration.ai also exposes /v1/chat/completions. Use api: "openai-completions" instead. This path is useful if another part of your stack already standardizes on OpenAI-style payloads.

Avoid api: "openai-responses" for custom providers on current OpenClaw releases — it has known issues for user-defined providers (see openclaw/openclaw#43018). Prefer the anthropic-messages config at the top of this page.

{
  models: {
    mode: "merge",
    providers: {
      "abliteration-openai": {
        baseUrl: "https://api.abliteration.ai/v1",
        apiKey: "${ABLITERATION_API_KEY}",
        api: "openai-completions",
        models: [
          {
            id: "abliterated-model",
            name: "Abliterated Model (OpenAI wire)",
            input: ["text"],
            contextWindow: 128000,
            maxTokens: 8192,
            cost: { input: 0.005, output: 0.005 },
          },
        ],
      },
    },
  },
  agents: {
    defaults: {
      model: {
        primary: "abliteration-openai/abliterated-model",
      },
    },
  },
}

Troubleshooting

Most setup issues are config resolution, env var interpolation, or model id mismatches.

FAQ

Frequently asked questions.

Can I use OpenClaw with abliteration.ai?

Yes. OpenClaw's model layer supports custom providers with a user-supplied <code>baseUrl</code> and <code>apiKey</code>. Add a provider entry to <code>~/.openclaw/openclaw.json</code> with <code>api</code> set to <code>anthropic-messages</code> and point <code>baseUrl</code> at <code>https://api.abliteration.ai/v1</code>.

Which abliteration.ai endpoints does OpenClaw use?

With <code>api: "anthropic-messages"</code>, OpenClaw calls <code>POST /v1/messages</code> for inference and <code>POST /v1/messages/count_tokens</code> for token estimation. Both are first-class public endpoints on abliteration.ai.

Should the baseUrl include /v1?

Yes. For OpenClaw's <code>anthropic-messages</code> adapter, set <code>baseUrl</code> to <code>https://api.abliteration.ai/v1</code>. OpenClaw appends <code>/messages</code> and <code>/messages/count_tokens</code> under that base.

Which value of `api` should I use?

Use <code>anthropic-messages</code>. OpenClaw also accepts <code>openai-completions</code>, <code>openai-responses</code>, and <code>google-generative-ai</code>, but <code>anthropic-messages</code> is the best match for abliteration.ai because <code>/v1/messages</code> is a first-class supported surface with Anthropic-style SSE streaming. Note that custom providers using <code>openai-responses</code> are known to have issues on some OpenClaw versions (see openclaw/openclaw#43018).

What model id should I register?

Register <code>abliterated-model</code> as the model <code>id</code> inside your provider's <code>models</code> catalog. Then set <code>agents.defaults.model.primary</code> to <code>"abliteration/abliterated-model"</code> (or whatever provider name you chose).

Does OpenClaw's agent mode work against abliteration.ai?

Yes. The agent loop issues Anthropic Messages-style tool-call turns against the same <code>/v1/messages</code> endpoint, so long agentic runs, tool use, and streaming all work the same way the Anthropic SDK does.

How much does an OpenClaw session cost?

Billing is standard abliteration.ai usage &mdash; approximately $3 per 1 million tokens across input and output. OpenClaw runs can consume credits quickly because agent loops, skills, and sub-agents all make repeated calls.

Where is the OpenClaw config file located?

OpenClaw reads its primary config from <code>~/.openclaw/openclaw.json</code> in JSON5 format. The legacy <code>~/.clawdbot/clawdbot.json</code> path is automatically symlinked on upgraded installs.

Can I use an uncensored model with OpenClaw?

Yes. Define a custom provider pointing at abliteration.ai and register <code>abliterated-model</code> in its catalog. OpenClaw's agent layer will route all agent traffic to that provider without imposing its own refusal filters.

Does OpenClaw support fallback models on abliteration.ai?

Yes. OpenClaw's model failover reads <code>agents.defaults.model.fallbacks</code>. You can list secondary <code>&lt;provider&gt;/&lt;model-id&gt;</code> entries that will be tried if the primary provider fails, including other abliteration.ai-hosted models.

Why does `openclaw agent --model ...` fail with "unknown option '--model'"?

<code>openclaw agent</code> does not have a <code>--model</code> flag. Model selection is config-driven: set <code>agents.defaults.model.primary</code> in <code>~/.openclaw/openclaw.json</code>, or pin a model on a specific agent profile with <code>openclaw agents add</code>. Run the agent with <code>openclaw agent --agent main --message "..."</code>.