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

**api\_surface** `string`

**confidence\_threshold** `number (double)`

**decompositions** `RecursiveChatDecomposition[]`

**facts** `RecursiveChatFactInput[]`

**goal** `string`

**hydrate\_org\_context** `boolean`

**include\_facts** `boolean`

**include\_trace** `boolean`

**kb\_limits** `object`

**max\_depth** `integer`

**max\_iterations** `integer`

**messages** `RecursiveChatMessage[]` *required*

**mode** `object`

**org\_id** `string`

**rules** `RecursiveChatRuleInput[]`

**session\_id** `string`

**target** `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 |

```bash cURL theme={null}
curl --request POST \
  --url 'https://api.nsr.stateset.com/api/v2/nsr/chat/solve/stream' \
  --header "X-API-Key: $STATESET_NSR_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"
}'
```


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