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

# Search Chats

> Search for chat sessions based on the provided query.
If no query is provided, returns recent chat sessions.



## OpenAPI

````yaml GET /chat/search
openapi: 3.1.0
info:
  title: Onyx API
  description: Onyx API for AI-powered enterprise search and chat
  version: Development
servers:
  - url: https://cloud.onyx.app/api
security: []
paths:
  /chat/search:
    get:
      tags:
        - public
      summary: Search Chats
      description: |-
        Search for chat sessions based on the provided query.
        If no query is provided, returns recent chat sessions.
      operationId: search_chats
      parameters:
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Query
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
            title: Page
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            default: 10
            title: Page Size
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    ChatSearchResponse:
      properties:
        groups:
          items:
            $ref: '#/components/schemas/ChatSessionGroup'
          type: array
          title: Groups
        has_more:
          type: boolean
          title: Has More
        next_page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Next Page
      type: object
      required:
        - groups
        - has_more
      title: ChatSearchResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChatSessionGroup:
      properties:
        title:
          type: string
          title: Title
        chats:
          items:
            $ref: '#/components/schemas/ChatSessionSummary'
          type: array
          title: Chats
      type: object
      required:
        - title
        - chats
      title: ChatSessionGroup
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ChatSessionSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        persona_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Persona Id
        time_created:
          type: string
          format: date-time
          title: Time Created
        shared_status:
          $ref: '#/components/schemas/ChatSessionSharedStatus'
        current_alternate_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Current Alternate Model
        current_temperature_override:
          anyOf:
            - type: number
            - type: 'null'
          title: Current Temperature Override
      type: object
      required:
        - id
        - time_created
        - shared_status
      title: ChatSessionSummary
    ChatSessionSharedStatus:
      type: string
      enum:
        - public
        - private
      title: ChatSessionSharedStatus
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Authorization header with Bearer token

````