{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/classifier-dev/json-schema/classifier-dev-type-safe-system-one-request-schema.json",
  "title": "TypeSafeSystemOneRequest",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/classifier-dev-openapi.json#/components/schemas/TypeSafeSystemOneRequest",
  "type": "object",
  "required": [
    "state",
    "model",
    "questions"
  ],
  "properties": {
    "share_data": {
      "type": "boolean",
      "default": true,
      "description": "Synchronous classification request text, labels, instructions and model results are retained for model training and operator review in private Cloudflare storage by default. Shared requests receive double per-minute and daily classification quotas. Set share_data: false or X-Classifier-Share-Data: false to opt out and use standard limits. Share only data you have permission to contribute; do not include confidential or personal information. Redaction is best effort. Billing, spending caps and input-size limits still apply."
    },
    "state": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "array",
          "items": {}
        },
        {
          "type": "null"
        }
      ]
    },
    "model": {
      "type": "string",
      "description": "A TypeSafe name or alias returned by GET /v1/models, imajev-4b for image decisions, or jev-omni for decisions over text, an image, audio or video."
    },
    "images": {
      "type": "array",
      "minItems": 1,
      "maxItems": 2,
      "items": {
        "type": "string",
        "pattern": "^data:image/(jpeg|png|webp);base64,"
      },
      "description": "Imajev-4B only: inline image bytes. Entire request is limited to 1 MB; no external URL fetches. Supports up to eight questions and 4096 processed tokens per question. Images and accompanying state are not retained for training."
    },
    "media": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "items": {
        "type": "string",
        "maxLength": 900000,
        "pattern": "^data:(image/(png|jpeg|webp|gif)|audio/(wav|mpeg|mp4|webm)|video/(mp4|webm));base64,"
      },
      "description": "Jev-Omni only: one inline image, audio clip (at most 30 seconds) or video. Up to eight Choice or Noul questions; a request may read at most 65,536 tokens. Animated GIFs are refused; send video. Media and accompanying state are not retained for training."
    },
    "questions": {
      "type": "object",
      "minProperties": 1,
      "additionalProperties": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "const": "noul"
              },
              "instructions": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "array",
                    "items": {}
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "criteria": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "true": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "additionalProperties": true
                          },
                          {
                            "type": "array",
                            "items": {}
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "false": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "additionalProperties": true
                          },
                          {
                            "type": "array",
                            "items": {}
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type",
              "criteria"
            ],
            "properties": {
              "type": {
                "const": "choice"
              },
              "instructions": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "array",
                    "items": {}
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "criteria": {
                "type": "object",
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "object",
                      "additionalProperties": true
                    },
                    {
                      "type": "array",
                      "items": {}
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type",
              "criteria"
            ],
            "properties": {
              "type": {
                "const": "score"
              },
              "instructions": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "array",
                    "items": {}
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "criteria": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "object",
                      "additionalProperties": true
                    },
                    {
                      "type": "array",
                      "items": {}
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        ]
      }
    }
  }
}