Use a API OpenAI Responses para conversas. A API Responses é o formato mais recente da API OpenAI, com entrada mais flexível.
/api/ai/v1/responsesBearer YOUR_API_KEY| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
model | string | Obrigatório | Nome do modelo, p. ex. deepseek-v4.1-flash, qwen3.8-max |
input | string | Obrigatório | Texto de entrada ou conteúdo da conversa |
max_tokens | integer | Opcional | Número máximo de tokens de saída |
temperature | float | Opcional | Temperatura de amostragem, controla a aleatoriedade (0-2) |
stream | boolean | Opcional | Ativar resposta em streaming, defina como true para SSE |
| Parâmetro | Tipo | Descrição |
|---|---|---|
id | string | Identificador único da resposta |
model | string | Modelo realmente utilizado |
output | string | Saída de texto gerada |
usage | object | Estatísticas de uso de tokens, incluindo 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
}'