Chat
A multi‑model LLM chat. Conversations persist server‑side, and assistant replies stream back as Server‑Sent Events.
List models
GET
/v1/chat/models Public curl https://api-ocr.vanguardinitiative.com/v1/chat/models200 Available models
{
"status": "success",
"models": [
{ "id": "gpt-5", "provider": "openai", "label": "GPT-5" },
{ "id": "claude-sonnet-5", "provider": "anthropic", "label": "Claude Sonnet 5" }
]
}Create a conversation
POST
/v1/chat/conversations API key JSON body
title string | Optional conversation title. |
model string | Model id from /v1/chat/models. |
projectId uuid | Attach to a project. |
Send a message (streaming)
POST
/v1/chat/conversations/{id}/messages API key The response is a text/event-stream of tokens. If the connection drops mid‑reply,
reconnect with GET /v1/chat/conversations/{id}/stream (returns 204 when idle).
curl -N -X POST \
https://api-ocr.vanguardinitiative.com/v1/chat/conversations/$CONV_ID/messages \
-H "authorization: Bearer $API_KEY" \
-H 'content-type: application/json' \
-d '{"content":"Summarise this contract in Lao."}'const res = await fetch(
`https://api-ocr.vanguardinitiative.com/v1/chat/conversations/${convId}/messages`,
{
method: 'POST',
headers: {
authorization: 'Bearer ' + API_KEY,
'content-type': 'application/json',
},
body: JSON.stringify({ content: 'Summarise this contract in Lao.' }),
},
);
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)); // SSE chunks
}