---
title: "Qwen3.8-Max-Preview Chat API (Anthropic Messages-Compatible)"
method: POST
path: "/v1/messages"
---

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

`POST /v1/messages`

> 🚧 **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.)

## Request body

- CreateMessageRequest
  - `model` 'qwen3.8-max-preview', required — Chat model name
  - `max_tokens` integer, required — Maximum number of tokens to generate. > **Required** (per the Anthropic protocol). Generation will be truncated if the model exceeds this value.
  - `messages` InputMessage[], required — List of conversation messages (excluding system). Each message contains a `role` (`user` / `assistant`) and `content` (a string or content block array).
    - `role` 'user' | 'assistant', required — Message role
    - `content` union, required — Message content. Pass a string for plain text; pass a content block array for multimodal input or explicit caching.
      - string
      - ContentBlock[]
        - `type` 'text' | 'image' | 'thinking' | 'tool_use' | 'tool_result', required — Content block type - `text`: text block - `image`: image block - `thinking`: thinking block (appears in responses) - `tool_use` / `tool_result`: tool call and result
        - `text` string — Text content when `type=text`
        - `source` object — Image source (when `type=image`). Supports JPEG / PNG / GIF / WEBP.
          - `type` 'url' | 'base64' — Source type: `url` (image link) or `base64` (inline data)
          - `url` string — Image link when `type=url`
          - `media_type` string — MIME type when `type=base64`, such as `image/jpeg`
          - `data` string — Base64 image data when `type=base64`
        - `cache_control` CacheControl — Explicit cache marker (prompt caching). The system uses this marker's position as the endpoint and traces backward to create / hit a cache block. - Minimum cacheable length **1024 tokens**, valid for **5 minutes** (reset on hit) - Up to **4** cache markers per request - See `usage.cache_read_input_tokens` in the response for hits and `usage.cache_creation_input_tokens` for creation
          - `type` 'ephemeral', required — Cache type, fixed to `ephemeral` (5-minute temporary cache)
  - `system` union — System prompt. Pass a string for plain text; pass a content block array (with `cache_control` on the block) when declaring explicit caching.
    - string
    - ContentBlock[]
      - `type` 'text' | 'image' | 'thinking' | 'tool_use' | 'tool_result', required — Content block type - `text`: text block - `image`: image block - `thinking`: thinking block (appears in responses) - `tool_use` / `tool_result`: tool call and result
      - `text` string — Text content when `type=text`
      - `source` object — Image source (when `type=image`). Supports JPEG / PNG / GIF / WEBP.
        - `type` 'url' | 'base64' — Source type: `url` (image link) or `base64` (inline data)
        - `url` string — Image link when `type=url`
        - `media_type` string — MIME type when `type=base64`, such as `image/jpeg`
        - `data` string — Base64 image data when `type=base64`
      - `cache_control` CacheControl — Explicit cache marker (prompt caching). The system uses this marker's position as the endpoint and traces backward to create / hit a cache block. - Minimum cacheable length **1024 tokens**, valid for **5 minutes** (reset on hit) - Up to **4** cache markers per request - See `usage.cache_read_input_tokens` in the response for hits and `usage.cache_creation_input_tokens` for creation
        - `type` 'ephemeral', required — Cache type, fixed to `ephemeral` (5-minute temporary cache)
  - `temperature` number — Sampling temperature, range `[0, 2]`.
  - `top_p` number — Nucleus sampling parameter, range `(0, 1]`.
  - `top_k` integer — Sample from the K tokens with the highest probability.
  - `stop_sequences` string[] — Custom stop sequences; generation stops when one is matched.
  - `stream` boolean — Whether to return an Anthropic SSE event stream.
  - `thinking` object — Deep thinking configuration. When enabled, the model returns its thinking process as `thinking` content blocks.
    - `type` 'enabled' | 'disabled' — Whether to enable deep thinking
  - `tools` Tool[] — List of tool definitions (Anthropic tools format) for Function Calling.
    - `type` 'web_search' | 'web_extractor' | 'code_interpreter' | 'function', required — Tool type
    - `name` string — Function name when `type=function`
    - `parameters` object — Parameter JSON Schema when `type=function`

## Response `200`

Generated successfully

- MessageResponse
  - `id` string
  - `type` string
  - `role` string
  - `model` string
  - `content` OutputContentBlock[] — Array of reply content blocks
    - `type` string — Content block type: `text` / `thinking` / `tool_use`
    - `text` string — Text content when `type=text`
  - `stop_reason` string — Stop reason: `end_turn` (normal completion), `max_tokens` (limit reached), `stop_sequence` (stop sequence matched), `tool_use` (a tool call is required)
  - `usage` AnthropicUsage — Token usage statistics (Anthropic semantics: `input_tokens` excludes cache and adds up mutually exclusively with the cache fields).
    - `input_tokens` integer — Number of input tokens (excluding the cached portion)
    - `output_tokens` integer — Number of output tokens (including thinking)
    - `cache_creation_input_tokens` integer — Number of tokens newly written to cache in this request (cache write)
    - `cache_read_input_tokens` integer — Number of tokens served from cache (cache read)

## Other responses

- `400` — Invalid request parameters
- `401` — Unauthenticated, invalid or expired token
- `402` — Insufficient balance
- `429` — Too many requests (rate limited)
- `500` — Internal server error

---

[API](https://skmtc.dev/evolink/apis/get-credits-usage-api.md) · [All operations](https://skmtc.dev/evolink/apis/get-credits-usage-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/evolink/get-credits-usage-api/revisions/88edb0ec881f/schema)
