Endpoint kompatibilní s Anthropic Messages API pro čínské open-source AI modely přes AI Gateway.
/api/ai/v1/anthropic/messages| Parametr | Povinné | Popis |
|---|---|---|
Authorization | Povinné | Bearer YOUR_API_KEY |
anthropic-version | Povinné | Pevně stanovená hodnota 2023-06-01 |
| Parametr | Typ | Povinné | Popis |
|---|---|---|---|
model | string | Povinné | Název modelu, např. deepseek-v4.1-flash, qwen3.8-max |
messages | array | Povinné | Pole zpráv ve formátu |
max_tokens | integer | Povinné | Maximální počet výstupních tokenů |
stream | boolean | Volitelné | Povolit streamování odpovědi, nastavte true pro SSE |
| Parametr | Typ | Popis |
|---|---|---|
id | string | Jedinečný identifikátor odpovědi |
model | string | Použitý model |
content | string | Vygenerovaný textový obsah |
usage | object | Statistiky použití 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"}]
}'