Skip to content

Chat Completions

Generates a response from a list of messages, with or without streaming.

Updated on Sep 16, 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.

POSThttps://api.hinow.ai/v1/chat/completionsBearer

Generates a response from a list of messages. Supports streaming over SSE.

Parâmetros

  • modelstring· bodyobrigatório

    Namespaced model id, such as `hinow/himax`.

  • messagesarray· bodyobrigatório

    The conversation messages. Content may include text and, on supported models, parts such as `image_url`.

  • streamboolean· body

    Returns tokens as they are produced, over SSE. `usage` arrives in the last event.

  • temperaturenumber· body

    Controls sampling variation. Lower values tend to produce more stable responses.

  • max_tokensinteger· body

    Upper 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· body

    Tools in JSON Schema for function calling.

  • tool_choicestring· body

    `"auto"` lets the model decide whether to call a tool.

  • reasoningobject· body

    Reasoning control: `{ effort, enabled, exclude, max_tokens }`. See the Reasoning page.

  • reasoning_effortstring· body

    Shortcut for `reasoning.effort`: `none`, `minimal`, `low`, `medium`, `high`, `xhigh` or `max`.

  • include_reasoningboolean· body

    `false` hides the reasoning in the response (same as `reasoning.exclude: true`).

  • thinkingstring· body

    `"on"` or `"off"`. Earlier alias of `reasoning.enabled`; still accepted.

Respostas

200Generated response
{
  "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 }
}
400Malformed body (`invalid_request_error`)
404Model does not exist or is not enabled (`model_not_found`)
429Per-minute limit exceeded (`rate_limit_exceeded`)

Reasoning in the response

When the call asks for reasoning (or the model reasons by default), the message carries the trace next to the content, in the OpenRouter format. How to turn it on, pick the level and hide it is in Reasoning.

FieldWhat it says
message.reasoningThe reasoning as text; absent with exclude
message.reasoning_details[]type, text, format, index and, when present, signature
native_finish_reasonThe model's original stop reason
usage.completion_tokens_details.reasoning_tokensOutput tokens spent on reasoning
usage.prompt_tokens_details.cached_tokensInput tokens served from the cache

When streaming, delta.reasoning arrives before delta.content.

finish_reason

ValueWhat it meansWhat to do
stopThe model finished the responseNothing — this is the normal case
lengthThe generation hit max_tokensThe response is truncated; raise the limit or ask for something shorter in the prompt
tool_callsThe model requested a toolRead 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.