Chat Completions
The Mixedbread Chat Completions API is an OpenAI Chat Completions-compatible endpoint for Mixedbread specialized models and agentic workflows. When integrated with Mixedbread Search, the model can plan searches, inspect the returned evidence, and produce a grounded answer in a single API request.
You can use the OpenAI SDK by changing base_url and api_key, then selecting
a model from the supported models.
PrerequisiteLink to section
Get a Mixedbread API key from the API Keys page. You can install the OpenAI SDK or use cURL directly.
export MXBAI_API_KEY=YOUR_API_KEYMake your first requestLink to section
Point base_url to Mixedbread, use your Mixedbread API key, and select one
supported model.
from openai import OpenAI
client = OpenAI(
base_url="https://api.mixedbread.com/v1",
api_key="YOUR_API_KEY",
)
completion = client.chat.completions.create(
model="toast-1",
messages=[
{
"role": "user",
"content": "What is a search agent?",
}
],
)
print(completion.choices[0].message.content)Read the generated message from choices[0].message.
OpenAI compatibilityLink to section
Mixedbread accepts the OpenAI Chat Completions shape for supported fields. The tables below cover Mixedbread-specific extensions and behavior:
Request fieldsLink to section
| Field or value | Behavior |
|---|---|
previous_completion_id | Continues a stored completion and restores prior hosted-tool context when the supplied messages extend its history unchanged. |
max_tool_calls | Limits the number of hosted retrieval calls for the completion. |
include | Returns selected hosted-tool result payloads. |
Hosted values in tools and tool_choice | Configures or requires Mixedbread-hosted Store tools. |
store | Set to false to enable zero data retention. Completion content is not retained, and no retrievable completion is created. Operational model and token metadata is still recorded. |
Response fieldsLink to section
| Field | Behavior |
|---|---|
hosted_tool_calls | Records server-side Store operations and optionally their results. |
title | Returns the generated title of a stored conversation. |
choices[].message.reasoning_content | Returns planning narration produced between hosted tool calls. |
See every request and response field in the API reference.
Integrate with Mixedbread SearchLink to section
Mixedbread Search tools let Toast 1 plan and execute Store retrieval inside one completion request, then return a grounded answer without a client-side tool loop.
completion = client.chat.completions.create(
model="toast-1",
messages=[
{
"role": "user",
"content": "What do my documents say about onboarding?",
}
],
extra_body={
"tools": [
{
"type": "store_search",
"store_identifiers": ["my-knowledge-base"],
}
]
},
)
print(completion.choices[0].message.content)Mixedbread Search tools are opt-in: declare a tool in tools to turn it on for
that completion, and scope its Store operations with store_identifiers. A
completion that declares none runs no Store retrieval.
| Search tool | Use it for |
|---|---|
store_search | Semantic search across one or more Stores |
store_grep | Exact text and regular expression matching |
store_list_chunks | Metadata filtering, sorting, and chunk inspection |
store_metadata_facets | Discovering metadata fields and representative values |
list_stores | Discovering the Stores available to the API key |
Use tool_choice to require a particular Mixedbread Search tool.
max_tool_calls limits Mixedbread Search calls. Add a matching include value
when your application needs retrieved chunk payloads in hosted_tool_calls.