Docs

OpenAI compatibility (base URL switch)

Switch your OpenAI client to abliteration.ai by changing the base URL and API key. OpenAI-compatible /v1/chat/completions requests.

Updated 2025-12-30

abliteration.ai exposes an OpenAI-compatible /v1/chat/completions endpoint, so most OpenAI SDKs work without code rewrites.

To migrate, change the base URL, supply your abliteration.ai API key, and set the model id (for example, abliterated-model).

Your message schema, parameters, and streaming flags stay the same. The main differences are the base URL and model naming.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.abliteration.ai/v1",
    api_key="YOUR_ABLIT_KEY",
)

resp = client.chat.completions.create(
    model="abliterated-model",
    messages=[{"role": "user", "content": "Say hello in one sentence."}],
)

print(resp.choices[0].message.content)

Compatibility checklist

Use this checklist to switch providers in minutes.

Request shape and common fields

The request and response mirror OpenAI Chat Completions, so you can reuse the same SDK helpers and typed schemas.

{
  "model": "abliterated-model",
  "messages": [
    { "role": "user", "content": "Summarize this in one sentence." }
  ],
  "temperature": 0.7,
  "max_tokens": 256,
  "stream": false
}

Structured JSON output

Structured output is available through response_format with type: "json_object".

The model will return a JSON object you can parse directly.

{
  "model": "abliterated-model",
  "messages": [
    { "role": "user", "content": "Return a JSON object with title and summary." }
  ],
  "response_format": { "type": "json_object" }
}

Function calling

Function calling uses the OpenAI-compatible functions and function_call fields.

Provide a JSON Schema in parameters and optionally force a call by name.

{
  "model": "abliterated-model",
  "messages": [
    { "role": "user", "content": "Schedule a meeting on 2026-02-03 at 15:00." }
  ],
  "functions": [
    {
      "name": "create_calendar_event",
      "description": "Create a calendar event from a natural language request",
      "parameters": {
        "type": "object",
        "properties": {
          "title": { "type": "string" },
          "date": { "type": "string" },
          "time": { "type": "string" }
        },
        "required": ["title", "date", "time"]
      }
    }
  ],
  "function_call": { "name": "create_calendar_event" }
}

Migration validation

Start with a small prompt, then compare latency and output quality before sending production traffic.