Mixedbread

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_KEY

Make your first requestLink to section

Point base_url to Mixedbread, use your Mixedbread API key, and select one supported model.

Create a chat completion
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 valueBehavior
previous_completion_idContinues a stored completion and restores prior hosted-tool context when the supplied messages extend its history unchanged.
max_tool_callsLimits the number of hosted retrieval calls for the completion.
includeReturns selected hosted-tool result payloads.
Hosted values in tools and tool_choiceConfigures or requires Mixedbread-hosted Store tools.
storeSet 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

FieldBehavior
hosted_tool_callsRecords server-side Store operations and optionally their results.
titleReturns the generated title of a stored conversation.
choices[].message.reasoning_contentReturns planning narration produced between hosted tool calls.

See every request and response field in the API reference.

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.

Integrate with Mixedbread Search
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 toolUse it for
store_searchSemantic search across one or more Stores
store_grepExact text and regular expression matching
store_list_chunksMetadata filtering, sorting, and chunk inspection
store_metadata_facetsDiscovering metadata fields and representative values
list_storesDiscovering 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.