{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/venice-ai/json-schema/venice-ai-create-decision-request-schema-schema.json",
  "title": "CreateDecisionRequestSchema",
  "description": "Evaluate a state against a map of typed questions and get back structured answers, one per question.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/venice-ai-decisions-api-openapi.yml#/components/schemas/CreateDecisionRequestSchema",
  "type": "object",
  "properties": {
    "state": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "object",
          "additionalProperties": {}
        },
        {
          "type": "array",
          "items": {},
          "minItems": 1
        }
      ],
      "description": "The content to evaluate: a plain string for text, or structured data (object/array) for things like chat logs, records, or application state."
    },
    "model": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "string",
          "enum": [
            "jev-latest",
            "clef"
          ]
        }
      ],
      "description": "ID of the decision model to use. You can use the List models API (type=decision) to see available models, or see our Model overview for descriptions of them."
    },
    "questions": {
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "noul"
                ]
              },
              "instructions": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  {
                    "type": "array",
                    "items": {},
                    "minItems": 1
                  }
                ],
                "description": "The yes/no question to evaluate against the state."
              },
              "criteria": {
                "type": "object",
                "properties": {
                  "true": {
                    "type": "string",
                    "description": "What a yes (value near 1) means."
                  },
                  "false": {
                    "type": "string",
                    "description": "What a no (value near 0) means."
                  }
                }
              }
            },
            "required": [
              "type",
              "instructions"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "choice"
                ]
              },
              "instructions": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  {
                    "type": "array",
                    "items": {},
                    "minItems": 1
                  }
                ],
                "description": "What the model should decide."
              },
              "criteria": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": "Map of option name to rubric description; use null when an option needs no extra detail."
              }
            },
            "required": [
              "type",
              "instructions",
              "criteria"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "score"
                ]
              },
              "instructions": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  {
                    "type": "array",
                    "items": {},
                    "minItems": 1
                  }
                ],
                "description": "What the model should rate."
              },
              "criteria": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 2,
                "description": "Ordered array of level descriptions, lowest to highest. At least two levels are required."
              }
            },
            "required": [
              "type",
              "instructions",
              "criteria"
            ],
            "additionalProperties": false
          }
        ]
      },
      "description": "Map of typed questions, keyed by an id you choose. At least one question is required. Answers come back under the same ids. Every question is evaluated in parallel and in isolation against the same state. Question ids are not sent to the model.",
      "minProperties": 1
    }
  },
  "required": [
    "state",
    "model",
    "questions"
  ],
  "additionalProperties": false
}