/api/public/ai/chatBearer API keyMulti-turn conversation with routing, caching and failover.
| Field | Type | Required | Description |
|---|---|---|---|
| messages | Message[] | Yes | Ordered turns: { role: 'system' | 'user' | 'assistant', content: string }. |
| system | string | No | System instruction prepended to the conversation. |
| task | string | No | Routing hint — chat, reasoning, coding, extraction, summarisation. |
| temperature | number | No | 0–2. Defaults to the model profile. |
Request
curl https://zentechlimited.com/api/public/ai/chat \
-H "Authorization: Bearer $BEZ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task": "reasoning",
"messages": [
{ "role": "user", "content": "Summarise this quarter'"'"'s pipeline risk." }
]
}'Response
{
"data": {
"text": "Three deals carry 62% of forecast value…",
"model": "bez-reason-1",
"provider": "bez-self-hosted",
"usage": { "input_tokens": 412, "output_tokens": 188 }
}
}