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

# Chat

`POST /api/chat`

## Request

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

## Request body

- ChatRequest
  - `messages` ChatMessage[], required
    - `role` 'user' | 'assistant', required
    - `content` string, required
  - `locale` 'en' | 'pl' | 'it' | 'de' | 'fr' | 'es'
  - `audience` 'standard' | 'commercialista'
  - `plan_inputs` object, nullable
  - `open_clarifications` object[], nullable
  - `conversation_id` string, nullable
  - `autopilot_context` boolean
  - `autopilot_view` 'dashboard' | 'invoices' | 'clients' | 'incassi' | 'bank' | 'f24' | 'redditi' | 'assistant' | 'onboarding', nullable

## Response `200`

Successful Response

- ChatResponse: Final, verifier-validated answer returned by /api/chat.
  - `text` string, required
  - `markdown` string
  - `sentences` CitedSentence[]
    - `text` string, required
    - `chunk_ids` string[]
  - `chunks` ChunkManifestEntry[]
    - `chunk_id` string, required
    - `source` string, required
    - `title` string, nullable
    - `url` string, nullable
    - `similarity` number, nullable
    - `text` string, nullable
    - `highlights` string[]
  - `plan` object, nullable
  - `plan_inputs` object, nullable
  - `plan_diff` object, nullable
  - `resolved_clarifications` string[]
  - `draft_actions` DraftAction[]
    - `kind` 'create_client' | 'update_client' | 'draft_invoice' | 'record_incasso' | 'mark_f24_paid' | 'confirm_bank_transaction' | 'ignore_bank_transaction', required
    - `payload` object
    - `missing_fields` string[]
    - `summary` string
    - `id` string, nullable

## Other responses

- `422`: Validation Error

---

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