চীনা ওপেন-সোর্স AI মডেলের জন্য Anthropic Messages API সামঞ্জস্যপূর্ণ এন্ডপয়েন্ট, AI Gateway-এর মাধ্যমে।
/api/ai/v1/anthropic/messages| প্যারামিটার | আবশ্যক | বর্ণনা |
|---|---|---|
Authorization | আবশ্যক | Bearer YOUR_API_KEY |
anthropic-version | আবশ্যক | স্থির মান ২০২৩-০৬-০১ |
| প্যারামিটার | ধরন | আবশ্যক | বর্ণনা |
|---|---|---|---|
model | string | আবশ্যক | মডেলের নাম, উদাহরণ: deepseek-v4.1-flash, qwen3.8-max |
messages | 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"}]
}'