DocsCore API

Anthropic Messages API (v1/messages)

Full reference for the Anthropic-compatible POST /v1/messages endpoint on abliteration.ai. Request schema, streaming, authentication, rate limits, and error codes.

abliteration.ai exposes POST /v1/messages, an Anthropic Messages API–compatible endpoint. Tools and SDKs that target the Anthropic API work with a base-URL switch.

Authenticate with a Bearer token (API key or JWT), send an Anthropic-format message array, and receive a structured response with token usage and credit metering.

Streaming is supported via Server-Sent Events (SSE). Set stream: true to receive delta chunks as they are generated.

Updated Apr 12, 2026Core API

Quick start

Base URL
Example request
import anthropic

client = anthropic.Anthropic(
    base_url="https://api.abliteration.ai",
    api_key="ak_YOUR_API_KEY",
)

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

print(message.content[0].text)

Service notes

Authentication

#
Authentication
curl -X POST https://api.abliteration.ai/v1/messages \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ak_YOUR_API_KEY" \
  -d '{
    "model": "abliterated-model",
    "max_tokens": 256,
    "messages": [
      {"role": "user", "content": "Hello, world!"}
    ]
  }'

Request body

#
FieldTypeRequiredDescription
modelstringYesModel ID. Use "abliterated-model".
messagesarrayYesNon-empty array of message objects with role and content.
max_tokensintegerNoMaximum number of tokens to generate.
temperaturefloatNoSampling temperature (0–2).
streambooleanNoDefault false. Set to true for SSE streaming.
systemstring | arrayNoSystem prompt prepended to the conversation.

Message format

#
Message format
{
  "model": "abliterated-model",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "What is abliteration?"
    },
    {
      "role": "assistant",
      "content": "Abliteration is a technique that removes refusal vectors from LLMs."
    },
    {
      "role": "user",
      "content": "Explain how it works step by step."
    }
  ]
}

Non-streaming response

#
Non-streaming response
{
  "id": "msg_abc123",
  "type": "message",
  "role": "assistant",
  "model": "abliterated-model",
  "content": [
    {
      "type": "text",
      "text": "Abliteration removes refusal vectors from language models..."
    }
  ],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 42,
    "output_tokens": 128
  },
  "remaining_credits": 487,
  "estimated_credits_used": 1,
  "estimated_cost_usd": 0.00085
}

Streaming response

#
Streaming response
import anthropic

client = anthropic.Anthropic(
    base_url="https://api.abliteration.ai",
    api_key="ak_YOUR_API_KEY",
)

with client.messages.stream(
    model="abliterated-model",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Write a haiku about the ocean."}],
) as stream:
    for text in stream.text_stream:
        print(text, end="", flush=True)

Token counting

#
Token counting
// POST /v1/messages/count_tokens
// Request — same schema as /v1/messages
{
  "model": "abliterated-model",
  "messages": [
    {"role": "user", "content": "Count these tokens."}
  ]
}

// Response
{
  "input_tokens": 12
}

Rate limits

#

Credit metering

#

Developer tools

#

Common errors & fixes