{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hunchsheet-app/json-schema/hunchsheet-app-ask-response-schema.json",
  "title": "AskResponse",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hunchsheet-app-openapi.json#/components/schemas/AskResponse",
  "type": "object",
  "required": [
    "results",
    "charged",
    "credits"
  ],
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AskResultItem"
      },
      "description": "One entry per row in the request, same order."
    },
    "charged": {
      "type": "integer",
      "description": "Credits spent on this call."
    },
    "credits": {
      "type": "integer",
      "description": "Credits left on the key after this call."
    },
    "buy_url": {
      "type": "string",
      "format": "uri"
    }
  },
  "$defs": {
    "AskResultItem": {
      "type": [
        "object",
        "null"
      ],
      "description": "null when the row was blank. {error} when not answered. Otherwise noul: {v: probability}. choice: {v: option, conf, p}. score: {v: score, idx, label, conf}. multi: {vs: [probabilities]}.",
      "properties": {
        "error": {
          "type": "string"
        },
        "v": {
          "oneOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ],
          "description": "noul: probability. choice: chosen label. score: weighted position."
        },
        "conf": {
          "type": "number",
          "description": "Confidence 0..1. choice and score."
        },
        "p": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          },
          "description": "Probability per option. choice."
        },
        "idx": {
          "type": "integer",
          "description": "Index of the most likely level. score."
        },
        "label": {
          "type": "string",
          "description": "The most likely level's label. score."
        },
        "vs": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "One probability per question. multi."
        }
      }
    }
  }
}