Chat API
Call the OpenAI-compatible chat-completions endpoint.
Chat API
The supported external surface is POST /api/v1/chat/completions. It uses
the OpenAI Chat Completions request and response shapes. The in-app /api/chat
route is an internal UI-message stream and is not the public SDK contract.
Authentication
Send a current Broomva bearer token. Anonymous requests are rejected. Tokens are issued only after current Terms, Privacy, processing-authorization, and age confirmation are recorded, and are invalidated when the policy manifest changes.
Authorization: Bearer <BROOMVA_API_TOKEN>
Content-Type: application/jsonRequest
{
"model": "claude-sonnet-4",
"messages": [
{ "role": "user", "content": "Explain event sourcing in three sentences." }
],
"stream": true
}| Field | Type | Required | Current behavior |
|---|---|---|---|
model | string | Yes | Must resolve in the deployed edge model registry |
messages | array | Yes | OpenAI-compatible message history |
stream | boolean | No | true returns OpenAI-compatible SSE; false returns JSON |
tools | array | No | OpenAI tool definitions; support depends on the deployed runtime |
A familiar provider model name is not proof that a backend is enabled.
Unsupported model IDs return a model error. Image inputs and n > 1
choices are not supported by this endpoint.
Response and errors
With stream: true, the response is OpenAI-compatible data: SSE chunks and
ends with data: [DONE]. With stream: false, the response is an OpenAI-style
chat-completion JSON object.
| Status | Meaning |
|---|---|
400 | Invalid request or unsupported model |
401 | Missing, expired, or stale-policy token |
403 | Current legal acceptance is required |
429 | Rate limit exceeded |
503 | Life gateway is not configured or available |
5xx | Runtime or upstream failure |
Model availability, tool support, limits, and credits depend on the deployed configuration and authenticated account. File attachments and generated-image storage are currently disabled pending private signed storage.