Endpoints
Chat completions
POSThttps://api.dheep.co.za/v1/chat/completions
Parameters
Request
json
{
"model": "dheep-chat",
"messages": [
{ "role": "system", "content": "You are a concise assistant." },
{ "role": "user", "content": "Summarise the POPIA in two sentences." }
],
"temperature": 0.4,
"max_tokens": 300
}Response
json
{
"id": "chatcmpl_3f9a2c",
"object": "chat.completion",
"created": 1735689600,
"model": "dheep-chat",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "..." },
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 42,
"completion_tokens": 118,
"total_tokens": 160
}
}The usage block is what the portal charges against your monthly allowance.
Streaming
Set stream: true to receive server-sent events. Each event contains a delta; the stream ends with data: [DONE].
text
data: {"choices":[{"delta":{"content":"The"},"index":0}]}
data: {"choices":[{"delta":{"content":" POPIA"},"index":0}]}
data: [DONE]