Datattention

2026-06-18

Streaming from an open OpenAI-compatible API

stream true on ports 8000 and 8080 returns server-sent events. The Ollama port returns one JSON object.

Set stream to true on POST /v1/chat/completions when you want server-sent events. Each event is a line starting with data:, and the stream ends with data: [DONE]. The content type is text/event-stream. curl needs -N so it does not buffer the whole body.

The same flag works on POST /v1/completions. Omit the flag, or set it to false, when you want one JSON object with a choices array. Both forms are available on ports 8000, 8080, and 4000, and on the Hermes and OpenClaw chat routes.

The Ollama-style port on this host does not emit that event stream. POST /api/chat and POST /api/generate return one JSON object with done set to true. Use stream: false there.

On this host

This is the streaming call against port 8000. No API key. The Ollama port stays a single JSON response.

curl -N http://datattention.com:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"gpt-4o-mini","stream":true,"messages":[{"role":"user","content":"Hello"}]}'

The full list of ports and paths is on the endpoints page.