Chat Completions
Generates a response from a list of messages, with or without streaming.
Updated on Aug 09, 2026
The core endpoint of the API. Send the history as a list of messages and receive the model's next response — the call is stateless, so the context is exactly what you sent. The guided usage is in Text generation.
https://api.hinow.ai/v1/chat/completionsBearerGenerates a response from a list of messages. Supports streaming over SSE.
Parâmetros
modelstring· bodyobrigatórioNamespaced model id, such as `hinow/himax`.
messagesarray· bodyobrigatórioThe conversation messages. Content may include text and, on supported models, parts such as `image_url`.
streamboolean· bodyReturns tokens as they are produced, over SSE. `usage` arrives in the last event.
temperaturenumber· bodyControls sampling variation. Lower values tend to produce more stable responses.
max_tokensinteger· bodyUpper limit of tokens in the response. When it truncates, `finish_reason` comes back as `"length"`.
response_formatobject· body`{"type": "json_object"}` requests content in JSON. Validate the fields in your application.
toolsarray· bodyTools in JSON Schema for function calling.
tool_choicestring· body`"auto"` lets the model decide whether to call a tool.
Respostas
{
"id": "chatcmpl-R2dSu3p8...",
"object": "chat.completion",
"model": "hinow/hinova",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "..." },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 132, "completion_tokens": 60, "total_tokens": 192 }
}| Value | What it means | What to do |
|---|---|---|
stop | The model finished the response | Nothing — this is the normal case |
length | The generation hit max_tokens | The response is truncated; raise the limit or ask for something shorter in the prompt |
tool_calls | The model requested a tool | Read message.tool_calls and return the result |
Streaming and token counting
With stream: true, the usage field only appears in the last event, together with finish_reason, and the stream ends with data: [DONE]. Consume the final event when you need to record the count returned by the API.

