> ## 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.

# Recursive chat solve stream handler

> **Required scope:** write

**Required scope:** `write`

### Request body

`RecursiveChatRequest`

<ParamField body="api_surface" type="string" />

<ParamField body="confidence_threshold" type="number (double)" />

<ParamField body="decompositions" type="RecursiveChatDecomposition[]" />

<ParamField body="facts" type="RecursiveChatFactInput[]" />

<ParamField body="goal" type="string" />

<ParamField body="hydrate_org_context" type="boolean" />

<ParamField body="include_facts" type="boolean" />

<ParamField body="include_trace" type="boolean" />

<ParamField body="kb_limits" type="object" />

<ParamField body="max_depth" type="integer" />

<ParamField body="max_iterations" type="integer" />

<ParamField body="messages" type="RecursiveChatMessage[]" required />

<ParamField body="mode" type="object" />

<ParamField body="org_id" type="string" />

<ParamField body="rules" type="RecursiveChatRuleInput[]" />

<ParamField body="session_id" type="string" />

<ParamField body="target" type="string" />

### Response

No response body. Server-Sent Events stream of recursive chat progress + final response.

### Status codes

| Code  | Meaning                                                               |
| ----- | --------------------------------------------------------------------- |
| `200` | Server-Sent Events stream of recursive chat progress + final response |
| `401` | Unauthorized — missing or invalid credentials                         |
| `402` | Account suspended or quota exhausted                                  |
| `403` | org\_id mismatch                                                      |
| `408` | Solve exceeded wall-clock budget                                      |
| `422` | Malformed input                                                       |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset                    |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v2/nsr/chat/solve/stream' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "api_surface": "string",
    "confidence_threshold": 7.5,
    "decompositions": [
      {
        "goal": "string",
        "subtasks": []
      }
    ],
    "facts": [
      {
        "confidence": 7.5,
        "predicate": {
          "args": null,
          "name": null,
          "negated": null
        },
        "source": "string"
      }
    ],
    "goal": "string",
    "hydrate_org_context": true,
    "include_facts": true,
    "include_trace": true,
    "kb_limits": {
      "max_entities": 1,
      "max_properties_per_entity": 1,
      "max_rules": 1,
      "max_triples": 1
    },
    "max_depth": 1,
    "max_iterations": 8,
    "messages": [
      {
        "content": "Two-person tent, green — replacement for damaged pole set.",
        "role": "string"
      }
    ],
    "mode": {
      "0": "f",
      "1": "a",
      "2": "s",
      "3": "t"
    },
    "org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "rules": [
      {
        "category": "standard",
        "constraints": [],
        "description": "Two-person tent, green — replacement for damaged pole set.",
        "effect": {
          "0": "p",
          "1": "e",
          "2": "r",
          "3": "m",
          "4": "i",
          "5": "t"
        },
        "enabled": true,
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "if": [],
        "name": "Two-Person Tent",
        "priority": 1,
        "then": []
      }
    ],
    "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "target": "string"
  }'
  ```
</RequestExample>
