Qwen
Qwen Anthropic Messages
Call Qwen models via the Anthropic Messages compatible endpoint, with support for vision input and extended thinking.
v1/messagesAuthorizations
sk-pat-YourAccessToken
API version, currently 2023-06-01
The key value is your HAI Gateway Personal Access Token (starting with sk-pat-). No separate API key from Alibaba Cloud is required.
Base URL
Body Parameters
The request body format is compatible with the Anthropic Messages API. For detailed parameter descriptions, refer to the Alibaba Cloud official documentation.
Anthropic Messages Channel Exclusively Supports VL Series
This endpoint supports vision models such as qwen3-vl-plus and thinking extended reasoning, but does not support the Long / Omni / Audio series.
The developer role is not supported
The OpenAI-compatible endpoint only accepts system / user / assistant roles. The Anthropic channel follows the official user / assistant conversation structure, with system messages passed via the top-level system field.
curl https://api.hai.network/compatible-preview/anthropic/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: sk-pat-YourAccessToken" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "qwen3-max",
"stream": true,
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Describe Hangzhou in one sentence"
}
]
}'