curl --request POST \
--url 'https://api.nsr.stateset.com/api/v2/nsr/chat/solve' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"api_surface": "string",
"confidence_threshold": 1,
"decompositions": [
{
"goal": "string",
"subtasks": []
}
],
"facts": [
{
"confidence": 1,
"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": 1,
"messages": [
{
"content": "string",
"role": "string"
}
],
"mode": {
"0": "f",
"1": "a",
"2": "s",
"3": "t"
},
"org_id": "string",
"rules": [
{
"category": "string",
"constraints": [],
"description": "string",
"effect": {
"0": "p",
"1": "e",
"2": "r",
"3": "m",
"4": "i",
"5": "t"
},
"enabled": true,
"id": "string",
"if": [],
"name": "string",
"priority": 1,
"then": []
}
],
"session_id": "string",
"target": "string"
}'
{
"action_results": [
{
"action_type": "string",
"details": [],
"matched_entity_ids": [],
"status": "string",
"summary": "string",
"tool_name": "string"
}
],
"action_runtime": {
"approved_action_types": [
"string"
],
"blocked_action_types": [
"string"
],
"executed_action_types": [
"string"
],
"execution_receipt": {
"available_action_types": [],
"expires_at": "string",
"receipt_id": "string"
},
"lifecycle_stage": "string",
"prepared_action_types": [
"string"
],
"review_required_action_types": [
"string"
]
},
"answer": null,
"assistant_message": "string",
"audit_trace": [
{
"description": "string",
"duration_ms": 1,
"input": null,
"output": null,
"step_type": "string",
"task_id": "string"
}
],
"context": {
"hydrated_entities": 1,
"hydrated_rules": 1,
"hydrated_triples": 1,
"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": 1,
"estimated_cost_units": 1,
"iterations": 1,
"max_depth_reached": 1,
"neural_steps": 1,
"outcome_cost_microdollars": 1,
"planner_steps": 1,
"symbolic_steps": 1
},
"explanation": "string",
"facts": [
{
"args": [],
"confidence": 1,
"predicate": "string",
"source": "string"
}
],
"goal": "string",
"mode": "fast",
"org_id": "string",
"proof": {
"cited_rules": [
"string"
],
"completed_tasks": [
"string"
],
"neural_steps": 1,
"planner_steps": 1,
"symbolic_steps": 1
},
"session_id": "string",
"success": true,
"suggested_actions": [
{
"action_type": "string",
"can_auto_execute": true,
"execution_status": "string",
"label": "string",
"missing_inputs": [],
"reason": "string",
"required_inputs": [],
"tool_name": "string"
}
],
"tool_calls": [
{
"arguments": null,
"function": "string",
"id": "string",
"policy": {
"confidence": null,
"reason": null,
"rule_conclusion": null,
"rule_name": null
},
"status": "string"
}
],
"trace": [
{
"description": "string",
"duration_ms": 1,
"input": null,
"output": null,
"step_type": "string",
"task_id": "string"
}
],
"trace_id": "string",
"uncertainty": {
"aleatoric": 1,
"epistemic": 1,
"mandatory_review": true,
"requires_human_review": true,
"total": 1
},
"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": 1,
"proof_status": "string",
"symbolic_step_count": 1,
"validation_level": "string"
}
}
Recursive chat solve handler
Required scope: write
POST
/
api
/
v2
/
nsr
/
chat
/
solve
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v2/nsr/chat/solve' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"api_surface": "string",
"confidence_threshold": 1,
"decompositions": [
{
"goal": "string",
"subtasks": []
}
],
"facts": [
{
"confidence": 1,
"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": 1,
"messages": [
{
"content": "string",
"role": "string"
}
],
"mode": {
"0": "f",
"1": "a",
"2": "s",
"3": "t"
},
"org_id": "string",
"rules": [
{
"category": "string",
"constraints": [],
"description": "string",
"effect": {
"0": "p",
"1": "e",
"2": "r",
"3": "m",
"4": "i",
"5": "t"
},
"enabled": true,
"id": "string",
"if": [],
"name": "string",
"priority": 1,
"then": []
}
],
"session_id": "string",
"target": "string"
}'
{
"action_results": [
{
"action_type": "string",
"details": [],
"matched_entity_ids": [],
"status": "string",
"summary": "string",
"tool_name": "string"
}
],
"action_runtime": {
"approved_action_types": [
"string"
],
"blocked_action_types": [
"string"
],
"executed_action_types": [
"string"
],
"execution_receipt": {
"available_action_types": [],
"expires_at": "string",
"receipt_id": "string"
},
"lifecycle_stage": "string",
"prepared_action_types": [
"string"
],
"review_required_action_types": [
"string"
]
},
"answer": null,
"assistant_message": "string",
"audit_trace": [
{
"description": "string",
"duration_ms": 1,
"input": null,
"output": null,
"step_type": "string",
"task_id": "string"
}
],
"context": {
"hydrated_entities": 1,
"hydrated_rules": 1,
"hydrated_triples": 1,
"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": 1,
"estimated_cost_units": 1,
"iterations": 1,
"max_depth_reached": 1,
"neural_steps": 1,
"outcome_cost_microdollars": 1,
"planner_steps": 1,
"symbolic_steps": 1
},
"explanation": "string",
"facts": [
{
"args": [],
"confidence": 1,
"predicate": "string",
"source": "string"
}
],
"goal": "string",
"mode": "fast",
"org_id": "string",
"proof": {
"cited_rules": [
"string"
],
"completed_tasks": [
"string"
],
"neural_steps": 1,
"planner_steps": 1,
"symbolic_steps": 1
},
"session_id": "string",
"success": true,
"suggested_actions": [
{
"action_type": "string",
"can_auto_execute": true,
"execution_status": "string",
"label": "string",
"missing_inputs": [],
"reason": "string",
"required_inputs": [],
"tool_name": "string"
}
],
"tool_calls": [
{
"arguments": null,
"function": "string",
"id": "string",
"policy": {
"confidence": null,
"reason": null,
"rule_conclusion": null,
"rule_name": null
},
"status": "string"
}
],
"trace": [
{
"description": "string",
"duration_ms": 1,
"input": null,
"output": null,
"step_type": "string",
"task_id": "string"
}
],
"trace_id": "string",
"uncertainty": {
"aleatoric": 1,
"epistemic": 1,
"mandatory_review": true,
"requires_human_review": true,
"total": 1
},
"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": 1,
"proof_status": "string",
"symbolic_step_count": 1,
"validation_level": "string"
}
}
Required scope:
write
Request body
RecursiveChatRequest
string
number (double)
RecursiveChatDecomposition[]
RecursiveChatFactInput[]
string
boolean
boolean
boolean
object
integer
integer
RecursiveChatMessage[]
required
object
string
RecursiveChatRuleInput[]
string
string
Response
RecursiveChatResponse
ActionExecutionResult[]
required
RecursiveChatActionRuntime
required
object
string
required
RecursiveChatTraceStep[]
RecursiveChatContextSummary
required
Show RecursiveChatContextSummary
Show RecursiveChatContextSummary
integer
required
integer
required
integer
required
integer
required
integer
required
string[]
Names of the skipped rules, capped for response size.
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.
RecursiveChatCost
required
string
required
RecursiveChatFactView[]
string
required
RecursiveChatMode
required
string
required
RecursiveChatProof
required
string
boolean
required
SuggestedAction[]
required
ToolCall[]
required
Show ToolCall
Show ToolCall
object
required
Structured arguments extracted from the message and KB context.
string
required
Function name to invoke (e.g., ‘issue_refund’, ‘create_return’, ‘escalate’).
string
required
Unique ID for this tool call.
ToolCallPolicy
required
string
required
Whether this call is ready to execute or needs more context.
RecursiveChatTraceStep[]
string
required
RecursiveChatUncertainty
required
Show RecursiveChatUncertainty
Show RecursiveChatUncertainty
number (double)
required
number (double)
required
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.
boolean
required
number (double)
required
RecursiveChatValidation
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 |
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v2/nsr/chat/solve' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"api_surface": "string",
"confidence_threshold": 1,
"decompositions": [
{
"goal": "string",
"subtasks": []
}
],
"facts": [
{
"confidence": 1,
"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": 1,
"messages": [
{
"content": "string",
"role": "string"
}
],
"mode": {
"0": "f",
"1": "a",
"2": "s",
"3": "t"
},
"org_id": "string",
"rules": [
{
"category": "string",
"constraints": [],
"description": "string",
"effect": {
"0": "p",
"1": "e",
"2": "r",
"3": "m",
"4": "i",
"5": "t"
},
"enabled": true,
"id": "string",
"if": [],
"name": "string",
"priority": 1,
"then": []
}
],
"session_id": "string",
"target": "string"
}'
{
"action_results": [
{
"action_type": "string",
"details": [],
"matched_entity_ids": [],
"status": "string",
"summary": "string",
"tool_name": "string"
}
],
"action_runtime": {
"approved_action_types": [
"string"
],
"blocked_action_types": [
"string"
],
"executed_action_types": [
"string"
],
"execution_receipt": {
"available_action_types": [],
"expires_at": "string",
"receipt_id": "string"
},
"lifecycle_stage": "string",
"prepared_action_types": [
"string"
],
"review_required_action_types": [
"string"
]
},
"answer": null,
"assistant_message": "string",
"audit_trace": [
{
"description": "string",
"duration_ms": 1,
"input": null,
"output": null,
"step_type": "string",
"task_id": "string"
}
],
"context": {
"hydrated_entities": 1,
"hydrated_rules": 1,
"hydrated_triples": 1,
"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": 1,
"estimated_cost_units": 1,
"iterations": 1,
"max_depth_reached": 1,
"neural_steps": 1,
"outcome_cost_microdollars": 1,
"planner_steps": 1,
"symbolic_steps": 1
},
"explanation": "string",
"facts": [
{
"args": [],
"confidence": 1,
"predicate": "string",
"source": "string"
}
],
"goal": "string",
"mode": "fast",
"org_id": "string",
"proof": {
"cited_rules": [
"string"
],
"completed_tasks": [
"string"
],
"neural_steps": 1,
"planner_steps": 1,
"symbolic_steps": 1
},
"session_id": "string",
"success": true,
"suggested_actions": [
{
"action_type": "string",
"can_auto_execute": true,
"execution_status": "string",
"label": "string",
"missing_inputs": [],
"reason": "string",
"required_inputs": [],
"tool_name": "string"
}
],
"tool_calls": [
{
"arguments": null,
"function": "string",
"id": "string",
"policy": {
"confidence": null,
"reason": null,
"rule_conclusion": null,
"rule_name": null
},
"status": "string"
}
],
"trace": [
{
"description": "string",
"duration_ms": 1,
"input": null,
"output": null,
"step_type": "string",
"task_id": "string"
}
],
"trace_id": "string",
"uncertainty": {
"aleatoric": 1,
"epistemic": 1,
"mandatory_review": true,
"requires_human_review": true,
"total": 1
},
"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": 1,
"proof_status": "string",
"symbolic_step_count": 1,
"validation_level": "string"
}
}