{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beatra-ai/json-schema/beatra-ai-understanding-capability-detail-schema.json",
  "title": "UnderstandingCapabilityDetail",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beatra-ai-catalog-api-openapi.yml#/components/schemas/UnderstandingCapabilityDetail",
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "understanding-interface.v1",
      "title": "Schema Version",
      "default": "understanding-interface.v1"
    },
    "capability": {
      "type": "string",
      "enum": [
        "image_to_text",
        "video_to_text"
      ],
      "title": "Capability"
    },
    "endpoint": {
      "type": "string",
      "title": "Endpoint"
    },
    "input_modality": {
      "type": "string",
      "title": "Input Modality"
    },
    "output_modality": {
      "type": "string",
      "const": "text",
      "title": "Output Modality",
      "default": "text"
    },
    "execution_mode": {
      "type": "string",
      "const": "sync_long",
      "title": "Execution Mode",
      "default": "sync_long"
    },
    "description": {
      "type": "string",
      "title": "Description"
    },
    "status": {
      "type": "string",
      "enum": [
        "available",
        "unavailable"
      ],
      "title": "Status"
    },
    "auto": {
      "$ref": "#/$defs/UnderstandingAutoSelectionCard"
    },
    "models": {
      "items": {
        "$ref": "#/$defs/UnderstandingModelCard"
      },
      "type": "array",
      "title": "Models"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "capability",
    "endpoint",
    "input_modality",
    "description",
    "status",
    "auto",
    "models"
  ],
  "$defs": {
    "UnderstandingAutoSelectionCard": {
      "properties": {
        "request_dependent": {
          "type": "boolean",
          "const": true,
          "title": "Request Dependent",
          "default": true
        },
        "default_for_omitted_request": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Default For Omitted Request"
        },
        "candidate_order": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Candidate Order"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "default_for_omitted_request",
        "candidate_order"
      ],
      "title": "UnderstandingAutoSelectionCard"
    },
    "UnderstandingDetailCard": {
      "properties": {
        "default": {
          "type": "string",
          "const": "default",
          "title": "Default",
          "default": "default"
        },
        "values": {
          "items": {
            "type": "string",
            "enum": [
              "default",
              "low",
              "high"
            ]
          },
          "type": "array",
          "title": "Values"
        },
        "affects_price": {
          "type": "boolean",
          "const": false,
          "title": "Affects Price",
          "default": false
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "UnderstandingDetailCard"
    },
    "UnderstandingMediaConstraintsCard": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "image",
            "video"
          ],
          "title": "Kind"
        },
        "accepted_kinds": {
          "items": {
            "type": "string",
            "enum": [
              "artifact",
              "data_uri",
              "https_url"
            ]
          },
          "type": "array",
          "title": "Accepted Kinds"
        },
        "min_items": {
          "type": "integer",
          "const": 1,
          "title": "Min Items",
          "default": 1
        },
        "max_items": {
          "type": "integer",
          "maximum": 8.0,
          "minimum": 1.0,
          "title": "Max Items"
        },
        "max_bytes_each": {
          "type": "integer",
          "exclusiveMinimum": 0.0,
          "title": "Max Bytes Each"
        },
        "max_duration_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Duration Seconds"
        },
        "sampling_fps": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Sampling Fps"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "kind",
        "accepted_kinds",
        "max_items",
        "max_bytes_each"
      ],
      "title": "UnderstandingMediaConstraintsCard"
    },
    "UnderstandingModelCard": {
      "properties": {
        "schema_version": {
          "type": "string",
          "const": "understanding-interface.v1",
          "title": "Schema Version",
          "default": "understanding-interface.v1"
        },
        "model": {
          "type": "string",
          "title": "Model"
        },
        "display_name": {
          "type": "string",
          "title": "Display Name"
        },
        "owned_by": {
          "type": "string",
          "const": "beatra",
          "title": "Owned By",
          "default": "beatra"
        },
        "capability": {
          "type": "string",
          "enum": [
            "image_to_text",
            "video_to_text"
          ],
          "title": "Capability"
        },
        "status": {
          "type": "string",
          "const": "available",
          "title": "Status",
          "default": "available"
        },
        "controls": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Controls"
        },
        "media": {
          "$ref": "#/$defs/UnderstandingMediaConstraintsCard"
        },
        "detail": {
          "$ref": "#/$defs/UnderstandingDetailCard"
        },
        "thinking": {
          "$ref": "#/$defs/UnderstandingThinkingCard"
        },
        "pricing": {
          "items": {
            "$ref": "#/$defs/UnderstandingPricingCard"
          },
          "type": "array",
          "minItems": 1,
          "title": "Pricing"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "model",
        "display_name",
        "capability",
        "controls",
        "media",
        "detail",
        "thinking",
        "pricing"
      ],
      "title": "UnderstandingModelCard"
    },
    "UnderstandingPricingCard": {
      "properties": {
        "meter": {
          "type": "string",
          "enum": [
            "image_count",
            "input_video_second"
          ],
          "title": "Meter"
        },
        "unit": {
          "type": "string",
          "enum": [
            "image",
            "second"
          ],
          "title": "Unit"
        },
        "unit_price_credits": {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
          "title": "Unit Price Credits"
        },
        "scale": {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
          "title": "Scale"
        },
        "billing_basis": {
          "type": "string",
          "enum": [
            "admitted_image_count",
            "ceil_admitted_input_video_seconds"
          ],
          "title": "Billing Basis"
        },
        "estimate_formula": {
          "type": "string",
          "const": "(unit_price_credits * billable_quantity) / scale",
          "title": "Estimate Formula",
          "default": "(unit_price_credits * billable_quantity) / scale"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "meter",
        "unit",
        "unit_price_credits",
        "scale",
        "billing_basis"
      ],
      "title": "UnderstandingPricingCard"
    },
    "UnderstandingThinkingCard": {
      "properties": {
        "public_control": {
          "type": "boolean",
          "const": false,
          "title": "Public Control",
          "default": false
        },
        "mode": {
          "type": "string",
          "enum": [
            "adaptive",
            "model_default"
          ],
          "title": "Mode"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "mode"
      ],
      "title": "UnderstandingThinkingCard"
    }
  }
}