{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/jamframe-com/json-schema/jamframe-com-ai-status-schema.json",
  "title": "AiStatus",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/jamframe-com-openapi.yml#/components/schemas/AiStatus",
  "type": "object",
  "required": [
    "status",
    "models",
    "prices",
    "credits"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "live",
        "mock",
        false
      ],
      "description": "`live`: AI runs. `mock`: a development server without an AI key\nanswers with placeholder output (no cost). `off`: AI features\nanswer `503 AI_UNAVAILABLE`.\n"
    },
    "models": {
      "type": "object",
      "description": "The model slug each AI task uses (design, fast, vision, image, imageEdit, background, tts, stt, video, embedding).",
      "additionalProperties": {
        "type": "string"
      }
    },
    "prices": {
      "type": "array",
      "description": "The AI credit price list. An operation costs `credits` per started block of `per` units.",
      "items": {
        "type": "object",
        "required": [
          "operation",
          "credits",
          "per",
          "unit",
          "label"
        ],
        "properties": {
          "operation": {
            "type": "string",
            "enum": [
              "text",
              "design",
              "vision",
              "image",
              "image_hd",
              "background_local",
              "background_model",
              "tts",
              "stt",
              "video",
              "embedding"
            ]
          },
          "credits": {
            "type": "integer"
          },
          "per": {
            "type": "integer"
          },
          "unit": {
            "type": "string",
            "enum": [
              "word",
              "call",
              "image",
              "character",
              "second",
              "input"
            ]
          },
          "label": {
            "type": "string"
          }
        }
      }
    },
    "credits": {
      "type": "object",
      "description": "The organization's AI credits for the current billing period.",
      "required": [
        "planCode",
        "used",
        "reserved",
        "limit",
        "remaining",
        "periodStart",
        "periodEnd",
        "active",
        "oneTime"
      ],
      "properties": {
        "planCode": {
          "type": "string"
        },
        "used": {
          "type": "integer",
          "description": "Credits charged this period."
        },
        "reserved": {
          "type": "integer",
          "description": "Credits held by AI calls still running."
        },
        "limit": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The period's allowance; `null` means unlimited."
        },
        "remaining": {
          "type": [
            "integer",
            "null"
          ],
          "description": "What can still be spent; `null` means unlimited."
        },
        "periodStart": {
          "type": "string",
          "format": "date-time"
        },
        "periodEnd": {
          "type": "string",
          "format": "date-time"
        },
        "active": {
          "type": "boolean",
          "description": "False when the subscription isn't active (AI credits can't be spent)."
        },
        "oneTime": {
          "type": "boolean",
          "description": "True on the Free plan: its AI credits are given once and don't renew at `periodEnd`; `used` counts every credit spent on Free."
        }
      }
    }
  }
}