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

# Nsr responses handler

> **Required scope:** write

**Required scope:** `write`

### Request body

`object`

**model** `string`

**input** `string`

A text string, a single input item object, or an array of input items.

**instructions** `string`

**tools** `object[]`

**tool\_choice** `string`

Tool selection mode (`auto`, `none`, `required`) or a specific function as `&#123;'type': 'function', 'function': &#123;'name': …&#125;&#125;`.

**max\_output\_tokens** `integer`

**response\_format** `object`

**text** `object`

OpenAI Responses-style text config; `format` takes the same shape as `response_format`.

**session\_id** `string`

**goal** `string`

**target** `string`

**facts** `object[]`

**rules** `object[]`

**decompositions** `object[]`

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

**kb\_limits** `object`

**max\_depth** `integer`

**max\_iterations** `integer`

**confidence\_threshold** `number`

**stream** `boolean`

When true, emit an SSE stream instead of a JSON body.

**stream\_options** `object`

**previous\_response\_id** `string`

**store** `boolean`

**metadata** `object`

**include\_nsr\_metadata** `boolean`

When true, include the full recursive payload under `x_nsr`.

### Response

`object`

**id** `string` *required*

**object** `string` *required*

**created\_at** `integer` *required*

Unix timestamp (seconds).

**status** `string` *required*

**model** `string` *required*

**output** `object[]` *required*

**output**

**type** `string` *required*

**id** `string` *required*

**status** `string` *required*

**role** `string`

Present on `message` items.

**content** `object[]`

Present on `message` items.

**content**

**type** `string`

**text** `string`

**annotations** `object[]`

**call\_id** `string`

Present on `function_call` items.

**name** `string`

Present on `function_call` items.

**arguments** `string`

JSON-encoded arguments string. Present on `function_call` items.

**output\_text** `string`

Convenience concatenation of the output text. Omitted when there is none.

**usage** `object` *required*

**usage**

**input\_tokens** `integer` *required*

**output\_tokens** `integer` *required*

**total\_tokens** `integer` *required*

**metadata** `object`

Echoed request metadata. Omitted when absent.

**previous\_response\_id** `string`

Omitted when absent.

**x\_nsr** `object`

Full recursive NSR payload. Present only when `include_nsr_metadata` is true.

### Status codes

| Code | Meaning |
| - | - |
| `200` | OpenAI-compatible response object. With `stream: true` the body is a `text/event-stream` instead. |
| `401` | Unauthorized — missing or invalid credentials |
| `403` | Forbidden — the key/token lacks the required scope |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

```bash cURL theme={null}
curl --request POST \
  --url 'https://api.nsr.stateset.com/v1/responses' \
  --header "X-API-Key: $STATESET_NSR_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "string",
  "input": "string",
  "instructions": "Two-person tent, green — replacement for damaged pole set.",
  "tools": [
    {}
  ],
  "tool_choice": "string",
  "max_output_tokens": 1,
  "response_format": {
    "type": "standard",
    "json_schema": {
      "name": "Two-Person Tent",
      "schema": {},
      "strict": true
    }
  },
  "text": {
    "format": {}
  },
  "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "goal": "string",
  "target": "string",
  "facts": [
    {}
  ],
  "rules": [
    {}
  ],
  "decompositions": [
    {}
  ],
  "hydrate_org_context": true,
  "kb_limits": {},
  "max_depth": 1,
  "max_iterations": 8,
  "confidence_threshold": 7.5,
  "stream": true,
  "stream_options": {
    "include_usage": true
  },
  "previous_response_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "store": true,
  "metadata": {},
  "include_nsr_metadata": true
}'
```

```json 200 theme={null}
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "object": "string",
  "created_at": 1,
  "status": "pending",
  "model": "string",
  "output": [
    {
      "type": "standard",
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "status": "pending",
      "role": "string",
      "content": [],
      "call_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "Two-Person Tent",
      "arguments": "string"
    }
  ],
  "output_text": "string",
  "usage": {
    "input_tokens": 1,
    "output_tokens": 1,
    "total_tokens": 1
  },
  "metadata": {},
  "previous_response_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "x_nsr": {}
}
```


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