> ## Documentation Index
> Fetch the complete documentation index at: https://docs.powertokens.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# qwen3-max 对话补全

> 适用于阿里渠道最终白名单中的公开对话模型：`qwen3-max`。

公开字段：`model`、`messages`、`stream`、`temperature`、`top_p`、`max_tokens`、`stop`、`seed`、`tools`、`tool_choice`、`enable_search`、`response_format`。



## OpenAPI

````yaml api-reference/zh-Hans/zmodelChat/ali/qwen3-max.json POST /v1/chat/completions
openapi: 3.0.1
info:
  title: qwen3-max 对话补全
  version: 1.0.0
  description: 阿里对话能力文档。公开统一入口为 `/v1/chat/completions`，仅覆盖当前渠道最终白名单中的公开对话模型。
  license:
    name: Project License
    url: https://github.com/QuantumNous/new-api/blob/main/LICENSE
servers:
  - url: https://api.powertokens.ai
    description: Baze API 服务地址
security: []
tags:
  - name: Qwen Chat
    description: 千问系列对话能力
paths:
  /v1/chat/completions:
    post:
      tags:
        - Qwen Chat
      summary: qwen3-max 对话补全
      description: >-
        适用于阿里渠道最终白名单中的公开对话模型：`qwen3-max`。


        公开字段：`model`、`messages`、`stream`、`temperature`、`top_p`、`max_tokens`、`stop`、`seed`、`tools`、`tool_choice`、`enable_search`、`response_format`。
      operationId: aliChatCompletions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              text_chat:
                summary: 纯文本对话
                value:
                  model: qwen3-max
                  messages:
                    - role: system
                      content: 你是一个有帮助的助手。
                    - role: user
                      content: 你好，请介绍一下自己。
                  temperature: 0.7
                  max_tokens: 2000
              streaming_chat:
                summary: 流式输出
                value:
                  model: qwen3-max
                  messages:
                    - role: user
                      content: 讲一个短故事。
                  stream: true
      responses:
        '200':
          description: 调用成功，返回对话补全结果。流式模式下返回 SSE 流。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
        '400':
          description: 请求参数不合法。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_request:
                  summary: 参数错误
                  value:
                    error:
                      message: messages is required
                      type: invalid_request_error
                      code: bad_request_body
                      param: messages
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: 未授权
                  value:
                    error:
                      message: 无效的令牌
                      type: api_error
                      code: access_denied
                      param: ''
          description: 鉴权失败，例如未提供令牌或令牌无效。
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                quota_exceeded:
                  summary: 额度不足或速率受限
                  value:
                    error:
                      message: 当前账户额度不足，请稍后重试
                      type: api_error
                      code: insufficient_user_quota
                      param: ''
          description: 触发速率限制或账户额度不足。
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal_error:
                  summary: 内部处理失败
                  value:
                    error:
                      message: 服务内部处理失败，请稍后重试
                      type: api_error
                      code: gen_relay_info_failed
                      param: ''
          description: 服务端处理请求时发生内部错误。
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                bad_gateway:
                  summary: 上游响应异常
                  value:
                    error:
                      message: 上游服务返回了无效响应
                      type: api_error
                      code: bad_response_status_code
                      param: ''
          description: 上游服务返回异常响应。
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                service_unavailable:
                  summary: 服务暂不可用
                  value:
                    error:
                      message: 当前模型暂时无可用渠道，请稍后重试
                      type: api_error
                      code: get_channel_failed
                      param: ''
          description: 上游服务暂不可用，或当前模型暂无可用渠道。
      security:
        - BearerAuth: []
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          enum:
            - qwen3-max
          description: 模型名称。仅支持当前阿里渠道最终白名单中的公开对话模型。
          example: qwen3.6-plus
        messages:
          type: array
          description: 对话消息列表。支持文本内容。
          items:
            $ref: '#/components/schemas/Message'
        stream:
          type: boolean
          description: 是否使用流式输出。默认为 false。
          default: true
        temperature:
          type: number
          description: 采样温度，控制输出随机性。取值范围 [0, 2]。
          minimum: 0
          maximum: 2
          default: 0.7
        top_p:
          type: number
          description: 核采样概率阈值。
          minimum: 0
          maximum: 1
          default: 0.95
        max_tokens:
          type: integer
          description: 生成的最大 token 数。
          minimum: 1
        stop:
          type: array
          description: 停止词列表。
          items:
            type: string
        seed:
          type: integer
          description: 随机数种子，用于复现生成结果。
        tools:
          type: array
          description: 工具列表，用于 Function Calling。
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          type: string
          description: 工具选择策略。可选值：auto、none、required。
        enable_search:
          type: boolean
          description: 是否启用搜索增强功能。仅部分模型支持。
        response_format:
          type: object
          description: 响应格式，用于强制模型输出 JSON。
          properties:
            type:
              type: string
              enum:
                - text
                - json_object
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: 响应唯一标识。
        object:
          type: string
          example: chat.completion
        created:
          type: integer
          format: int64
          description: 创建时间的 Unix 时间戳（秒）。
        model:
          type: string
          description: 使用的模型名称。
        choices:
          type: array
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              description: 错误类型，例如 `invalid_request_error`、`api_error` 或上游兼容错误类型。
            code:
              type: string
    Message:
      type: object
      required:
        - role
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
            - tool
          description: 消息发送者角色。
        content:
          type: string
          description: 文本内容。
        tool_calls:
          type: array
          description: 工具调用信息。
          items:
            type: object
    Tool:
      type: object
      properties:
        type:
          type: string
          enum:
            - function
        function:
          type: object
          properties:
            name:
              type: string
              description: 函数名称。
            description:
              type: string
              description: 函数描述。
            parameters:
              type: object
              description: 函数参数定义（JSON Schema）。
    Choice:
      type: object
      properties:
        index:
          type: integer
        message:
          $ref: '#/components/schemas/Message'
        finish_reason:
          type: string
          description: 生成结束原因。可能的值：stop、length、tool_calls、content_filter、null。
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: 输入 token 数量。
        completion_tokens:
          type: integer
          description: 输出 token 数量。
        total_tokens:
          type: integer
          description: 总 token 数量。
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: '在请求头中传入 `Authorization: Bearer <token>`。'

````