> ## 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 Chat Completions

> Applicable to the publicly available chat model in the Ali channel's final whitelist: `qwen3-max`.

Supported fields: `model`, `messages`, `stream`, `temperature`, `top_p`, `max_tokens`, `stop`, `seed`, `tools`, `tool_choice`, `enable_search`, `response_format`.



## OpenAPI

````yaml api-reference/en/zmodelChat/ali/qwen3-max.json POST /v1/chat/completions
openapi: 3.0.1
info:
  title: qwen3-max Chat Completions
  version: 1.0.0
  description: >-
    Ali chat capability documentation. The unified API endpoint is
    `/v1/chat/completions`, covering only the publicly available chat models in
    the current channel's final whitelist.
  license:
    name: Project License
    url: https://github.com/QuantumNous/new-api/blob/main/LICENSE
servers:
  - url: https://api.powertokens.ai
    description: Baze API server endpoint
security: []
tags:
  - name: Qwen Chat
    description: Qwen series chat capability
paths:
  /v1/chat/completions:
    post:
      tags:
        - Qwen Chat
      summary: qwen3-max Chat Completions
      description: >-
        Applicable to the publicly available chat model in the Ali channel's
        final whitelist: `qwen3-max`.


        Supported fields: `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: Text chat
                value:
                  model: qwen3-max
                  messages:
                    - role: system
                      content: You are a helpful assistant.
                    - role: user
                      content: Hello, please introduce yourself.
                  temperature: 0.7
                  max_tokens: 2000
              streaming_chat:
                summary: Streaming output
                value:
                  model: qwen3-max
                  messages:
                    - role: user
                      content: Tell me a short story.
                  stream: true
      responses:
        '200':
          description: >-
            Success. Returns the chat completion result. In streaming mode,
            returns an SSE stream.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_request:
                  summary: Parameter error
                  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: Unauthorized
                  value:
                    error:
                      message: Invalid token
                      type: api_error
                      code: access_denied
                      param: ''
          description: Authentication failed, e.g. missing or invalid token.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                quota_exceeded:
                  summary: Insufficient quota or rate limited
                  value:
                    error:
                      message: Insufficient account quota, please retry later
                      type: api_error
                      code: insufficient_user_quota
                      param: ''
          description: Rate limit triggered or insufficient account quota.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal_error:
                  summary: Internal processing failure
                  value:
                    error:
                      message: Internal processing failed, please retry later
                      type: api_error
                      code: gen_relay_info_failed
                      param: ''
          description: Internal server error while processing the request.
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                bad_gateway:
                  summary: Abnormal upstream response
                  value:
                    error:
                      message: The upstream provider returned an invalid response
                      type: api_error
                      code: bad_response_status_code
                      param: ''
          description: The upstream provider returned an abnormal response.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                service_unavailable:
                  summary: Service temporarily unavailable
                  value:
                    error:
                      message: >-
                        No available channel for the current model, please retry
                        later
                      type: api_error
                      code: get_channel_failed
                      param: ''
          description: >-
            Upstream provider temporarily unavailable, or no available channel
            for the current model.
      security:
        - BearerAuth: []
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          enum:
            - qwen3-max
          description: >-
            Model name. Only publicly available chat models in the current Ali
            channel's final whitelist are supported.
          example: qwen3-max
        messages:
          type: array
          description: List of conversation messages. Supports text content.
          items:
            $ref: '#/components/schemas/Message'
        stream:
          type: boolean
          description: Whether to use streaming output. Defaults to false.
          default: true
        temperature:
          type: number
          description: Sampling temperature, controls output randomness. Range [0, 2].
          minimum: 0
          maximum: 2
          default: 0.7
        top_p:
          type: number
          description: Nucleus sampling probability threshold.
          minimum: 0
          maximum: 1
          default: 0.95
        max_tokens:
          type: integer
          description: Maximum number of tokens to generate.
          minimum: 1
        stop:
          type: array
          description: List of stop sequences.
          items:
            type: string
        seed:
          type: integer
          description: Random seed for reproducible generation results.
        tools:
          type: array
          description: List of tools for Function Calling.
          items:
            $ref: '#/components/schemas/Tool'
        tool_choice:
          type: string
          description: 'Tool selection strategy. Possible values: auto, none, required.'
        enable_search:
          type: boolean
          description: >-
            Whether to enable search-augmented generation. Only supported by
            some models.
        response_format:
          type: object
          description: Response format, used to force the model to output JSON.
          properties:
            type:
              type: string
              enum:
                - text
                - json_object
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique response identifier.
        object:
          type: string
          example: chat.completion
        created:
          type: integer
          format: int64
          description: Creation time as a Unix timestamp (seconds).
        model:
          type: string
          description: Model name used.
        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: >-
                Error type, e.g. `invalid_request_error`, `api_error`, or
                upstream-compatible error types.
            code:
              type: string
    Message:
      type: object
      required:
        - role
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
            - tool
          description: Role of the message sender.
        content:
          type: string
          description: Text content.
        tool_calls:
          type: array
          description: Tool call information.
          items:
            type: object
    Tool:
      type: object
      properties:
        type:
          type: string
          enum:
            - function
        function:
          type: object
          properties:
            name:
              type: string
              description: Function name.
            description:
              type: string
              description: Function description.
            parameters:
              type: object
              description: Function parameter definitions (JSON Schema).
    Choice:
      type: object
      properties:
        index:
          type: integer
        message:
          $ref: '#/components/schemas/Message'
        finish_reason:
          type: string
          description: >-
            Reason for generation completion. Possible values: stop, length,
            tool_calls, content_filter, null.
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: Number of input tokens.
        completion_tokens:
          type: integer
          description: Number of output tokens.
        total_tokens:
          type: integer
          description: Total number of tokens.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Pass `Authorization: Bearer <token>` in the request header.'

````