Do I need to change my message format?
No. The message format is identical to OpenAI. Your existing role/content arrays work unchanged.
SDK Migration
The OpenAI Python SDK supports custom endpoints via base_url. Switch to abliteration.ai without rewriting your application.
Your existing message format, streaming logic, and function calls work unchanged.
Switching the OpenAI Python SDK base URL means changing one parameter to route requests through an alternative OpenAI-compatible provider.
from openai import OpenAI
# Before: OpenAI default
# client = OpenAI(api_key="sk-...")
# After: abliteration.ai
client = OpenAI(
base_url="https://api.abliteration.ai/v1",
api_key="YOUR_ABLIT_KEY",
)
completion = client.chat.completions.create(
model="abliterated-model",
messages=[{"role": "user", "content": "Summarize this document."}],
)
print(completion.choices[0].message.content)FAQ
No. The message format is identical to OpenAI. Your existing role/content arrays work unchanged.
Yes. Set stream=True and iterate over chunks exactly like OpenAI.
Yes. Remove the base_url parameter to return to the OpenAI default endpoint.