Skip to main content
POST
/
v1
/
messages
curl --request POST \ --url https://api.abliteration.ai/v1/messages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "model": "abliterated-model", "messages": [ { "role": "user", "content": "Write one sentence about Stonehenge." } ], "max_tokens": 256 } '
{
  "id": "msg_01XFDUDYJgAACzvnptvVoYEL",
  "type": "message",
  "role": "assistant",
  "model": "abliterated-model",
  "content": [
    {
      "type": "text",
      "text": "Stonehenge is a prehistoric monument in Wiltshire, England, consisting of a ring of standing stones dating back to around 3000 BCE."
    }
  ],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 14,
    "output_tokens": 32
  },
  "remaining_credits": 487,
  "estimated_credits_used": 1,
  "estimated_cost_usd": 0.00023
}

Authorizations

Authorization
string
header
required

Use a JWT or API key as a Bearer token.

Headers

X-Free-Tier
enum<string>

Set to true to use the single anonymous free request.

Available options:
true

Body

application/json
model
string
required

Model id (e.g. abliterated-model).

messages
object[]
required

Non-empty array of message objects. Each has role (user or assistant) and content (string or content-block array).

Minimum array length: 1
max_tokens
integer

Maximum number of tokens to generate.

Required range: x >= 1
temperature
number

Sampling temperature.

Required range: 0 <= x <= 2
stream
boolean
default:false

Enable Server-Sent Events streaming.

system

System prompt. Can be a string or an array of content blocks.

flagged_categories
string[]

Optional moderation categories to block. Supported: harassment, hate, illicit, sexual. Self-harm and sexual/minors are always blocked.

Response

Message response

id
string
required

Unique message id (e.g. msg_01XFDUDYJgAACzvnptvVoYEL).

type
enum<string>
required
Available options:
message
role
enum<string>
required
Available options:
assistant
model
string
required
content
object[]
required
stop_reason
string | null

Reason the model stopped generating (e.g. end_turn, max_tokens).

stop_sequence
string | null
usage
object
remaining_credits
integer | null

User's remaining credit balance after this call.

estimated_credits_used
integer

Credits consumed by this call.

estimated_cost_usd
number

Estimated cost in USD.