Anthropic-Messages-API-kompatibler Endpunkt für chinesische Open-Source-KI-Modelle über AI Gateway.
/api/ai/v1/anthropic/messages| Parameter | Erforderlich | Beschreibung |
|---|---|---|
Authorization | Erforderlich | Bearer YOUR_API_KEY |
anthropic-version | Erforderlich | Fester Wert 2023-06-01 |
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
model | string | Erforderlich | Modellname, z. B. deepseek-v4.1-flash, qwen3.8-max |
messages | array | Erforderlich | Nachrichten-Array im Format |
max_tokens | integer | Erforderlich | Maximale Anzahl der Ausgabe-Tokens |
stream | boolean | Optional | Streaming-Antwort aktivieren, für SSE auf true setzen |
| Parameter | Typ | Beschreibung |
|---|---|---|
id | string | Eindeutige Antwort-ID |
model | string | Tatsächlich verwendetes Modell |
content | string | Generierter Textinhalt |
usage | object | Token-Nutzungsstatistik |
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"}]
}'