Endpoint
POST /api/chat
What it does
Ollama-compatible chat:- non-streaming: a single JSON object (
application/json) - streaming: NDJSON (
application/x-ndjson, one JSON object per line)
Request body (Ollama-like)
model(string, required) — model name.messages(array, expected) — array of{role, content}messages.system(string, optional) — system prompt.options(object, optional) — Ollama options (examples:temperature,top_p,top_k,num_predict,num_ctx,stop,seed).stream(bool, optional) — enable streaming (defaults tofalse).datai.tools(optional) — built-in tools switch (same as in Completions).