v1

latestOpenAPI 3.1.0MIT2026-07-2614271305.9 KB

Qwen3.8-Max-Preview Chat API (Anthropic Messages-Compatible)

🚧 This model is not yet available, stay tuned

  • Call Qwen3.8-Max-Preview using the Anthropic Messages protocol
  • System prompt: set via the top-level system field (not inside messages)
  • Multimodal input: pass a content block array in content, supporting text / image
  • Context caching: add cache_control on a content block to declare explicit caching; see usage.cache_read_input_tokens / usage.cache_creation_input_tokens in the response for hit / creation
  • Thinking mode: enabled via thinking, thinking is returned as thinking content blocks in the stream
  • Streaming output: when stream=true, returned as Anthropic SSE events (message_start / content_block_delta / message_delta, etc.)
post/v1/messages

Request body

model'qwen3.8-max-preview' required

Chat model name

max_tokensinteger required

Maximum number of tokens to generate.

Required (per the Anthropic protocol). Generation will be truncated if the model exceeds this value.

temperaturenumber

Sampling temperature, range [0, 2].

top_pnumber

Nucleus sampling parameter, range (0, 1].

top_kinteger

Sample from the K tokens with the highest probability.

stop_sequencesstring[]

Custom stop sequences; generation stops when one is matched.

streamboolean

Whether to return an Anthropic SSE event stream.

Example request

{
  "model": "qwen3.8-max-preview",
  "max_tokens": 1024,
  "messages": [
    {
      "content": [
        {
          "source": {
            "media_type": "image/jpeg"
          }
        }
      ]
    }
  ],
  "system": [
    {
      "source": {
        "media_type": "image/jpeg"
      }
    }
  ]
}

Response

Generated successfully

idstring
typestring
rolestring
modelstring
stop_reasonstring

Stop reason: end_turn (normal completion), max_tokens (limit reached), stop_sequence (stop sequence matched), tool_use (a tool call is required)

Example response

{
  "id": "msg_xxxxxxxx",
  "type": "message",
  "role": "assistant",
  "model": "qwen3.8-max-preview",
  "content": [
    {
      "type": "text",
      "text": "Hello! I am Tongyi Qwen3.8-Max-Preview."
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 104
  }
}