{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mumo-chat/json-schema/mumo-chat-model-schema.json",
  "title": "Model",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mumo-chat-openapi.yml#/components/schemas/Model",
  "type": "object",
  "required": [
    "id",
    "provider",
    "display_name",
    "available",
    "min_user_tier",
    "context_window",
    "max_output_tokens",
    "pricing",
    "sort_order"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "provider": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "available": {
      "type": "boolean",
      "description": "Whether the caller can use this model right now: an `mmo_live_*` key, a plan that includes the model, and credit remaining. `false` means a call using this model will fail."
    },
    "unavailable_reason": {
      "type": "string",
      "enum": [
        "api_key_required",
        "membership_required",
        "credit_exhausted"
      ],
      "description": "Why `available` is false, ordered by what to fix first. `api_key_required` — the caller presented no `mmo_live_*` key, so the execution endpoints would reject them whatever the model. `membership_required` — the caller's plan does not include this model; a request naming it is refused with `403 forbidden_model` (more credit would not change that). `credit_exhausted` — the wallet is zero or negative. A positive balance reports the model available even when it cannot cover a particular panel: that minimum is checked per request, at write time. Absent when `available` is true."
    },
    "min_user_tier": {
      "type": "integer",
      "description": "Account tier: 0 = Everyday, 1 = Plus, 2 = Premium — every API caller is a registered account. Every tier is listed for every caller; `available` reports whether this caller can use it. Credit balance is the runtime constraint."
    },
    "context_window": {
      "type": "integer"
    },
    "max_output_tokens": {
      "type": "integer"
    },
    "pricing": {
      "$ref": "#/$defs/ModelPricing"
    },
    "description": {
      "type": "string",
      "description": "Optional registry blurb. Omitted when the registry has none."
    },
    "reasoning": {
      "type": "boolean",
      "description": "Whether reasoning is effectively enabled for this model on its active inference route. Omitted when undetermined."
    },
    "sort_order": {
      "type": "integer",
      "description": "Registry display order."
    }
  },
  "$defs": {
    "ModelPricing": {
      "type": "object",
      "description": "Raw provider cost (platform COGS), not markup-inclusive user-paid amounts. Informational — for 'will this work?' use `available`.",
      "required": [
        "input_per_million",
        "output_per_million",
        "cached_input_per_million",
        "minimum_usd"
      ],
      "properties": {
        "input_per_million": {
          "type": "number"
        },
        "output_per_million": {
          "type": "number"
        },
        "cached_input_per_million": {
          "type": [
            "number",
            "null"
          ],
          "description": "Null when the model has no cached-input rate."
        },
        "minimum_usd": {
          "type": "number",
          "description": "The model's registered floor cost, reported for reference. NOT an admission threshold — pre-flight prices a round from each model's reserved output room and token rates, not from this figure. Also appears in the `credit_exhausted` body as `per_model_minimum_usd`."
        },
        "cache_write_per_million": {
          "type": "number",
          "description": "Present only on models that bill prompt-cache writes (1.25x the input rate). Absent means cache writes are not billed for that model."
        }
      }
    }
  }
}