> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# System One

> Evaluate text with Laya and return typed choice, yes/no, and score answers

Evaluates text against named questions and returns a typed answer for each question. For a complete request and example results, see [Decision models](/inference/model-apis/decision-models).

```http theme={"system"}
POST https://inference.baseten.co/v1/systemone
Authorization: Bearer <BASETEN_API_KEY>
Content-Type: application/json
```

## Request body

<ParamField body="model" type="string" required>
  The Model API slug. Use `decision-models/laya` for Laya.
</ParamField>

<ParamField body="state" type="string" required>
  The text to evaluate. Serialize structured records to a string before sending them. Laya rejects a JSON object in this field with HTTP `422`.
</ParamField>

<ParamField body="questions" type="object" required>
  A map of question names to question definitions. The response uses the same names in `answers`.
</ParamField>

### Question definitions

Each question contains `type` and `instructions`. The `criteria` format depends on its type.

<ParamField body="type" type="string" required>
  One of `choice`, `noul`, or `score`.
</ParamField>

<ParamField body="instructions" type="string" required>
  The question to evaluate against `state`.
</ParamField>

<ParamField body="criteria" type="object | string[]">
  Required for `choice` and `score`. For `choice`, provide an object mapping option names to descriptions. For `score`, provide an array of descriptions ordered from the lowest level to the highest. A `noul` question can omit this field.
</ParamField>

```json Questions theme={"system"}
{
  "route": {
    "type": "choice",
    "instructions": "Which team should handle this request?",
    "criteria": {
      "billing": "Billing, payments, and refunds",
      "technical_support": "Technical troubleshooting"
    }
  },
  "refund": {
    "type": "noul",
    "instructions": "Is the customer asking for a refund?"
  },
  "urgency": {
    "type": "score",
    "instructions": "How urgent is the request?",
    "criteria": [
      "Routine request",
      "Needs attention today",
      "Immediate emergency"
    ]
  }
}
```

## Response body

<ResponseField name="model" type="string">
  The backend model identifier. This can differ from the Model API slug in the request.
</ResponseField>

<ResponseField name="answers" type="object">
  A map of question names to typed answers. Each answer includes its `type` and the fields described below. Responses can include additional model-specific fields.
</ResponseField>

<ResponseField name="usage.input_tokens" type="integer">
  The number of input tokens used by the request.
</ResponseField>

<ResponseField name="usage.output_tokens" type="integer">
  `0` for Laya decision requests.
</ResponseField>

### Answer fields

These fields appear inside each named entry in `answers`.

<ResponseField name="type" type="string">
  The question type: `choice`, `noul`, or `score`.
</ResponseField>

<ResponseField name="probabilities" type="object">
  For `choice`, each option's name mapped to its probability. For `score`, each zero-based level number, represented as a string key, mapped to its probability.
</ResponseField>

### Choice answers

<ResponseField name="choice" type="string">
  The selected option's name.
</ResponseField>

### Yes/no answers

<ResponseField name="noul" type="number">
  The probability of yes, from 0 to 1. Apply a threshold in your application to make a yes/no decision.
</ResponseField>

### Score answers

<ResponseField name="score" type="number">
  The score on the rubric. It can fall between levels.
</ResponseField>

<ResponseField name="legend" type="object">
  Level numbers, represented as string keys starting at `0`, mapped to their descriptions.
</ResponseField>

## Errors

HTTP `422` indicates an invalid request, such as a missing `questions` field, an object instead of a string in `state`, or an unsupported question type. The JSON response includes an `error` message describing the problem.

```json Invalid question type theme={"system"}
{
  "error": "Question type must be choice, score, or noul",
  "error_type": "Validation"
}
```
