OpenAI-compatible API
Chat Completions API
An HTTP API that accepts and returns the same shapes as OpenAI’s Chat Completions endpoint, so existing SDKs and tools work by changing the base URL.
In DocSlurpGlossary entry
On this page
An OpenAI-compatible API accepts the same HTTP request as OpenAI’s Chat Completions endpoint (POST /v1/chat/completions with model and a list of messages) and returns the same response shape. Because so many SDKs, frameworks and tools speak that format, a compatible server works with all of them by changing two settings: the base URL and the API key.
from openai import OpenAI
client = OpenAI(base_url="https://docslurp.io/v1", api_key="...")
reply = client.chat.completions.create(
model="project:default",
messages=[{"role": "user", "content": "How fast can my assistant get the Learjet to London?"}],
)
The model field is just a string, so servers reuse it as a routing key. Model routers put provider model names there; a RAG service can put the name of the document collection to answer from.
The gotcha
The format is a shape, not a contract about behavior. A compatible server may support only some parameters, and the dangerous ones are those it silently ignores: you set temperature or pass tools, nothing changes, and you never find out. A good server rejects what it doesn’t honor with a clear 400. Extra data, such as citations, usually rides in an extension field that standard clients drop, so read the raw response if you need it.
Streaming uses the same convention: stream: true returns server-sent events with incremental delta chunks, ending with data: [DONE].
In DocSlurp
In DocSlurp
POST /v1/chat/completions answers from a project named as the model (project:default, project:<slug>), lists projects at GET /v1/models and returns citations in a docslurp extension field. Unsupported parameters such as tools or temperature get a 400 (core/server/src/routes/chat-completions.ts). See chat.