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

# Chat

`POST /ai/chat`

## Request

- Base URL: `https://api.brickway.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.brickway.app/ai/chat`
- Auth: HTTP bearer

## Request body

- ChatRequest
  - `op_id` string, uuid, required: Client-minted turn id; the reserve idempotency key
  - `message` string, required
  - `household_id` string, uuid, nullable: The client's active household; grounds the turn in that collection's stats
  - `prior` ChatHistoryEntry[]: Recent text-only conversation context, oldest first
    - `role` 'user' | 'assistant', required
    - `text` string, required

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/brickway/apis/brickway-api.md) · [All operations](https://skmtc.dev/brickway/apis/brickway-api/llms.txt) · [OpenAPI document](https://skmtc.dev/brickway/apis/brickway-api/revisions/643a9d231869?raw)
