உரையாடல்களுக்கு 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
}'