Verwende die OpenAI Chat Completions API für Konversationen. Dies ist das klassische OpenAI-Chat-API-Format.
/api/ai/v1/chat/completionsBearer YOUR_API_KEY| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
model | string | Erforderlich | Modellname, z. B. deepseek-v4.1-flash, qwen3.8-max |
messages | array | Erforderlich | Nachrichten-Array im Format |
max_tokens | integer | Optional | Maximale Anzahl der Ausgabe-Tokens |
temperature | float | Optional | Sampling-Temperatur, steuert die Zufälligkeit (0-2) |
stream | boolean | Optional | Streaming-Antwort aktivieren, für SSE auf true setzen |
| Parameter | Typ | Beschreibung |
|---|---|---|
id | string | Eindeutige Antwort-ID |
model | string | Tatsächlich verwendetes Modell |
choices | array | Array der Antwortoptionen, üblicherweise die erste verwenden |
usage | object | Token-Nutzungsstatistik |
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
}'