{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/okareo/json-schema/okareo-organization-settings-schema.json",
  "title": "OrganizationSettings",
  "description": "Settings that apply to the whole organization.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/okareo-organization-api-openapi.yml#/components/schemas/OrganizationSettings",
  "properties": {
    "concurrency": {
      "$ref": "#/$defs/OrgConcurrencySettings-Output",
      "description": "How many simulation conversations the organization may run at the same time."
    }
  },
  "type": "object",
  "required": [
    "concurrency"
  ],
  "$defs": {
    "OrgConcurrencyBudget": {
      "properties": {
        "limit": {
          "type": "integer",
          "title": "Limit",
          "description": "Most conversations the organization's simulations in this budget may run at the same time."
        },
        "in_use": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "In Use",
          "description": "Conversations the organization's running simulations hold in this budget now; null when the limit is not in force or cannot be read."
        },
        "available": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Available",
          "description": "limit - in_use (never below 0); null when in_use is null."
        }
      },
      "type": "object",
      "required": [
        "limit"
      ],
      "title": "OrgConcurrencyBudget",
      "description": "One of an organization's concurrency budgets."
    },
    "OrgConcurrencyBudgets": {
      "properties": {
        "voice": {
          "$ref": "#/$defs/OrgConcurrencyBudget"
        },
        "text": {
          "$ref": "#/$defs/OrgConcurrencyBudget"
        },
        "vision": {
          "$ref": "#/$defs/OrgConcurrencyBudget",
          "description": "UI simulations (a web Target)."
        }
      },
      "type": "object",
      "required": [
        "voice",
        "text",
        "vision"
      ],
      "title": "OrgConcurrencyBudgets"
    },
    "OrgConcurrencySettings-Output": {
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "off",
            "shadow",
            "enforce"
          ],
          "title": "Mode",
          "description": "off: not in force; shadow: tracked but never refused; enforce: a simulation over a limit is refused with 429."
        },
        "tier": {
          "type": "string",
          "enum": [
            "paid",
            "trial"
          ],
          "title": "Tier"
        },
        "budgets": {
          "$ref": "#/$defs/OrgConcurrencyBudgets"
        },
        "simulation_max_concurrent": {
          "$ref": "#/$defs/SimulationMaxConcurrent"
        }
      },
      "type": "object",
      "required": [
        "mode",
        "tier",
        "budgets",
        "simulation_max_concurrent"
      ],
      "title": "OrgConcurrencySettings",
      "description": "The organization's simulation concurrency limits."
    },
    "SimulationMaxConcurrent": {
      "properties": {
        "voice": {
          "type": "integer",
          "title": "Voice"
        },
        "text": {
          "type": "integer",
          "title": "Text"
        },
        "vision": {
          "type": "integer",
          "title": "Vision"
        }
      },
      "type": "object",
      "required": [
        "voice",
        "text",
        "vision"
      ],
      "title": "SimulationMaxConcurrent",
      "description": "The most conversations a single simulation runs at the same time, by modality."
    }
  }
}