Gamitin ang OpenAI Responses API para sa mga pag-uusap. Ang Responses API ang pinakabagong format ng OpenAI API na may mas flexible na input.
/api/ai/v1/responsesBearer YOUR_API_KEY| Parameter | Uri | Kinakailangan | Paglalarawan |
|---|---|---|---|
model | string | Kinakailangan | Pangalan ng modelo, hal. deepseek-v4.1-flash, qwen3.8-max |
input | string | Kinakailangan | Input na teksto o nilalaman ng pag-uusap |
max_tokens | integer | Opsyonal | Pinakamataas na bilang ng output tokens |
temperature | float | Opsyonal | Sampling temperature, kinokontrol ang randomness (0-2) |
stream | boolean | Opsyonal | I-enable ang streaming response, itakda sa true para sa SSE |
| Parameter | Uri | Paglalarawan |
|---|---|---|
id | string | Natatanging identifier ng tugon |
model | string | Aktwal na modelong ginamit |
output | string | Nabuong text output |
usage | object | Mga istatistika ng paggamit ng token kabilang ang 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
}'