Skip to content

Chat & models

Send chat messages and discover which models your workspace can use.

GET /api/ai/models

Returns the models available to your workspace’s plan. Use the returned model id values with the chat endpoint.

Terminal window
curl https://ai.mixerlead.com/api/ai/models \
-H "Authorization: Bearer $MIXERLEAD_API_KEY"
Response (200)
{
"models": [
{ "id": "ml-auto", "name": "Auto", "task": "Automatic model selection", "requiresPaid": false },
{ "id": "<model-name>", "name": "<model-name>", "task": "Text generation", "requiresPaid": false }
]
}

POST /api/chat

Sends a message and returns the assistant’s reply. The response is streamed so you can render tokens as they arrive.

FieldTypeRequiredDescription
messagestringThe user message to send.
modelstringA model id from /api/ai/models. Omit for Auto.
conversationIdstringContinue an existing conversation. Omit to start a new one.
Terminal window
curl -N https://ai.mixerlead.com/api/chat \
-H "Authorization: Bearer $MIXERLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "Write three LinkedIn angles for our product launch.",
"model": "ml-auto"
}'
Node.js — read the stream
const res = await fetch("https://ai.mixerlead.com/api/chat", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MIXERLEAD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ message: "Summarize our Q3 strategy in 5 bullets." }),
});
// Stream the response body as it arrives.
const reader = res.body.getReader();
const decoder = new TextDecoder();
for (;;) {
const { value, done } = await reader.read();
if (done) break;
process.stdout.write(decoder.decode(value));
}

Chat sent through the API is grounded in your brand profile automatically. To ground answers on your own documents, add sources via the Knowledge API first.

Chat consumes credits and counts against your plan’s rate limits. Handle 429 responses with backoff — see Errors & rate limits.