{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/everpop-app/json-schema/everpop-app-usage-envelope-schema.json",
  "title": "UsageEnvelope",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/everpop-app-openapi.json#/components/schemas/UsageEnvelope",
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    },
    "data": {
      "type": "object",
      "properties": {
        "plan": {
          "type": "string",
          "enum": [
            "free",
            "starter",
            "pro",
            "scale"
          ]
        },
        "videos": {
          "type": "object",
          "properties": {
            "used": {
              "type": "integer",
              "description": "Videos used in the current monthly window (every clip job counts as one; refunded failures don't)."
            },
            "limit": {
              "type": [
                "integer",
                "null"
              ]
            },
            "remaining": {
              "type": [
                "integer",
                "null"
              ]
            },
            "resetsAt": {
              "type": "string",
              "format": "date-time",
              "description": "When the monthly window resets (the billing day for paid plans)."
            }
          },
          "required": [
            "used",
            "limit",
            "remaining",
            "resetsAt"
          ]
        },
        "clipsPerVideo": {
          "type": "integer",
          "description": "The cap applied to clipCount on POST /api/v1/clip."
        },
        "capabilities": {
          "type": "object",
          "properties": {
            "apiAccess": {
              "type": "boolean"
            },
            "autoPost": {
              "type": "boolean"
            },
            "campaigns": {
              "type": "boolean"
            },
            "fourK": {
              "type": "boolean"
            },
            "customFonts": {
              "type": "boolean"
            }
          },
          "required": [
            "apiAccess",
            "autoPost",
            "campaigns",
            "fourK",
            "customFonts"
          ]
        },
        "destinationsConnected": {
          "type": "integer",
          "description": "Connected destinations whose grant is live (not waiting for a reconnect): the same set GET /api/v1/publish lists."
        },
        "autoClipOnFinalize": {
          "type": "boolean",
          "description": "Whether POST /api/v1/videos/complete (renderMode auto) starts a render right now: automatic clipping is on, the plan is active and videos remain."
        }
      },
      "required": [
        "plan",
        "videos",
        "clipsPerVideo",
        "capabilities",
        "destinationsConnected",
        "autoClipOnFinalize"
      ]
    }
  },
  "required": [
    "ok",
    "data"
  ]
}