---
title: "Stream an AI response using Server-Sent Events"
method: POST
path: "/chat/stream"
tags: ["Chat / AI"]
---

# Stream an AI response using Server-Sent Events

`POST /chat/stream`

## Request

- Base URL: `https://hoghogh.ai/api/v1`
- URL: `https://hoghogh.ai/api/v1/chat/stream`
- Auth: HTTP bearer

Requires sufficient token balance. Streams the AI response as SSE `data:` events. The last event is `data: [DONE]`.

## Request body

- object
  - `message` string, required
  - `conversationId` string, uuid
  - `agent` 'general' | 'expert' | 'writer' | 'analyzer'
  - `category` 'legal-research' | 'contract' | 'case-analysis' | 'general'
  - `docContext` string: Extracted text from an uploaded document

## Response `200`

SSE stream

## Other responses

- `401`: Missing or invalid authorization token
- `429`: Token or daily limit exceeded

---

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