> ## Documentation Index
> Fetch the complete documentation index at: https://secndai.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://secndai.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://secndai.manicule.dev/api/mcp.
> Every agent surface: https://secndai.manicule.dev/.well-known/llms-manifest.json

# Make a decision (/api-reference/decide)

<!-- agent-signals: reading_time_min: 7 · est_tokens: 4381 · updated: 2026-11-12 -->
Related: [List models](/api-reference/list-models.md), [TypeScript](/sdk/typescript.md)

> Send one typed question and receive a structured answer.

The fields, schemas, and errors below are generated from the gateway OpenAPI file. The API accepts one decision per request. Its response contains the resolved model, probabilities, routing action, and usage.

Numerical examples elsewhere in these docs are illustrative. A successful response is not evidence that your workflow is ready for automation.

The gateway also exposes the public [OpenAPI document](https://api.secndai.com/openapi.json). This site includes a local snapshot so reference generation does not require an API connection.

`POST /v1/decide`

> Complete formatted model input is limited to 2048 tokens; inference checks its exact tokenizer before encoding and never truncates. Body limit is 4 MB compressed and decompressed. JSON nesting is limited to 64. Supports gzip, x-gzip and zstd, one layer only. Probabilities cover offered options only. Confidence is the largest offered probability. The routing gate acts when confidence >= threshold (default 0.9), otherwise asks a human. This configurable routing rule is not a certified precision guarantee. One question per request: send situation (text) or state (JSON), a question, a type and its options or levels. Unknown fields are rejected.

Base URL: `https://api.secndai.com`

## OpenAPI

```json
{
  "servers": [
    {
      "url": "https://api.secndai.com"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "securitySchemes": {
    "ApiKey": {
      "type": "http",
      "scheme": "bearer"
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "model",
                "question",
                "type",
                "options"
              ],
              "properties": {
                "model": {
                  "type": "string",
                  "pattern": "^ren-zero-(?:\\d{4}-\\d{2}-\\d{2}|latest|preview)$"
                },
                "situation": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Plain-text situation. Send exactly one of situation or state."
                },
                "state": {
                  "description": "Structured situation as any non-null JSON value; a string must be nonblank. Send exactly one of situation or state.",
                  "not": {
                    "type": "null"
                  }
                },
                "question": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The single question the model answers about the situation."
                },
                "type": {
                  "const": "choice",
                  "type": "string"
                },
                "options": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 255,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "description": {
                        "type": "string"
                      }
                    }
                  }
                },
                "threshold": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Routing threshold; defaults to 0.9 unless configured by the operator."
                }
              },
              "oneOf": [
                {
                  "required": [
                    "situation"
                  ]
                },
                {
                  "required": [
                    "state"
                  ]
                }
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "model",
                "question",
                "type",
                "levels"
              ],
              "properties": {
                "model": {
                  "type": "string",
                  "pattern": "^ren-zero-(?:\\d{4}-\\d{2}-\\d{2}|latest|preview)$"
                },
                "situation": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Plain-text situation. Send exactly one of situation or state."
                },
                "state": {
                  "description": "Structured situation as any non-null JSON value; a string must be nonblank. Send exactly one of situation or state.",
                  "not": {
                    "type": "null"
                  }
                },
                "question": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The single question the model answers about the situation."
                },
                "type": {
                  "const": "score",
                  "type": "string"
                },
                "levels": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 10,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "description": {
                        "type": "string"
                      }
                    }
                  }
                },
                "threshold": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Routing threshold; defaults to 0.9 unless configured by the operator."
                }
              },
              "description": "Levels have unique numeric string IDs from 1 through 10, ordered strictly increasingly. At least two levels are required by the engine.",
              "oneOf": [
                {
                  "required": [
                    "situation"
                  ]
                },
                {
                  "required": [
                    "state"
                  ]
                }
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "model",
                "question",
                "type"
              ],
              "properties": {
                "model": {
                  "type": "string",
                  "pattern": "^ren-zero-(?:\\d{4}-\\d{2}-\\d{2}|latest|preview)$"
                },
                "situation": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Plain-text situation. Send exactly one of situation or state."
                },
                "state": {
                  "description": "Structured situation as any non-null JSON value; a string must be nonblank. Send exactly one of situation or state.",
                  "not": {
                    "type": "null"
                  }
                },
                "question": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The single question the model answers about the situation."
                },
                "type": {
                  "const": "noul",
                  "type": "string"
                },
                "threshold": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Routing threshold; defaults to 0.9 unless configured by the operator."
                }
              },
              "oneOf": [
                {
                  "required": [
                    "situation"
                  ]
                },
                {
                  "required": [
                    "state"
                  ]
                }
              ]
            }
          ]
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Decision with typed fields, routing gate and exact input-token usage",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "model",
              "choice",
              "p",
              "probabilities",
              "action",
              "gate",
              "type",
              "confidence",
              "threshold",
              "usage"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "model": {
                "type": "string",
                "pattern": "^ren-zero-\\d{4}-\\d{2}-\\d{2}$"
              },
              "choice": {
                "type": "string"
              },
              "p": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "probabilities": {
                "type": "object",
                "minProperties": 2,
                "maxProperties": 255,
                "additionalProperties": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              },
              "action": {
                "type": "string",
                "enum": [
                  "act",
                  "ask_human"
                ]
              },
              "gate": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "threshold"
                ],
                "properties": {
                  "threshold": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                }
              },
              "type": {
                "type": "string",
                "enum": [
                  "choice",
                  "score",
                  "noul"
                ]
              },
              "confidence": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "threshold": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "expected_score": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "probability": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "usage": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "input_tokens",
                  "output_tokens",
                  "model"
                ],
                "properties": {
                  "input_tokens": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2048
                  },
                  "output_tokens": {
                    "type": "integer",
                    "const": 0
                  },
                  "model": {
                    "type": "string",
                    "pattern": "^ren-zero-\\d{4}-\\d{2}-\\d{2}$"
                  }
                }
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "Malformed JSON",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "401": {
      "description": "Invalid authentication",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "413": {
      "description": "Request exceeds limit; never truncated",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "415": {
      "description": "Unsupported content type or content encoding",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "422": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "429": {
      "description": "Rate limited; Retry-After header gives seconds",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "502": {
      "description": "Invalid inference response",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "503": {
      "description": "Service unavailable",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "504": {
      "description": "Inference timeout",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "529": {
      "description": "Inference is overloaded; retry with backoff",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
```
