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

# Induce candidate rules from labeled examples.

> A safe, on-demand generalizer: the caller supplies {features, label} examples and gets back candidate head :- body rules (association-rule mining, minimal…

A safe, on-demand generalizer: the caller supplies `&#123;features, label&#125;`
examples and gets back candidate `head :- body` rules (association-rule
mining, minimal antecedents, support/confidence gated). It returns
*suggestions only* — nothing is written to the knowledge base. Review the
output and add rules you trust via `POST /api/v1/rules`.

**Required scope:** `write`

### Request body

`InduceRulesRequest`

<ParamField body="examples" type="InduceExample[]" required />

<ParamField body="min_confidence" type="number (float)">
  Minimum fraction of matches sharing the label (default 0.8).
</ParamField>

<ParamField body="min_support" type="integer">
  Minimum examples matching a body before a rule is proposed (default 3).
</ParamField>

### Response

`InduceRulesResponse`

<ResponseField name="examples_analyzed" type="integer" required />

<ResponseField name="rules" type="InducedRuleView[]" required>
  <Expandable title="InducedRuleView">
    <ResponseField name="body" type="string[]" required />

    <ResponseField name="confidence" type="number (float)" required />

    <ResponseField name="head" type="string" required />

    <ResponseField name="support" type="integer" required />
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `200` | Candidate rules with support/confidence            |
| `400` | No examples provided                               |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `422` | Too many examples                                  |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v1/reason/induce-rules' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "examples": [
      {
        "features": [],
        "label": "Replacement tent pole set"
      }
    ],
    "min_confidence": 7.5,
    "min_support": 1
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "examples_analyzed": 1,
    "rules": [
      {
        "body": [],
        "confidence": 7.5,
        "head": "string",
        "support": 1
      }
    ]
  }
  ```
</ResponseExample>
