> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat stream handler

> Accepts a chat message and returns an SSE stream that progressively emits symbolic analysis, grounding status, reply tokens, and the final response…

Accepts a chat message and returns an SSE stream that progressively emits
symbolic analysis, grounding status, reply tokens, and the final response.

**Required scope:** `write`

### Request body

`StreamChatRequest`

**conversation\_id** `string`

Existing conversation ID. A new UUID is generated when absent.

**execute\_ready\_actions** `boolean`

Execute ready chat actions against KB adapters. Defaults to true.

**history** `ChatMessage[]`

Conversation history for contextual follow-ups.

**max\_recursive\_steps** `integer`

Recursive completion passes (1..=4, default 4).

**message** `string` *required*

The customer message to analyze and respond to.

**session\_id** `string`

Optional server-side session for conversation continuity.

**workflow\_id** `string`

Optional workflow identifier for tracing.

### Response

No response body. SSE stream of ChatStreamEvent.

### Status codes

| Code | Meaning |
| - | - |
| `200` | SSE stream of ChatStreamEvent |
| `400` | Invalid request |
| `401` | Unauthorized — missing or invalid credentials |
| `403` | Forbidden — the key/token lacks the required scope |
| `422` | Message too long |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

```bash cURL theme={null}
curl --request POST \
  --url 'https://api.nsr.stateset.com/api/v1/nsr/chat/stream' \
  --header "X-API-Key: $STATESET_NSR_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "execute_ready_actions": true,
  "history": [
    {
      "content": "Two-person tent, green — replacement for damaged pole set.",
      "role": "string"
    }
  ],
  "max_recursive_steps": 1,
  "message": "Two-person tent, green — replacement for damaged pole set.",
  "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "workflow_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.