Endpoint na katugma sa Anthropic Messages API para sa mga open-source AI model ng Tsina sa pamamagitan ng AI Gateway.
/api/ai/v1/anthropic/messages| Parameter | Kinakailangan | Paglalarawan |
|---|---|---|
Authorization | Kinakailangan | Bearer YOUR_API_KEY |
anthropic-version | Kinakailangan | Nakapirming value na 2023-06-01 |
| Parameter | Uri | Kinakailangan | Paglalarawan |
|---|---|---|---|
model | string | Kinakailangan | Pangalan ng model, hal. deepseek-v4.1-flash, qwen3.8-max |
messages | array | Kinakailangan | Array ng mga mensahe sa sumusunod na format |
max_tokens | integer | Kinakailangan | Pinakamataas na bilang ng output tokens |
stream | boolean | Opsyonal | I-enable ang streaming response, i-set sa true para sa SSE |
| Parameter | Uri | Paglalarawan |
|---|---|---|
id | string | Natatanging identifier ng response |
model | string | Aktwal na model na ginamit |
content | string | Nabuong text content |
usage | object | Mga istatistika ng paggamit ng token |
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"}]
}'