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

# Reason at time handler

> **Required scope:** read

**Required scope:** `read`

### Query parameters

<ParamField query="query" type="string" required>
  Query string to evaluate
</ParamField>

<ParamField query="as_of_timestamp" type="string" required>
  RFC3339 timestamp for historical snapshot
</ParamField>

<ParamField query="strategy" type="string">
  Optional strategy override
</ParamField>

<ParamField query="session_id" type="string">
  Optional session ID
</ParamField>

<ParamField query="max_depth" type="integer">
  Optional max depth override
</ParamField>

<ParamField query="confidence_threshold" type="number (float)">
  Optional confidence threshold override
</ParamField>

<ParamField query="include_explanation" type="boolean">
  Whether to include explanation in response
</ParamField>

<ParamField query="neural_weight" type="number (float)">
  Neural weight for hybrid reasoning
</ParamField>

<ParamField query="include_evidence" type="boolean">
  Whether to include evidence in response
</ParamField>

### Response

`ReasonResponse`

<ResponseField name="answer" type="string">
  The answer to the query
</ResponseField>

<ResponseField name="confidence" type="number (float)" required>
  Confidence score (0.0 to 1.0)
</ResponseField>

<ResponseField name="evidence" type="any[]">
  Optional evidence/citation objects supporting the answer
</ResponseField>

<ResponseField name="explanation" type="object">
  Detailed explanation of reasoning steps
</ResponseField>

<ResponseField name="metadata" type="ResponseMetadata" required>
  <Expandable title="ResponseMetadata">
    <ResponseField name="facts_used" type="integer" required>
      Number of facts used in reasoning
    </ResponseField>

    <ResponseField name="query_time_ms" type="integer (int64)" required>
      Query processing time in milliseconds
    </ResponseField>

    <ResponseField name="rules_fired" type="integer" required>
      Number of rules fired during inference
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="reasoning_type" type="string" required>
  Type of reasoning used (symbolic, neural, hybrid)
</ResponseField>

<ResponseField name="session_id" type="string">
  Session ID for follow-up queries
</ResponseField>

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `200` | Reasoning completed successfully                   |
| `400` | Invalid query parameters                           |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `404` | Session not found                                  |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |
| `500` | Reasoning engine failure                           |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.nsr.stateset.com/api/v1/reason' \
    --header 'X-API-Key: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "answer": "string",
    "confidence": 7.5,
    "evidence": [],
    "explanation": null,
    "metadata": {
      "facts_used": 1,
      "query_time_ms": 250,
      "rules_fired": 1
    },
    "reasoning_type": "string",
    "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }
  ```
</ResponseExample>
