گفتگو کے لیے 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
}'