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

# Post message Gloo Chat

> Start or continue a chat session.

<Warning>
  **Deprecated Endpoint**: This endpoint is part of the Chat API which is deprecated.

  Please migrate to the [Completions v2 API](/api-guides/completions-v2) for new projects.

  **[Migration Guide →](/api-guides/migrating-from-chat-to-completions-v2)**
</Warning>

By providing `chat_id` a new message will be added to the chat session. If no `chat_id` is provided, a new chat session will be created.

Default behavior:

* Gloo AI will perform a sentiment analysis on your prompt.
* Gloo AI will provide suggestion follow ups
* Depending on your prompt, Gloo AI will return sources that have influenced the response from our trusted partners.

You can choose to override the defaults with the query params: `intent`, `enable_sources`, `enable_suggestions`.

**Example 1**:
You want a rich answer that is based on trusted sources and provides you follow up suggestions. Omit all query params.

**Example 2**:
You know that your prompt is going to require trusted sources as a part of the answer. You also want to not have follow up suggestions.
`intent`: 1, `enable_suggestions`: 0

**Example 3**:
You know that your prompt is not going to require trusted sources. You also want to not have follow up suggestions.
`intent`: 0, `enable_suggestions`: 0


## OpenAPI

````yaml post /ai/{v}/message/kallm
openapi: 3.1.0
info:
  title: AI API
  description: |-
    Optimized for high-speed inference and scalability by Gloo AI

    [Swagger UI](./docs) | [ReDoc UI](./redoc)
  version: 1.0.0
servers:
  - url: https://platform.ai.gloo.com
security:
  - bearerAuth: []
tags:
  - name: Content Controls
  - name: Data Engine
  - name: Ingestion & Enrichment
  - name: answers
  - name: chat
  - name: completions
  - name: content
  - name: core
  - name: data
  - name: get-models
  - name: ingestion
  - name: sotc
paths:
  /ai/{v}/message/kallm:
    post:
      tags:
        - chat
      summary: Post message KaLLM (deprecated)
      description: Post message KaLLM (deprecated).
      operationId: post-message-kallm
      parameters:
        - name: v
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/AvailableVersions'
        - name: chat_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: ''
            title: Chat Id
        - name: intent
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/IntentEnum'
              - type: 'null'
            title: Intent
        - name: enable_sources
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/EnableSourcesEnum'
              - type: 'null'
            default: 1
            title: Enable Sources
        - name: enable_suggestions
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/EnableSuggestionsEnum'
              - type: 'null'
            default: 1
            title: Enable Suggestions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostMessageRequestBody'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                title: Response Post-Message-Kallm
              example:
                query_id: q3c870f25-63fc-451f-a9ce-9a5abed55aa0
                message_id: mbc51c1d8-29e7-416f-85fc-9f4209d9887b
                message: My name is Gloo AI Chat, and I'm here to assist you!
                timestamp: '2025-02-04T23:55:03.573767'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: Failed to find chat
        '422':
          description: Unprocessable Entity
      deprecated: true
components:
  schemas:
    AvailableVersions:
      type: string
      enum:
        - v1
      title: AvailableVersions
    IntentEnum:
      type: integer
      enum:
        - 0
        - 1
      title: IntentEnum
    EnableSourcesEnum:
      type: integer
      enum:
        - 0
        - 1
        - 2
      title: EnableSourcesEnum
    EnableSuggestionsEnum:
      type: integer
      enum:
        - 0
        - 1
      title: EnableSuggestionsEnum
    PostMessageRequestBody:
      properties:
        chat_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Chat Id
          description: chat_id can also be provided as a query param
          default: ''
        query:
          type: string
          title: Query
          description: Chat with KALLM.
          default: What is your name?
        character_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Character Limit
          description: Limit the response length.
        sources_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sources Limit
          description: Limit the sources search.
          default: 10
        stream:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Stream
          description: Stream response as soon as tokens are generated by the model.
          default: false
        publishers:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          title: Publishers
          description: List of Publisher Names
          default: []
      type: object
      title: PostMessageRequestBody
    Error:
      type: object
      properties:
        detail:
          type: string
          description: A human-readable description of the error.
      title: Error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form Bearer `<token>`, where
        `<token>` is your [auth token](/studio/manage-api-credentials).

````