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

`RecursiveChatResponse`

**action\_results** `ActionExecutionResult[]` *required*

**ActionExecutionResult**

**action\_type** `string` *required*

**details** `string[]` *required*

**matched\_entity\_ids** `string[]` *required*

**status** `string` *required*

**summary** `string` *required*

**tool\_name** `string` *required*

**action\_runtime** `RecursiveChatActionRuntime` *required*

**RecursiveChatActionRuntime**

**approved\_action\_types** `string[]` *required*

**blocked\_action\_types** `string[]` *required*

**executed\_action\_types** `string[]` *required*

**execution\_receipt** `object`

**execution\_receipt**

**available\_action\_types** `string[]` *required*

**expires\_at** `string` *required*

**receipt\_id** `string` *required*

**lifecycle\_stage** `string` *required*

**prepared\_action\_types** `string[]` *required*

**review\_required\_action\_types** `string[]` *required*

**answer** `object`

**assistant\_message** `string` *required*

**audit\_trace** `RecursiveChatTraceStep[]`

**RecursiveChatTraceStep**

**description** `string` *required*

**duration\_ms** `integer (int64)` *required*

**input** `object`

**output** `object`

**step\_type** `string` *required*

**task\_id** `string`

**context** `RecursiveChatContextSummary` *required*

**RecursiveChatContextSummary**

**hydrated\_entities** `integer` *required*

**hydrated\_rules** `integer` *required*

**hydrated\_triples** `integer` *required*

**request\_facts** `integer` *required*

**request\_rules** `integer` *required*

**skipped\_rule\_names** `string[]`

Names of the skipped rules, capped for response size.

**skipped\_rules** `integer`

Org rules that could NOT be represented in the chat rule language and were therefore not applied — today, rules with a negated head (the chat engine has no negated conclusion) and rules with terms that do not convert. Reported rather than silently dropped: a caller reasoning about a policy needs to know part of it was not in force, especially when the dropped part is a prohibition.

**cost** `RecursiveChatCost` *required*

**RecursiveChatCost**

**api\_surface** `string` *required*

**billable\_outcome** `boolean` *required*

**billing\_tier** `string` *required*

**elapsed\_ms** `integer (int64)` *required*

**estimated\_cost\_units** `integer (int64)` *required*

**iterations** `integer` *required*

**max\_depth\_reached** `integer` *required*

**neural\_steps** `integer` *required*

**outcome\_cost\_microdollars** `integer (int64)` *required*

**planner\_steps** `integer` *required*

**symbolic\_steps** `integer` *required*

**explanation** `string` *required*

**facts** `RecursiveChatFactView[]`

**RecursiveChatFactView**

**args** `string[]` *required*

**confidence** `number (double)` *required*

**predicate** `string` *required*

**source** `string`

**goal** `string` *required*

**mode** `RecursiveChatMode` *required*

**org\_id** `string` *required*

**proof** `RecursiveChatProof` *required*

**RecursiveChatProof**

**cited\_rules** `string[]` *required*

**completed\_tasks** `string[]` *required*

**neural\_steps** `integer` *required*

**planner\_steps** `integer` *required*

**symbolic\_steps** `integer` *required*

**session\_id** `string`

**success** `boolean` *required*

**suggested\_actions** `SuggestedAction[]` *required*

**SuggestedAction**

**action\_type** `string` *required*

**can\_auto\_execute** `boolean` *required*

**execution\_status** `string` *required*

**label** `string` *required*

**missing\_inputs** `string[]` *required*

**reason** `string` *required*

**required\_inputs** `string[]` *required*

**tool\_name** `string`

**tool\_calls** `ToolCall[]` *required*

**ToolCall**

**arguments** `object` *required*

Structured arguments extracted from the message and KB context.

**function** `string` *required*

Function name to invoke (e.g., 'issue\_refund', 'create\_return', 'escalate').

**id** `string` *required*

Unique ID for this tool call.

**policy** `ToolCallPolicy` *required*

**ToolCallPolicy**

**confidence** `number (float)` *required*

Confidence from the matching rule.

**reason** `string` *required*

Human-readable reason.

**rule\_conclusion** `string` *required*

Rule conclusion (the head of the Horn clause).

**rule\_name** `string` *required*

Rule name from the org's KB that triggered this call.

**status** `string` *required*

Whether this call is ready to execute or needs more context.

**trace** `RecursiveChatTraceStep[]`

**RecursiveChatTraceStep**

**description** `string` *required*

**duration\_ms** `integer (int64)` *required*

**input** `object`

**output** `object`

**step\_type** `string` *required*

**task\_id** `string`

**trace\_id** `string` *required*

**uncertainty** `RecursiveChatUncertainty` *required*

**RecursiveChatUncertainty**

**aleatoric** `number (double)` *required*

**epistemic** `number (double)` *required*

**mandatory\_review** `boolean`

