چینی اوپن سورس AI ماڈلز کے لیے Anthropic Messages API کے مطابق اینڈ پوائنٹ، 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 | ضروری | مندرجہ ذیل فارمیٹ میں میسیج array |
max_tokens | integer | ضروری | آؤٹ پٹ ٹوکنز کی زیادہ سے زیادہ تعداد |
stream | boolean | اختیاری | سٹریمنگ رسپانس فعال کریں، SSE کے لیے true سیٹ کریں |
| پیرامیٹر | قسم | تفصیل |
|---|---|---|
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"}]
}'