chat

Create a chat completion

Create a chat completion, optionally grounded in 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. A request without hosted tools is one generation over exactly what was sent: no instructions, tools, or turns are added. The previous_completion_id groups stored turns into a conversation and restores the full model context; callers normally send only the new suffix. (previous_messages and terminal_tool_name are deprecated: resend the full edited history in messages instead.) Retrieval is opt-in: declare the hosted store tools (store_search, store_grep, store_list_chunks, store_metadata_facets, list_stores) in tools to let the model search, grep, filter, and read the caller's stores server-side, scoped by each declaration. 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. 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

Public model ID. Defaults to toast-1

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 always restores the previous completion's full model context, including hosted tool calls and results

terminal_tool_namestring nullable

Deprecated and ignored. The stored transcript is never rewritten around a terminal tool call; the completion ends with the model's plain-text answer

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 server-handled tool calls (store tools and prune_context) executed for this completion; ignored when none are declared

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. search_corpus_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)

Changes

Changed in 10 of the 30 revisions of this API.406455

  • 824e59bfac1e16146See the full diff
    • ▲

      the //// request property type changed from object to no type

      request-property-type-changed

    • ▲

      the ///// request property type changed from object to no type

      request-property-type-changed

    • ▲

      added to the ///// response property oneOf list for the response status

      response-property-one-of-added

    • ▲

      added to the ///// response property oneOf list for the response status

      response-property-one-of-added

    • ▲

      the ///// response's property type changed from object to no type for status

      response-property-type-changed

    • ▲

      the ///// response's property type changed from object to no type for status

      response-property-type-changed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ●

      removed the request property /////

      request-property-removed

    • ●

      removed the request property /////

      request-property-removed

    • ●

      removed the request property /////

      request-property-removed

    • ●

      removed the request property /////

      request-property-removed

    • ●

      removed the request property /////

      request-property-removed

    • ●

      removed the request property /////

      request-property-removed

    • ●

      removed the request property //////

      request-property-removed

    • ●

      removed the request property //////

      request-property-removed

    • ●

      removed the request property //////

      request-property-removed

    • ●

      removed the request property //////

      request-property-removed

    • ●

      removed the request property //////

      request-property-removed

    • ●

      removed the request property //////

      request-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ○

      added discriminator to //// request property

      request-property-discriminator-added

    • ○

      added discriminator to ///// request property

      request-property-discriminator-added

    • ○

      added to the //// request property oneOf list

      request-property-one-of-added

    • ○

      added to the ///// request property oneOf list

      request-property-one-of-added

    • ○

      added discriminator to ///// response property for the response status

      response-property-discriminator-added

    • ○

      added discriminator to ///// response property for the response status

      response-property-discriminator-added

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the optional property /// to the response with the status

      response-optional-property-added

    • ○

      added the new optional request property ///

      new-optional-request-property

    • ○

      added the new optional request property ////

      new-optional-request-property

    • ○

      added the optional property /// to the response with the status

      response-optional-property-added

    • ○

      added the optional property //// to the response with the status

      response-optional-property-added

    • ●

      removed the request property ///

      request-property-removed

    • ●

      removed the request property ///

      request-property-removed

    • ●

      removed the request property ///

      request-property-removed

    • ●

      removed the request property ///

      request-property-removed

    • ●

      removed the request property ///

      request-property-removed

    • ●

      removed the request property ///

      request-property-removed

    • ●

      removed the request property ///

      request-property-removed

    • ●

      removed the request property ///

      request-property-removed

    This revision also has 3 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • ●

      removed the optional property /// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property /// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property /// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property /// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property /// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property /// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property /// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property /// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property /// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property /// from the response with the status

      response-optional-property-removed

    This revision also has 31 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • eb12b76f5763172722See the full diff
    • ▲

      the /// request property's max was decreased to 30.00

      request-property-max-decreased

    • ▲

      the /// request property's max was decreased to 30.00

      request-property-max-decreased

    • ▲

      the /// request property's max was decreased to 30.00

      request-property-max-decreased

    • ▲

      the /// request property's max was decreased to 20.00

      request-property-max-decreased

    • ▲

      added to the / response property oneOf list for the response status

      response-property-one-of-added

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ▲

      removed the required property ////// from the response with the status

      response-required-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ●

      removed the optional property ////// from the response with the status

      response-optional-property-removed

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added to the request property anyOf list

      request-property-any-of-added

    • ○

      the request property default value changed from 10 to 5

      request-property-default-value-changed

    • ○

      the request property default value changed from 30 to 10

      request-property-default-value-changed

    • ○

      the request property default value changed from 5 to 8

      request-property-default-value-changed

    • ○

      request property / deprecated

      request-property-deprecated

    • ○

      request property / deprecated

      request-property-deprecated

    • ○

      request property / deprecated

      request-property-deprecated

    • ○

      request property / deprecated

      request-property-deprecated

    • ○

      request property // deprecated

      request-property-deprecated

    • ○

      request property // deprecated

      request-property-deprecated

    • ○

      request property // deprecated

      request-property-deprecated

    • ○

      request property // deprecated

      request-property-deprecated

    • ○

      added filter_chunks get_chunks grep inspect_metadata search_corpus discriminator mapping keys to the / request property

      request-property-discriminator-mapping-added

    • ○

      added to the / request property oneOf list

      request-property-one-of-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      response property hosted_tool_calls/items/oneOf[subschema #1: StoreSearchCallItem -> subschema #6: StoreSearchCallItem]/ deprecated

      response-property-deprecated

    • ○

      response property hosted_tool_calls/items/oneOf[subschema #2: StoreGrepCallItem -> subschema #7: StoreGrepCallItem]/ deprecated

      response-property-deprecated

    • ○

      response property hosted_tool_calls/items/oneOf[subschema #3: StoreListChunksCallItem -> subschema #8: StoreListChunksCallItem]/ deprecated

      response-property-deprecated

    • ○

      response property hosted_tool_calls/items/oneOf[subschema #4: MetadataFacetsCallItem -> subschema #9: MetadataFacetsCallItem]/ deprecated

      response-property-deprecated

    • ○

      added filter_chunks_call get_chunks_call grep_call inspect_metadata_call search_corpus_call discriminator mapping keys to the / response property for the response status

      response-property-discriminator-mapping-added

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • ○

      request property deprecated

      request-property-deprecated

    • ○

      request property deprecated

      request-property-deprecated

    • ○

      added the new optional request property ///

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the optional property to the response with the status

      response-optional-property-added

  • e5ddc69af941553See the full diff
    • ▲

      request property list-of-types was narrowed by removing types null from media type application/json

      request-property-list-of-types-narrowed

    • ▲

      the //// request property's minItems was increased to 1

      request-property-min-items-increased

    • ▲

      the //// request property's minItems was increased to 1

      request-property-min-items-increased

    • ▲

      the //// request property's minItems was increased to 1

      request-property-min-items-increased

    • ▲

      the //// request property's minItems was increased to 1

      request-property-min-items-increased

    • ●

      removed the request property ///

      request-property-removed

    • ●

      removed the request property ///

      request-property-removed

    • ●

      removed the request property ///

      request-property-removed

    • ●

      removed the request property ///

      request-property-removed

    • ●

      removed the request property ///

      request-property-removed

    • ○

      the request property default value toast-1 was added

      request-property-default-value-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

  • d47e1d852549212See the full diff
    • ▲

      added required request body

      request-body-added-required

    • ▲

      the response's body type changed from no type to object for status

      response-body-type-changed

    • ○

      api tag chat added

      api-tag-added

    • ○

      api tag completions removed

      api-tag-removed

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the required property to the response with the status

      response-required-property-added

    • ○

      added the required property to the response with the status

      response-required-property-added

    • ○

      added the required property to the response with the status

      response-required-property-added

    • ○

      added the required property to the response with the status

      response-required-property-added

    This revision also has 35 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog