API reference
Create chat completion
Sends a conversation to a model and returns its reply, in full or as a stream of server-sent events.
More about conversations, parameters and streaming under Chat completions.
curl https://api.danskllm.dk/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DANSKLLM_API_KEY" \
-d '{
"model": "muse-glimmer-30b",
"messages": [
{"role": "system", "content": "Du er en hjælpsom assistent."},
{"role": "user", "content": "Forklar kort, hvad en API-nøgle er."}
]
}'Authorizations
Your API key, which starts with dkllm-.
Body
application/jsonThe model id, for example muse-glimmer-30b.
The conversation so far.
Minimum array length: 1
Show child attributesHide child attributes
Available options: system, developer, user, assistant, tool
Show child attributesHide child attributes
Allowed value: "text"
In an earlier reply from the model: the functions it called.
Show child attributesHide child attributes
Allowed value: "function"
Show child attributesHide child attributes
The arguments, as a JSON string.
With role set to tool: the id of the call this message answers.
The most tokens the reply may have.
Same as max_tokens.
How much replies vary. Higher is more varied.
Nucleus sampling, an alternative to temperature.
Text that makes the model stop.
Makes replies more alike from one request to the next.
How many replies to generate. Each one is billed.
Required range: 1 <= x <= 4
How much the model thinks before it answers. What each value does depends on the model; see the model's page.
Available options: none, low, medium, high
Functions the model may call, in OpenAI's format. Only for models with tool calling; see the model's page.
Show child attributesHide child attributes
Allowed value: "function"
Show child attributesHide child attributes
The arguments, as a JSON Schema.
Whether the model may or must call a function, and which.
Show child attributesHide child attributes
Allowed value: "function"
Show child attributesHide child attributes
Whether the model may call several functions in one reply.
The form of the reply, for example {"type": "json_schema", ...} for JSON that follows a schema.
Send the reply as server-sent events while it is written.
Show child attributesHide child attributes
Add a final event with usage and an empty choices list before [DONE].
Response
stream set to true, a stream of chat.completion.chunk events that ends with data: [DONE].Allowed value: "chat.completion"
Show child attributesHide child attributes
stop when the reply is done, length when it hit max_tokens or the context window, tool_calls when the model calls functions.
Show child attributesHide child attributes
Allowed value: "assistant"
The answer. Empty when the model only calls functions.
The model's thinking, for models that think. Not part of OpenAI's API.
Show child attributesHide child attributes
Allowed value: "function"
Show child attributesHide child attributes
The arguments, as a JSON string.
Show child attributesHide child attributes
The tokens of the reply, thinking included.
Show child attributesHide child attributes
The part of the prompt that was read from the cache.