Send chat message
/api/chat/messagesAsk a question; the reply streams back as server-sent events. Events: conversation {id, title, updatedAt}, sent again at the end when the model named it; message for each stored message, the question first; text {text} as the reply is written; tool {callId, name, label} as a tool starts; done {outcome, error} last. Refused before streaming with 400 for an empty or too long message, 404 for a conversation or message that is not yours, 409 when Chat is off or the conversation is full, and 429 when a spend limit is reached.
Needs the UseAiChat permission.
An API key, made on Settings, API keys. Every key starts with mbk_.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/api/chat/messages" \ -H "Content-Type: application/json" \ -d '{ "conversationId": null, "text": null, "replaceMessageId": null, "retryAfterMessageId": null }'Get conversation spend GET
What this conversation has used and cost, every version of it included. Needs the `UseAiChat` permission.
Brief me on an instance POST
A summary, written by the Chat model, of what the audit log recorded in one instance: the newest 100 entries the instance popup's Activity tab shows you, in one call with no tools. Each line of `text` ends with the entry ids it rests on, in square brackets; `sources` lists the cited ids that were among the entries sent, and `builtFrom` says what it was built from. No opinions, recommendations, scores or reasons. Needs AI on, Chat on and AI briefs on (Settings → AI → Chat), and Use AI chat, See analytics and See the audit log. Counted, limited and logged as a Chat call; the call log keeps what was sent and what came back. With nothing recorded the model is not asked and `text` is null. 409 when briefs are off or AI is not set up, 429 at a spend limit or the monthly allowance, 502 when the provider did not answer. Needs the `ViewAnalytics` and `ViewAuditLog` and `UseAiChat` permissions.