बातचीत के लिए OpenAI Responses API का उपयोग करें। Responses API अधिक लचीले इनपुट वाला नवीनतम OpenAI API फ़ॉर्मेट है।
/api/ai/v1/responsesBearer YOUR_API_KEY| पैरामीटर | प्रकार | आवश्यक | विवरण |
|---|---|---|---|
model | string | आवश्यक | मॉडल का नाम, जैसे deepseek-v4.1-flash, qwen3.8-max |
input | string | आवश्यक | इनपुट टेक्स्ट या बातचीत की सामग्री |
max_tokens | integer | वैकल्पिक | आउटपुट टोकन की अधिकतम संख्या |
temperature | float | वैकल्पिक | सैंपलिंग टेम्परेचर, यादृच्छिकता नियंत्रित करता है (0-2) |
stream | boolean | वैकल्पिक | स्ट्रीमिंग प्रतिक्रिया सक्षम करें, SSE के लिए true सेट करें |
| पैरामीटर | प्रकार | विवरण |
|---|---|---|
id | string | अद्वितीय प्रतिक्रिया पहचानकर्ता |
model | string | वास्तव में उपयोग किया गया मॉडल |
output | string | जनरेट किया गया टेक्स्ट आउटपुट |
usage | object | टोकन उपयोग आँकड़े जिनमें 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
}'