Local REST API for integration with your tools and workflows
http://localhost:5000/Returns a beautiful HTML documentation page with API status.
HTML page with API documentation and status
Check API status and currently loaded model.
{
"status": "ok",
"model": "phi-3-mini-4k-instruct.Q4_K_M.gguf",
"version": "1.0.0"
}
List all downloaded models available for use.
{
"object": "list",
"data": [
{
"id": "phi-3-mini-4k-instruct.Q4_K_M.gguf",
"object": "model",
"owned_by": "kairos-local"
}
]
}
Send a message and receive a complete response (non-streaming).
| Field | Type | Description |
|---|---|---|
messages |
array | Array of message objects with role and content |
curl -X POST http://localhost:5000/chat \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "Hello!" }
]
}'
{
"model": "phi-3-mini-4k-instruct.Q4_K_M.gguf",
"content": "Hello! How can I help you today?",
"token_count": 8
}
Send a message and receive a streaming response (Server-Sent Events).
Same as /chat
curl -X POST http://localhost:5000/chat/stream \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"Hello!"}]}'
data: {"content": "Hello"}
data: {"content": "!"}
data: {"content": " How"}
data: {"content": " can"}
data: [DONE]
{
"error": {
"message": "No model loaded. Please load a model first.",
"type": "invalid_request_error"
}
}
{
"error": {
"message": "Messages array is required",
"type": "invalid_request_error"
}
}