Usa OpenAI Responses API per le conversazioni. Responses API è il formato API OpenAI più recente con input più flessibile.
/api/ai/v1/responsesBearer YOUR_API_KEY| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
model | string | Obbligatorio | Nome del modello, ad es. deepseek-v4.1-flash, qwen3.8-max |
input | string | Obbligatorio | Testo di input o contenuto della conversazione |
max_tokens | integer | Opzionale | Numero massimo di token di output |
temperature | float | Opzionale | Temperatura di campionamento, controlla la casualità (0-2) |
stream | boolean | Opzionale | Abilita la risposta in streaming, imposta su true per SSE |
| Parametro | Tipo | Descrizione |
|---|---|---|
id | string | Identificatore univoco della risposta |
model | string | Modello effettivamente utilizzato |
output | string | Testo di output generato |
usage | object | Statistiche di utilizzo dei token, inclusi 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
}'