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

# Perform ensemble inference with input dropout for confidence calibration

> **Required scope:** write

**Required scope:** `write`

### Request body

`NSREnsembleInferRequest`

<ParamField body="drop_count" type="integer">
  Number of random tokens to drop per run (default: 1)
</ParamField>

<ParamField body="inputs" type="GroundedInputRequest[]" required>
  Input sequence for inference
</ParamField>

<ParamField body="runs" type="integer">
  Number of ensemble runs (default: 5, max: 25)
</ParamField>

<ParamField body="session_id" type="string">
  Optional session ID for context persistence
</ParamField>

### Response

`NSREnsembleInferResponse`

<ResponseField name="agreement" type="number (double)" required>
  Agreement ratio for the consensus (0.0 to 1.0)
</ResponseField>

<ResponseField name="confidence" type="number (double)" required>
  Calibrated confidence based on agreement and mean per-run confidence (0.0 to 1.0)
</ResponseField>

<ResponseField name="output" type="object">
  <Expandable title="output">
    <ResponseField name="type" type="string" required />
  </Expandable>
</ResponseField>

<ResponseField name="processing_time_ms" type="integer (int64)" required>
  Processing time in milliseconds
</ResponseField>

<ResponseField name="results" type="NSREnsembleRunResponse[]" required>
  Per-run outputs and diagnostics

  <Expandable title="NSREnsembleRunResponse">
    <ResponseField name="confidence" type="number (double)" required>
      Confidence score for this run
    </ResponseField>

    <ResponseField name="error" type="string">
      Error string when the run fails
    </ResponseField>

    <ResponseField name="inputs_used" type="integer" required>
      Inputs used in this run (after dropout)
    </ResponseField>

    <ResponseField name="output" type="object">
      <Expandable title="output">
        <ResponseField name="type" type="string" required />
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="runs" type="integer" required>
  Number of runs performed
</ResponseField>

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `200` | Ensemble inference successful                      |
| `400` | Invalid request                                    |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |
| `500` | Internal server error                              |
| `504` | Reasoning budget exhausted before completion       |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v1/nsr/infer/ensemble' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "drop_count": 1,
    "inputs": [
      {
        "type": "text",
        "value": "49.00"
      }
    ],
    "runs": 1,
    "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "agreement": 1.5,
    "confidence": 7.5,
    "output": {
      "type": "null"
    },
    "processing_time_ms": 250,
    "results": [
      {
        "confidence": 7.5,
        "error": "string",
        "inputs_used": 1,
        "output": {
          "type": null
        }
      }
    ],
    "runs": 1
  }
  ```
</ResponseExample>
