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

# Chat Endpoint

`POST /chat`

## Request

- Base URL: `https://api.agent4.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.agent4.io/chat`
- Auth: none declared

## Request body

- ChatIn
  - `message` string
  - `session_id` string, nullable
  - `k` integer, nullable
  - `agent` string, nullable
  - `images` string[], nullable
  - `files` object[], nullable
  - `audio` string, nullable
  - `client_pubkey` string, nullable
  - `viewing_report` string, nullable

## Response `200`

Successful Response

- ChatOut
  - `session_id` string, required
  - `reply` string, required
  - `sources` Source[], required
    - `document_id` string, required
    - `distance` number, required
  - `transcript` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/agent4/apis/chatagent-platform.md) · [All operations](https://skmtc.dev/agent4/apis/chatagent-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/agent4/apis/chatagent-platform/revisions/18e58f082ce3?raw)
