{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/topxea-com/json-schema/topxea-com-system-one-request-schema.json",
  "title": "SystemOneRequest",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ai.topxea.com-openapi.json#/components/schemas/SystemOneRequest",
  "type": "object",
  "required": [
    "model",
    "state",
    "questions"
  ],
  "properties": {
    "model": {
      "type": "string",
      "enum": [
        "jev-1.14.0",
        "jev-latest",
        "jev-preview"
      ]
    },
    "state": {
      "description": "What the questions are about: a string, or structured JSON such as a record or a chat log; image references may appear in it. Default limits: 64k tokens per request and 32k per question, the state included.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object"
        },
        {
          "type": "array"
        }
      ]
    },
    "questions": {
      "type": "object",
      "minProperties": 1,
      "additionalProperties": {
        "$ref": "#/$defs/SystemOneQuestion"
      }
    },
    "assets": {
      "type": "object",
      "description": "Images keyed by reference string. Every reference must appear in the state, an instruction or a criterion; each appearance adds the image again.",
      "additionalProperties": {
        "$ref": "#/$defs/SystemOneAsset"
      }
    }
  },
  "additionalProperties": true,
  "$defs": {
    "SystemOneAsset": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "image"
          ]
        },
        "format": {
          "type": "string",
          "enum": [
            "png",
            "jpg",
            "jpeg"
          ],
          "description": "Required with data_base64."
        },
        "data_base64": {
          "type": "string",
          "description": "The image file, standard base64 with padding, no data: prefix. PNG or JPEG, 280 to 1568 pixels on each side as measured on 2026-10-16 (TypeSafe documents 256)."
        },
        "part": {
          "type": "string",
          "description": "In a multipart body, the name of the file part holding the image."
        }
      },
      "additionalProperties": false
    },
    "SystemOneQuestion": {
      "type": "object",
      "required": [
        "type",
        "instructions"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "noul",
            "choice",
            "score",
            "box"
          ],
          "description": "noul (probability of yes), choice (one option of criteria, with a probability per option), score (a value across ordered criteria levels) or box (where the target is in an image: top, bottom, left and right as fractions of the image)."
        },
        "instructions": {
          "description": "The question, or for box what to find and in which image. A string, or an object or array that holds the question and data it refers to; may contain image references.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "object"
            },
            {
              "type": "array"
            }
          ]
        },
        "criteria": {
          "description": "noul: optional {true, false} definitions. choice: object of option name to description (or null), at most 255 options. score: ordered array of 2 to 10 level descriptions. box: none. Descriptions may contain image references.",
          "oneOf": [
            {
              "type": "object"
            },
            {
              "type": "array"
            }
          ]
        }
      },
      "additionalProperties": true
    }
  }
}