{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beatapi/json-schema/beatapi-decision-response-schema.json",
  "title": "DecisionResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beatapi-decisions-api-openapi.yml#/components/schemas/DecisionResponse",
  "type": "object",
  "required": [
    "id",
    "model",
    "answers",
    "usage"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Identifier for the completed decision."
    },
    "model": {
      "type": "string"
    },
    "answers": {
      "type": "object",
      "description": "One typed answer per question name, without a data envelope.",
      "additionalProperties": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "noul",
              "choice",
              "score",
              "box"
            ]
          },
          "noul": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Likelihood of yes."
          },
          "box": {
            "type": "object",
            "description": "Edges as fractions of the image's height and width, 0-1, measured from the top and the left.",
            "properties": {
              "top": {
                "type": "number"
              },
              "bottom": {
                "type": "number"
              },
              "left": {
                "type": "number"
              },
              "right": {
                "type": "number"
              }
            }
          },
          "choice": {
            "type": "string",
            "description": "Chosen option key."
          },
          "score": {
            "type": "number",
            "description": "Continuous zero-based position on the scale."
          },
          "probabilities": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ]
          },
          "legend": {
            "type": "object",
            "additionalProperties": {}
          }
        }
      }
    },
    "usage": {
      "type": "object",
      "required": [
        "input_tokens",
        "output_tokens"
      ],
      "properties": {
        "input_tokens": {
          "type": "integer",
          "minimum": 0
        },
        "output_tokens": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}