ReferenceUpdated 2025-12-30

OpenAI Chat Completions compatible API

Definition and examples for OpenAI Chat Completions compatibility. Learn how to switch base URLs and keep the same SDKs.

An OpenAI Chat Completions compatible API accepts the same JSON schema as OpenAI's /v1/chat/completions endpoint.

That means you can keep your existing SDKs and just switch the base URL and API key.

Streaming, structured output, function calling, and multimodal inputs follow the same overall patterns as OpenAI's Chat Completions API.

Definition

OpenAI Chat Completions compatible API

A compatible API mirrors OpenAI's chat completions request and response format so existing clients can talk to it without rewrites.

Why it matters
  • Drop-in compatibility reduces migration time.
  • Reuse existing SDKs, tools, and client-side helpers.
  • Keep the same message format across providers.
  • Extend your integration with streaming, vision, structured output, and retry logic without retooling.
How it works
  1. 01Point your client at https://api.abliteration.ai/v1.
  2. 02Send a Bearer token using your abliteration.ai API key.
  3. 03Set model to an abliteration.ai model id such as abliterated-model.
  4. 04Enable streaming with stream: true if desired.
  5. 05Use content arrays for vision-capable models when sending images.
  6. 06Request structured JSON with response_format: { type: "json_object" }.
  7. 07Provide functions and function_call to enable function calling.
Example request
curl https://api.abliteration.ai/v1/chat/completions \
  -H "Authorization: Bearer $ABLIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "abliterated-model",
    "messages": [{"role":"user","content":"Summarize this in one sentence."}],
    "stream": true
  }'
FAQ

Frequently asked questions.

Do I need to change my message schema?

No. Use the same role/content message format as OpenAI Chat Completions.

Does compatibility include streaming and vision?

Yes. Streaming works with stream: true. Vision works when you use a vision-capable model and send images via the content array format.

Does it support function calling and structured output?

Yes. Send functions plus function_call for tool invocation and response_format: { type: "json_object" } for structured JSON.

Does streaming work?

Yes. Set stream: true and consume delta chunks as they arrive.

Is the base path different?

Use the /v1 base path and the /chat/completions endpoint.