Använd OpenAI Responses API för konversationer. Responses API är det senaste OpenAI API-formatet med mer flexibel indata.
/api/ai/v1/responsesBearer YOUR_API_KEY| Parameter | Typ | Obligatorisk | Beskrivning |
|---|---|---|---|
model | string | Obligatoriskt | Modellnamn, t.ex. deepseek-v4.1-flash, qwen3.8-max |
input | string | Obligatoriskt | Indatatext eller konversationsinnehåll |
max_tokens | integer | Valfritt | Maximalt antal utdata-tokens |
temperature | float | Valfritt | Samplingstemperatur, styr slumpmässighet (0-2) |
stream | boolean | Valfritt | Aktivera strömmande svar, sätt till true för SSE |
| Parameter | Typ | Beskrivning |
|---|---|---|
id | string | Unik identifierare för svaret |
model | string | Faktisk modell som användes |
output | string | Genererad textutdata |
usage | object | Statistik över tokenanvändning inklusive prompt_tokens, completion_tokens, total_tokens |
curl --location 'https://your-domain.com/api/ai/v1/responses' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"model": "deepseek-v4.1-flash",
"input": "Hello, who are you?",
"max_tokens": 1000,
"temperature": 0.7
}'import requests
response = requests.post(
"https://your-domain.com/api/ai/v1/responses",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
json={
"model": "deepseek-v4.1-flash",
"input": "Hello, who are you?",
"max_tokens": 1000,
"temperature": 0.7
}
)
print(response.json())curl --location 'https://your-domain.com/api/ai/v1/responses' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"model": "deepseek-v4.1-flash",
"input": "Hello",
"max_tokens": 1000,
"stream": true
}'