> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mixlayer.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mixlayer.com/_mcp/server.

# Evaluate typed classification questions against a shared state.

POST https://mixlayer.ai/v1/systemone
Content-Type: application/json

Evaluates independently answered Noul, Choice and Score questions using a classification model. The JSON body is limited to 8 MiB. Rendered state must be nonempty and at most 4 MiB; each expanded question must be nonempty and at most 16 KiB. At most 4096 questions and expanded binary branches are allowed. Unknown request fields are rejected. No output tokens are generated.

Reference: https://docs.mixlayer.com/api-reference/inference-ap-is/decisions/systemone

## Authentication

- `Authorization` header (bearer token, required) — Mixlayer API key or console user session supplied as a Bearer token.

## Request

### Body (application/json)

This endpoint expects a SystemOneRequest.

- `model` (string, required) — Classification model identifier; nonempty and at most 256 UTF-8 bytes.
- `questions` (map from string to SystemOneQuestion, required) — Between 1 and 4096 questions. IDs must be nonblank and at most 256 UTF-8 bytes.
- `state` (SystemOneState, required) — State may be text, a JSON object or a JSON array; scalar numbers, booleans and null are rejected.

## Response

### 200

Typed answers keyed by the supplied question IDs, with actual input token usage

- `answers` (map from string to SystemOneAnswer, required) — Exactly the question IDs supplied in the request, with matching answer types.
- `model` (string, required)
- `usage` (SystemOneUsage, required) — Actual forward input tokens count the shared prefix once plus every branch suffix.

## Errors

### 401 Unauthorized Error

Missing or invalid credentials

- `error` (SystemOneErrorDetails, required) — Safe machine-readable error code and public message.

### 402 Payment Required Error

Billing is required

- `error` (SystemOneErrorDetails, required) — Safe machine-readable error code and public message.

### 403 Forbidden Error

Inference permission or region access denied

- `error` (SystemOneErrorDetails, required) — Safe machine-readable error code and public message.

### 422 Unprocessable Entity Error

Invalid JSON, request shape, validation limits, model or routing hint

- `error` (SystemOneErrorDetails, required) — Safe machine-readable error code and public message.

### 429 Too Many Requests Error

Rate limit exceeded

- `error` (SystemOneErrorDetails, required) — Safe machine-readable error code and public message.

### 500 Internal Server Error

Authentication, routing or inference failed, or the worker returned an invalid response

- `error` (SystemOneErrorDetails, required) — Safe machine-readable error code and public message.

## Types

### SystemOneQuestion

Typed questions use the `type` discriminator and reject unknown fields.

### SystemOneState

State may be text, a JSON object or a JSON array; scalar numbers, booleans and null are rejected.

### SystemOneAnswer

Answer variants use the `type` discriminator; probabilities are not calibrated model confidence.

### SystemOneUsage

Actual forward input tokens count the shared prefix once plus every branch suffix.

- `input_tokens` (long, required)
- `output_tokens` (long, required) — Classification generates no output tokens.

### SystemOneErrorDetails

Safe machine-readable error code and public message.

- `code` (string, required)
- `message` (string, required)
- `type` (string, optional, nullable) — May be present on gateway authentication or routing failures; Jini errors omit this field.

### SystemOneQuestion0

Binary yes/no classification.

- `instructions` (SystemOneDescription, required) — State may be text, a JSON object or a JSON array; scalar numbers, booleans and null are rejected.
- `type` (enum, required)
  - Allowed values: `noul`
- `criteria` (SystemOneNoulCriteria, optional, nullable) — Optional yes/no rubric entries use the JSON keys `true` and `false`.

### SystemOneQuestion1

Choose one of 1 to 255 named options; option names must be nonblank.

- `criteria` (map from string to SystemOneDescription, required)
- `instructions` (SystemOneDescription, required) — State may be text, a JSON object or a JSON array; scalar numbers, booleans and null are rejected.
- `type` (enum, required)
  - Allowed values: `choice`

### SystemOneQuestion2

Score against 2 to 10 ordered levels, starting at index zero.

- `criteria` (list of SystemOneDescription, required)
- `instructions` (SystemOneDescription, required) — State may be text, a JSON object or a JSON array; scalar numbers, booleans and null are rejected.
- `type` (enum, required)
  - Allowed values: `score`

### SystemOneAnswer0

- `noul` (double, required) — Conditional probability of yes versus no.
- `type` (enum, required)
  - Allowed values: `noul`

### SystemOneAnswer1

- `choice` (string, required) — Selected option name with the highest probability.
- `confidence` (double, required)
- `probabilities` (map from string to double, required) — Probabilities keyed by option name, each in [0, 1] and summing to one.
- `type` (enum, required)
  - Allowed values: `choice`

### SystemOneAnswer2

- `confidence` (double, required)
- `legend` (map from string to string, required) — Rendered level descriptions keyed by decimal zero-based level indices.
- `probabilities` (map from string to double, required) — Probabilities keyed by decimal level index, each in [0, 1] and summing to one.
- `score` (double, required) — Expected zero-based level index, bounded by the supplied rubric.
- `type` (enum, required)
  - Allowed values: `score`

### SystemOneDescription

State may be text, a JSON object or a JSON array; scalar numbers, booleans and null are rejected.

### SystemOneNoulCriteria

Optional yes/no rubric entries use the JSON keys `true` and `false`.

- `false` (SystemOneDescription, optional) — State may be text, a JSON object or a JSON array; scalar numbers, booleans and null are rejected.
- `true` (SystemOneDescription, optional) — State may be text, a JSON object or a JSON array; scalar numbers, booleans and null are rejected.

## Examples

**Request**

```json
{
  "model": "string"
}
```

**Response**

```json
{
  "answers": {},
  "model": "string",
  "usage": {
    "input_tokens": 1,
    "output_tokens": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://mixlayer.ai/v1/systemone"

payload = { "model": "string" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://mixlayer.ai/v1/systemone';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://mixlayer.ai/v1/systemone"

	payload := strings.NewReader("{\n  \"model\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://mixlayer.ai/v1/systemone")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://mixlayer.ai/v1/systemone")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://mixlayer.ai/v1/systemone', [
  'body' => '{
  "model": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```