Get started
Quickstart
From API key to first answer in a few minutes.
1
Create an API key
Log in to the platform and create a key under API-nøgler (API keys). The key is shown only once, so store it somewhere safe. The account needs credit. The balance is under Oversigt (Overview) on the platform.
2
Store the key in an environment variable
The examples read the key from DANSKLLM_API_KEY, so it stays out of your code.
export DANSKLLM_API_KEY="dkllm-..."3
Install OpenAI's SDK
cURL needs no installation.
pip install openai4
Send your first request
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."}
]
}'Stream the answer
Set stream to true to get the answer while the model writes it.
curl -N 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": "user", "content": "Skriv et kort digt om København."}],
"stream": true
}'