Gebruik de OpenAI Chat Completions API voor gesprekken. Dit is het klassieke OpenAI chat API-formaat.
/api/ai/v1/chat/completionsBearer YOUR_API_KEY| Parameter | Type | Vereist | Beschrijving |
|---|---|---|---|
model | string | Vereist | Modelnaam, bijv. deepseek-v4.1-flash, qwen3.8-max |
messages | array | Vereist | Messages-array in de volgende indeling |
max_tokens | integer | Optioneel | Maximaal aantal outputtokens |
temperature | float | Optioneel | Samplingtemperatuur, bepaalt de willekeurigheid (0-2) |
stream | boolean | Optioneel | Streamingrespons inschakelen, stel in op true voor SSE |
| Parameter | Type | Beschrijving |
|---|---|---|
id | string | Unieke response-identifier |
model | string | Daadwerkelijk gebruikt model |
choices | array | Array van responsekeuzes, meestal de eerste gebruiken |
usage | object | Statistieken van tokengebruik |
curl --location 'https://your-domain.com/api/ai/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"model": "deepseek-v4.1-flash",
"messages": [
{"role": "user", "content": "Hello, who are you?"}
],
"max_tokens": 1000,
"temperature": 0.7
}'import requests
response = requests.post(
"https://your-domain.com/api/ai/v1/chat/completions",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
json={
"model": "deepseek-v4.1-flash",
"messages": [
{"role": "user", "content": "Hello, who are you?"}
],
"max_tokens": 1000,
"temperature": 0.7
}
)
print(response.json())curl --location 'https://your-domain.com/api/ai/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"model": "deepseek-v4.1-flash",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 1000,
"stream": true
}'