השתמש ב-OpenAI תגובות API לשיחות. תגובות 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 | אופציונלי | אפשר תגובה זורמת, הגדר ל-true ל-SSE |
| פרמטר | סוג | תיאור |
|---|---|---|
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
}'