True when review is required for a reason a symbolic proof must NOT override: a safety emergency (medical-emergency language) or the solver explicitly declining. A strong, request-bound symbolic permit may suppress a review driven only by the soft uncertainty threshold, but never this — approving a grounded refund is fine, but a message also reporting a severe reaction still escalates to a human.

**requires\_human\_review** `boolean` *required*

**total** `number (double)` *required*

**validation** `RecursiveChatValidation`

**RecursiveChatValidation**

**action\_execution\_eligible** `boolean` *required*

**action\_execution\_reason** `string` *required*

**cited\_rule\_count** `integer` *required*

**grounded\_entity\_count** `integer` *required*

**grounded\_target\_count** `integer` *required*

**grounding\_status** `string` *required*

**llm\_backend\_live** `boolean` *required*

**llm\_provider** `string` *required*

**proof\_score** `number (double)` *required*

**proof\_status** `string` *required*

**symbolic\_step\_count** `integer` *required*

**validation\_level** `string` *required*

### Status codes

| Code | Meaning |
| - | - |
| `200` | Recursive-first chat inference result with proof, uncertainty, and trace |
| `400` | Invalid request |
| `401` | Unauthorized — missing or invalid credentials |
| `402` | Tenant is suspended |
| `403` | Org mismatch with authenticated scope |
| `404` | Session not found |
| `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' \
  --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"
}'
```

```json 200 theme={null}
{
  "action_results": [
    {
      "action_type": "string",
      "details": [],
      "matched_entity_ids": [],
      "status": "pending",
      "summary": "Two-person tent, green — replacement for damaged pole set.",
      "tool_name": "string"
    }
  ],
  "action_runtime": {
    "approved_action_types": [
      "string"
    ],
    "blocked_action_types": [
      "string"
    ],
    "executed_action_types": [
      "string"
    ],
    "execution_receipt": {
      "available_action_types": [],
      "expires_at": "2026-08-31T14:22:05Z",
      "receipt_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    "lifecycle_stage": "string",
    "prepared_action_types": [
      "string"
    ],
    "review_required_action_types": [
      "string"
    ]
  },
  "answer": null,
  "assistant_message": "string",
  "audit_trace": [
    {
      "description": "Two-person tent, green — replacement for damaged pole set.",
      "duration_ms": 8,
      "input": null,
      "output": null,
      "step_type": "string",
      "task_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    }
  ],
  "context": {
    "hydrated_entities": 8,
    "hydrated_rules": 8,
    "hydrated_triples": 8,
    "request_facts": 1,
    "request_rules": 1,
    "skipped_rule_names": [
      "string"
    ],
    "skipped_rules": 1
  },
  "cost": {
    "api_surface": "string",
    "billable_outcome": true,
    "billing_tier": "string",
    "elapsed_ms": 250,
    "estimated_cost_units": 1,
    "iterations": 8,
    "max_depth_reached": 1,
    "neural_steps": 1,
    "outcome_cost_microdollars": 1,
    "planner_steps": 1,
    "symbolic_steps": 1
  },
  "explanation": "string",
  "facts": [
    {
      "args": [],
      "confidence": 7.5,
      "predicate": "string",
      "source": "string"
    }
  ],
  "goal": "string",
  "mode": "fast",
  "org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "proof": {
    "cited_rules": [
      "string"
    ],
    "completed_tasks": [
      "string"
    ],
    "neural_steps": 1,
    "planner_steps": 1,
    "symbolic_steps": 1
  },
  "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "success": true,
  "suggested_actions": [
    {
      "action_type": "string",
      "can_auto_execute": true,
      "execution_status": "string",
      "label": "Replacement tent pole set",
      "missing_inputs": [],
      "reason": "Two-person tent, green — replacement for damaged pole set.",
      "required_inputs": [],
      "tool_name": "string"
    }
  ],
  "tool_calls": [
    {
      "arguments": null,
      "function": "string",
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "policy": {
        "confidence": null,
        "reason": null,
        "rule_conclusion": null,
        "rule_name": null
      },
      "status": "pending"
    }
  ],
  "trace": [
    {
      "description": "Two-person tent, green — replacement for damaged pole set.",
      "duration_ms": 8,
      "input": null,
      "output": null,
      "step_type": "string",
      "task_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    }
  ],
  "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "uncertainty": {
    "aleatoric": 1.5,
    "epistemic": 1.5,
    "mandatory_review": true,
    "requires_human_review": true,
    "total": 102.12
  },
  "validation": {
    "action_execution_eligible": true,
    "action_execution_reason": "string",
    "cited_rule_count": 1,
    "grounded_entity_count": 1,
    "grounded_target_count": 1,
    "grounding_status": "string",
    "llm_backend_live": true,
    "llm_provider": "string",
    "proof_score": 7.5,
    "proof_status": "string",
    "symbolic_step_count": 1,
    "validation_level": "string"
  }
}
```


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