Çin açık kaynak AI modelleri için Anthropic Messages API uyumlu uç nokta, AI Gateway üzerinden.
/api/ai/v1/anthropic/messages| Parametre | Zorunlu | Açıklama |
|---|---|---|
Authorization | Zorunlu | Bearer YOUR_API_KEY |
anthropic-version | Zorunlu | Sabit değer 2023-06-01 |
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
model | string | Zorunlu | Model adı, örn. deepseek-v4.1-flash, qwen3.8-max |
messages | array | Zorunlu | Aşağıdaki formatta mesaj dizisi |
max_tokens | integer | Zorunlu | Maksimum çıktı token sayısı |
stream | boolean | İsteğe bağlı | Akış yanıtını etkinleştir, SSE için true olarak ayarlayın |
| Parametre | Tip | Açıklama |
|---|---|---|
id | string | Benzersiz yanıt tanımlayıcısı |
model | string | Kullanılan gerçek model |
content | string | Oluşturulan metin içeriği |
usage | object | Token kullanım istatistikleri |
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"}]
}'