---
title: "Chat"
method: POST
path: "/chat"
tags: ["Messages"]
---

# Chat

`POST /chat`

## Request

- Base URL: `https://api.puppeteerai.com`
- URL: `https://api.puppeteerai.com/chat`
- Auth: none declared. Required headers: `Authorization`

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

## Headers

- `Authorization` string, required

## Request body

- ChatInput
  - `thread_id` string, required: The unique identifier for the thread you're sending a message in.
  - `message` string, required: The message sent by the user.
  - `streaming` boolean, nullable: Whether to stream the response back with HTTP streaming.
  - `puppeteer_config_name` string, required: The name of the Puppeteer project this thread belongs to.
  - `config_version_id` string, nullable
  - `start_new_conversation` boolean, nullable: Whether this message is the first in a new conversation inside the thread.
  - `simulate` SimulatedMessage
    - `initial_messages` string[], nullable
    - `max_turns` integer, nullable
    - `agent_type` string, nullable
    - `industry` string, nullable
    - `behavioural_prompt` string, nullable
    - `topic` string, nullable
    - `create` boolean, nullable
    - `evaluate` boolean, nullable
  - `user_type` string, nullable

## Response `200`

Successful Response

- ChatResponse
  - `message` string, required: The AI's response to the message.
  - `extras` ChatExtras, required
    - `user_message_id` string, nullable: ID of the created user message.
    - `conversation_id` integer, nullable: ID of the conversation.
    - `reply_message_id` string, nullable: ID of the AI reply message.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/getpuppeteer/apis/puppeteer-core-api.md) - [All operations](https://skmtc.dev/getpuppeteer/apis/puppeteer-core-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getpuppeteer/apis/puppeteer-core-api/revisions/94b4e928b42f?raw)
