Streaming

stream:true returns server-sent events. The first byte can take longer than a typical HTTP header timeout.

On this page
bash
curl https://api.openbroker.gonka.gg/v1/chat/completions \
  -H "Authorization: Bearer obk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMaxAI/MiniMax-M2.7",
    "messages": [{ "role": "user", "content": "Count to 5." }],
    "max_tokens": 50,
    "stream": true
  }'

The response is text/event-stream. Each event is a chat completion chunk. The stream ends with data: [DONE].

Time to the first byte

The gateway often has to pick a host, and it may hold the HTTP response while it decides the primary host is unresponsive. A token can exist inside that race well before any bytes are sent to you. Clients that abort while waiting for response headers will see a failure even when the completion would have arrived.

Give chat completions a timeout of several minutes, not 15 or 30 seconds. OpenBroker waits up to 20 minutes for response headers, because a host can take that long to start. The OpenAI Python and Node SDKs default to a long request timeout. If you use httpx, Go, or another client with a short "time to headers" limit, raise that limit.

A client that gives up first comes back as HTTP 502 and a message containing timeout awaiting response headers. That message does not include an internal address. It is a transport timeout, not proof the model rejected the prompt. Retry it, or raise the client timeout. The same class of failure is counted on the status page.

Empty streams

A 200 with an empty body is treated as a failure, not as a successful empty answer. You should get an error status instead of a silent success. If your client still sees a disconnect mid-stream, the usage row is the place to check the final status. See Usage.

Cancelling

Closing the connection cancels the attempt. Those show up as client disconnects in status, and they are not the same thing as a model error.