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

# Chat Completion

> Send messages to a chat model and receive a response. Compatible with OpenAI Chat Completions protocol. Supports multi-turn conversations by providing message history.



## OpenAPI

````yaml /openapi-en.json post /v1/chat/completions
openapi: 3.0.3
info:
  title: WeryAI Generation API
  description: >
    WeryAI Open API provides AI-powered image and video generation capabilities.


    ## Authentication

    All API requests require Bearer token authentication:

    ```

    Authorization: Bearer YOUR_API_KEY

    ```


    ## Task Status

    Generation tasks are processed asynchronously. After submission, you'll
    receive a `task_id` to query the task status and results.


    Task status descriptions:

    - `waiting` - Waiting for processing

    - `processing` - In progress

    - `succeed` - Completed successfully

    - `failed` - Failed


    ## Webhook Callback

    If you provide a `webhook_url`, a POST request containing the task result
    will be sent to that address when the task is completed.
  version: 1.0.0
  contact:
    name: WeryAI Support
    url: https://weryai.com
    email: support@weryai.com
servers:
  - url: https://api.weryai.com
    description: Production Server
security: []
tags:
  - name: Image Generation
    description: Image generation related APIs
  - name: Image Tools
    description: Image editing and processing tool APIs
  - name: Video Generation
    description: Video generation related APIs
  - name: Podcast Generation
    description: Podcast generation related APIs
  - name: Chat
    description: Chat related APIs
  - name: Music Generation
    description: Music generation related APIs
  - name: Effect Template
    description: Effect template related APIs
  - name: File Upload
    description: File upload related APIs
  - name: Tasks
    description: Task query related APIs
  - name: Account
    description: Account related APIs
  - name: Video Tools
    description: Video processing and editing tools APIs
  - name: Audio Tools
    description: >-
      Audio processing and recognition tools APIs


      ## Voice Reference


      The following system voices are available for use with the `voice_id`
      parameter:


      ### English Voices


      | ID | Voice Name | Gender | Preview |

      |---|---|---|---|

      | 85 | Captivating Female | FEMALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/3987dd96b7ca46d94dd242cecf32663f.mp3)
      |

      | 84 | Playful Girl | FEMALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/cfdefca3904e8db50b05c35b0bbd5e45.mp3)
      |

      | 83 | Lovely Girl | FEMALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/2bea3739397fe4fb36346bf65e831d42.mp3)
      |

      | 82 | Cheerful Chloe | FEMALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/361f42d41f382276d2d64ec0e4851863.mp3)
      |

      | 81 | Wise Lady | FEMALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/df04fdbd3e78d00623b38dec086cf304.mp3)
      |

      | 75 | Southern Dude | MALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/b565f04d06b7a5f92d33f4edf8fee417.mp3)
      |

      | 74 | Lucky Robot | MALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/c663ca5b792ad462be53a429262eb974.mp3)
      |

      | 73 | Angry Pirate | MALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/dcc98bc48ce5cbc2c346878a0330acaa.mp3)
      |

      | 72 | Friendly Giant | MALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/54ba0fb660d8a7efac178ca7456a08a9.mp3)
      |

      | 71 | Man With Deep Voice | MALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/9493f3c864b5eabd18992cad528b67e5.mp3)
      |


      ### Chinese Voices


      | ID | Voice Name | Gender | Preview |

      |---|---|---|---|

      | 80 | Arrogant Miss | FEMALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/a84538991f639fb8b181d28af21c84eb.mp3)
      |

      | 79 | Kind-hearted Antie | FEMALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/00d27936559b4b35886c9e1060092227.mp3)
      |

      | 78 | Gentle Senior | FEMALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/ba07358a0a5027e7e74f2377137600a8.mp3)
      |

      | 77 | Intellectual Girl | FEMALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/091ae63f445f196f82571f6925ab8c5e.mp3)
      |

      | 76 | News Anchor | FEMALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/2b84f899ad50a01f3d3671ee55bed9d7.mp3)
      |

      | 70 | Stubborn Friend | MALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/18736aee7085e96d76b8755bf2ca181b.mp3)
      |

      | 69 | Reliable Executive | MALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/49e33c6f237fb98450ef2c1e1a30ec09.mp3)
      |

      | 68 | Lyrical Voice | MALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/bda4d4eb6bb331ec2e151eb3e1316bf1.mp3)
      |

      | 67 | Refreshing Young Man | MALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/f11374b6b82b1193f6429c3729420b1f.mp3)
      |

      | 66 | Pure-hearted Boy | MALE | [▶
      Preview](https://static.weryai.com/growth/audio/audio/4af3a0b6c87a04ec3b5ed096f1b56572.mp3)
      |
  - name: Deep Research
    description: Deep Research related APIs
paths:
  /v1/chat/completions:
    post:
      tags:
        - Chat
      summary: Chat Completion
      description: >-
        Send messages to a chat model and receive a response. Compatible with
        OpenAI Chat Completions protocol. Supports multi-turn conversations by
        providing message history.
      operationId: chatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatRequest'
            example:
              model: GEMINI_25_FLASH
              messages:
                - role: system
                  content: You are a helpful assistant.
                - role: user
                  content: What is artificial intelligence?
              max_tokens: 1024
              temperature: 1
              top_p: 1
              'n': 1
      responses:
        '200':
          description: Chat completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
              example:
                id: chatcmpl-abc123def456
                object: chat.completion
                created: 1711929600
                model: GEMINI_25_FLASH
                choices:
                  - index: 0
                    message:
                      role: assistant
                      content: >-
                        Artificial intelligence (AI) refers to the simulation of
                        human intelligence in machines...
                    finish_reason: stop
                usage:
                  prompt_tokens: 25
                  completion_tokens: 150
                  total_tokens: 175
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - BearerAuth: []
components:
  schemas:
    ChatRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          description: >-
            Chat model key. Use the `/v1/chat/models` endpoint to get available
            models.


            | Model Name | Model Key |

            | --- | --- |

            | GPT-5.6-Sol | GPT_5_6_SOL |

            | GPT-5.6-Terra | GPT_5_6_TERRA |

            | GPT-5.6-Luna | GPT_5_6_LUNA |

            | GPT-5.5 | GPT_5_5 |

            | GPT-5.4 | GPT_5_4 |

            | Claude-Fable-5 | CLAUDE_FABLE_5 |

            | Claude-4.8-Opus | CLAUDE_4_8_OPUS |

            | Claude-4.6-Opus | CLAUDE_4_6_OPUS |

            | Gemini-3.5-Flash | GEMINI_3_5_FLASH |

            | Gemini-3.1-Pro | GEMINI_3_1_PRO |

            | GPT-5.1 | GPT_5_1 |

            | Claude-4.5-Opus | CLAUDE_4_5_OPUS |

            | GPT-5 | GPT_5 |

            | DeepSeek-R1 | DEEPSEEK_R1 |

            | Kimi K2 Thinking | KIMI_K2_THINKING |

            | QwQ 32B | QWEN_QWQ_32B |

            | Grok-4 | GROK_4 |

            | Claude-Sonnet-4.6 | CLAUDE_SONNET_4_6 |

            | Gemini-3.1-Flash-Lite | GEMINI_3_1_FLASH_LITE |

            | Qwen3.5 Plus | QWEN_3_5_PLUS |

            | GLM 5 | GLM_5 |

            | Kimi K2.5 | KIMI_K2_5 |

            | Claude-Sonnet-4.5 | CLAUDE_SONNET_4_5 |

            | GPT-4o | GPT_4O |

            | GPT-4.1 | GPT_4_1 |

            | Gemini-2.5-Pro | GEMINI_25_PRO |

            | GLM 4.7 Flash | GLM_4_7_FLASH |

            | Gemini-2.5-Flash | GEMINI_25_FLASH |

            | Seed-2.0-Mini | SEED_2_0_MINI |

            | Claude-4-Opus | CLAUDE_4_OPUS |

            | Claude-4-Sonnet | CLAUDE_4_SONNET |
          example: GEMINI_25_FLASH
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ChatMessage'
          description: >-
            Message list for the conversation. Supports multi-turn by including
            history.
          minItems: 1
          maxItems: 50
          example:
            - role: user
              content: What is artificial intelligence?
        max_tokens:
          type: integer
          description: >-
            Maximum number of tokens to generate. Default 1024. The upper limit
            depends on the model (use the model list endpoint to check).
          default: 1024
          minimum: 1
          example: 1024
        temperature:
          type: number
          description: >-
            Controls randomness of the output. Higher values produce more
            diverse results.
          default: 1
          minimum: 0
          maximum: 2
          example: 1
        top_p:
          type: number
          description: >-
            Nucleus sampling parameter. Limits cumulative probability of
            candidate tokens.
          default: 1
          minimum: 0
          maximum: 1
          example: 1
        presence_penalty:
          type: number
          description: Penalizes new topics to reduce repetition
          minimum: -2
          maximum: 2
        frequency_penalty:
          type: number
          description: Penalizes frequent tokens to reduce repetition
          minimum: -2
          maximum: 2
        seed:
          type: integer
          description: >-
            Random seed. Same seed with same input produces deterministic
            results.
        'n':
          type: integer
          description: Number of responses to generate
          default: 1
          minimum: 1
          example: 1
        stream:
          type: boolean
          description: Whether to stream the response
          default: false
        reasoning_effort:
          type: string
          description: >-
            Controls how much reasoning effort the model spends before
            answering. Higher levels typically improve quality on complex tasks
            at the cost of higher latency and token usage.


            Supported values: `none`, `minimal`, `low`, `medium`, `high`,
            `xhigh`.


            Model notes:

            - **Gemini 3.x**: supports `none`, `minimal`, `low`, `medium`,
            `high`, `xhigh`; defaults to `medium`.

            - **GPT**: supports `none`, `minimal`, `low`, `medium`, `high`,
            `xhigh`. Defaults vary by version: GPT-5 defaults to `minimal`;
            GPT-5.1/5.2/5.4 default to `none`; GPT-5.5 defaults to `medium`;
            GPT-4o/4.1 are non-reasoning models and do not support this
            parameter.

            - **Claude**: supports `low`, `medium`, `high`; defaults to empty
            (no default).


            Whether a specific value takes effect depends on the selected model
            and upstream provider capabilities.
          enum:
            - none
            - minimal
            - low
            - medium
            - high
            - xhigh
          example: medium
        plugins:
          type: array
          description: >-
            Optional plugins for the chat request.


            ### Web Search


            Some models support web search. Whether web search takes effect
            depends on the selected model and upstream provider capabilities.
            Gemini models are currently integrated with Google Search; for other
            models, the `plugins` parameter is passed through and upstream
            support determines whether it works.


            Enable web search with:


            ```json

            {
              "plugins": [
                { "id": "web" }
              ]
            }

            ```


            Notes:

            - `plugins[].id = "web"` requests web search.

            - When Gemini models use web search, `response_format.type =
            "json_schema"` cannot be used at the same time.
          items:
            type: object
            required:
              - id
            properties:
              id:
                type: string
                description: Plugin identifier. Use `web` to request web search.
                example: web
          example:
            - id: web
    ChatCompletionResponse:
      type: object
      description: OpenAI-compatible Chat Completion response
      properties:
        id:
          type: string
          description: Unique identifier for the chat completion
          example: chatcmpl-abc123def456
        object:
          type: string
          description: Object type, always "chat.completion"
          example: chat.completion
        created:
          type: integer
          format: int64
          description: Unix timestamp (in seconds) of when the completion was created
          example: 1711929600
        model:
          type: string
          description: The model used for this completion
          example: GEMINI_25_FLASH
        choices:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionChoice'
          description: List of completion choices
        usage:
          $ref: '#/components/schemas/ChatUsage'
    ChatMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          description: >-
            The role of the message author. Supported values: `system`, `user`,
            `assistant`.
          example: user
        content:
          type: string
          description: The content of the message
          example: What is artificial intelligence?
    ChatCompletionChoice:
      type: object
      properties:
        index:
          type: integer
          description: Index of this choice in the list
          example: 0
        message:
          $ref: '#/components/schemas/ChatMessage'
        finish_reason:
          type: string
          description: The reason the model stopped generating. e.g., "stop", "length"
          example: stop
    ChatUsage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: Number of tokens in the prompt
          example: 25
        completion_tokens:
          type: integer
          description: Number of tokens in the completion
          example: 150
        total_tokens:
          type: integer
          description: Total number of tokens used
          example: 175
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          description: Business status code
          example: 1001
        desc:
          type: string
          description: Error description
          example: Parameter error
        message:
          type: string
          description: Error message
          example: Model does not exist
  responses:
    BadRequest:
      description: Parameter error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 1001
            desc: Parameter error
            message: Prompt cannot be empty
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 1002
            desc: Authentication failed
            message: Invalid API Key
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Authenticate using Bearer token. Get your API Key from the [WeryAI
        Console](https://weryai.com/api/keys).


        Example: `Authorization: Bearer sk-xxxxxxxxxxxxxxxx`

````