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.
Request body
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