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

# Chat

> Send a user message to a thread and get back an AI response.



## OpenAPI

````yaml /api-reference/openapi.json post /chat
openapi: 3.1.0
info:
  title: Puppeteer Core API
  description: >-
    Core API for the Puppeteer AI platform. Manages domain models,
    conversations, voice calls, simulations, and integrations.


    [Documentation](https://docs.puppeteerai.com)
  version: 1.0.0
servers:
  - url: https://api.puppeteerai.com
    description: Production
security: []
tags:
  - name: Auth
    description: JWT token generation and organization creation.
  - name: Messages
    description: >-
      Send and receive messages, retrieve conversation history, search, and
      create messages in threads.
  - name: Threads
    description: Create and manage threads, aliases, scheduled events, and bulk operations.
  - name: Voice
    description: Voice call handling, scheduling, batch calls, and WebSocket LLM.
paths:
  /chat:
    post:
      tags:
        - Messages
      summary: Chat
      description: Send a user message to a thread and get back an AI response.
      operationId: chat_chat_post
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatInput'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ChatInput:
      properties:
        thread_id:
          type: string
          title: Thread Id
          description: The unique identifier for the thread you're sending a message in.
        message:
          type: string
          title: Message
          description: The message sent by the user.
        streaming:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Streaming
          description: Whether to stream the response back with HTTP streaming.
          default: false
        puppeteer_config_name:
          type: string
          title: Puppeteer Config Name
          description: The name of the Puppeteer project this thread belongs to.
        config_version_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Config Version Id
        start_new_conversation:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Start New Conversation
          description: >-
            Whether this message is the first in a new conversation inside the
            thread.
          default: false
        simulate:
          anyOf:
            - $ref: '#/components/schemas/SimulatedMessage'
            - type: 'null'
        user_type:
          anyOf:
            - type: string
            - type: 'null'
          title: User Type
      type: object
      required:
        - thread_id
        - message
        - puppeteer_config_name
      title: ChatInput
    ChatResponse:
      properties:
        message:
          type: string
          title: Message
          description: The AI's response to the message.
        extras:
          $ref: '#/components/schemas/ChatExtras'
          description: Metadata about the created messages and conversation.
      type: object
      required:
        - message
        - extras
      title: ChatResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SimulatedMessage:
      properties:
        initial_messages:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Initial Messages
        max_turns:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Turns
        agent_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Type
        industry:
          anyOf:
            - type: string
            - type: 'null'
          title: Industry
        behavioural_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Behavioural Prompt
        topic:
          anyOf:
            - type: string
            - type: 'null'
          title: Topic
        create:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Create
          default: false
        evaluate:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Evaluate
          default: false
      type: object
      title: SimulatedMessage
    ChatExtras:
      properties:
        user_message_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Message Id
          description: ID of the created user message.
        conversation_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Conversation Id
          description: ID of the conversation.
        reply_message_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Reply Message Id
          description: ID of the AI reply message.
      additionalProperties: true
      type: object
      title: ChatExtras
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````