chat

Create a chat completion

Create a chat completion over the caller's stores.

Supports the OpenAI Chat Completions API subset: a message list, function tools, streaming via server-sent events, and persistence via store. The caller sends the full conversation on every call; previous_completion_id groups stored turns into a conversation and restores the full model context — when the request's messages extend the stored conversation unchanged, the model also sees the previous turns' hosted tool calls and results, while an edited history is honored exactly as sent. Server-side, the model may search, grep, filter, and read the caller's stores as needed; those executions are reported in the hosted_tool_calls extension field (and as extra streaming chunks), with chunk results included only for the requested include keys. Retrieval is active by default and scoped by the store-tool configurations; disable a tool by declaring it with enabled: false. A model call to a caller-declared function tool ends the completion with tool_calls on the choice message (finish_reason tool_calls); execute the functions and continue the conversation by appending the assistant message and the matching tool messages to the next request.

post/v1/chat/completions

Request body

modelstring nullable

Accepted for OpenAI SDK compatibility and ignored; the platform selects the model

storeboolean

Whether to persist this completion for later retrieval

previous_completion_idstring nullable

ID of a stored completion this one continues (Mixedbread extension). Groups turns into a conversation for listing and deletion, and restores the full model context: when messages extend the stored conversation unchanged, the model also sees the previous turns' hosted tool calls and results, not just the text. An edited history is honored exactly as sent

streamboolean

Stream the completion as server-sent events

temperaturenumber nullable
top_pnumber nullable
max_completion_tokensinteger nullable
max_tokensinteger nullable

Deprecated alias of max_completion_tokens, honored when it is absent

max_tool_callsinteger nullable

Maximum number of hosted retrieval calls executed for this completion

parallel_tool_callsboolean

Whether the model may call multiple tools in one turn; when false, at most one is honored

metadataobject nullable
includestring[] nullable

Extra fields to include, e.g. store_search_call.results; unsupported values are ignored

Example request

{
  "tools": [
    {
      "filters": {
        "all": [
          {
            "key": "price",
            "operator": "gt",
            "value": "100"
          },
          {
            "key": "color",
            "operator": "eq",
            "value": "red"
          }
        ],
        "any": [
          {
            "key": "price",
            "operator": "gt",
            "value": "100"
          },
          {
            "key": "color",
            "operator": "eq",
            "value": "red"
          }
        ],
        "none": [
          {
            "key": "price",
            "operator": "gt",
            "value": "100"
          },
          {
            "key": "color",
            "operator": "eq",
            "value": "red"
          }
        ]
      }
    }
  ]
}

Response

The generated chat completion, or a server-sent event stream of completion chunks

idstring required
object'chat.completion'
createdinteger required
modelstring required
metadataobject nullable
titlestring nullable

Short display title of the conversation this completion belongs to (Mixedbread extension)