נקודת קצה התומכת ב-Anthropic Messages API למודלי AI קוד פתוח סיני דרך AI Gateway.
/api/ai/v1/anthropic/messages| פרמטר | חובה | תיאור |
|---|---|---|
Authorization | חובה | Bearer YOUR_API_KEY |
anthropic-version | חובה | ערך קבוע 2023-06-01 |
| פרמטר | סוג | חובה | תיאור |
|---|---|---|---|
model | string | חובה | שם המודל, לדוגמה deepseek-v4.1-flash, qwen3.8-max |
messages | array | חובה | מערך הודעות בפורמט הבא |
max_tokens | integer | חובה | מספר מקסימלי של טוקנים בפלט |
stream | boolean | אופציונלי | אפשר תגובה זורמת, הגדר ל-true עבור SSE |
| פרמטר | סוג | תיאור |
|---|---|---|
id | string | מזהה ייחודי של תגובה |
model | string | המודל בפועל שהושתמש בו |
content | string | תוכן הטקסט שנוצר |
usage | object | סטטיסטיקות שימוש בטוקנים |
curl --location 'https://your-domain.com/api/ai/v1/anthropic/messages' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'anthropic-version: 2023-06-01' \
--data '{
"model": "deepseek-v4.1-flash",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello, who are you?"}
]
}'import requests
response = requests.post(
"https://your-domain.com/api/ai/v1/anthropic/messages",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
"anthropic-version": "2023-06-01"
},
json={
"model": "deepseek-v4.1-flash",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello, who are you?"}
]
}
)
print(response.json())curl --location 'https://your-domain.com/api/ai/v1/anthropic/messages' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'anthropic-version: 2023-06-01' \
--data '{
"model": "deepseek-v4.1-flash",
"max_tokens": 1024,
"stream": true,
"messages": [{"role": "user", "content": "Hello"}]
}'