Examples and SDKsDraft
Examples
Build a request and copy it in curl, JavaScript or Python.
Draft
The hosted API is a planned service with a draft specification. The local API described alongside it already exists and runs on your own machine.
Every example reads the key from the KOLDOS_API_KEY environment variable. Adjust the parameters and copy the request.
Target
Runs on your computer with koldos serve. This request works today against a running KOLDOS.
Sent as the user message. KOLDOS runs one turn for it.
temperature, max_tokens, top_p are accepted and ignored. KOLDOS sets its own budgets for every turn.
curl http://127.0.0.1:8128/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "koldos",
"messages": [
{
"role": "user",
"content": "Explain what the function main does in src/app.py."
}
]
}'This page never sends requests or asks for a key. Run the snippet from your own environment.
List the models your key can use
GET
/v1/modelsReturns the models your API key can call, with their current status.curl /models \
-H "Authorization: Bearer $KOLDOS_API_KEY"{
"object": "list",
"data": [
{
"id": "koldos-7b",
"object": "model",
"status": "available"
},
{
"id": "koldos-22b",
"object": "model",
"status": "future"
}
]
}