{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getmattered/json-schema/getmattered-application-quota-response-schema.json",
  "title": "ApplicationQuotaResponse",
  "description": "Successful API response",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getmattered-ai-api-openapi.yml#/components/schemas/ApplicationQuotaResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "allowed": {
          "type": "boolean",
          "description": "Whether user can submit applications right now"
        },
        "blockingPeriod": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "monthly",
            "daily",
            "weekly",
            "lifetime",
            "none",
            null
          ],
          "description": "Which period is blocking, if any"
        },
        "daily": {
          "$ref": "#/$defs/QuotaPeriodInfo"
        },
        "earnedAppliesRemaining": {
          "type": "integer",
          "minimum": 0,
          "description": "Earned applications available to an unpaid user after a converting referral signup"
        },
        "freeApplications": {
          "$ref": "#/$defs/FreeApplicationsAllowance"
        },
        "hasAppliedBefore": {
          "type": "boolean",
          "description": "Whether this account already has at least one application result. False means the next apply is their first ever."
        },
        "mcpFreeApplications": {
          "type": "object",
          "properties": {
            "limit": {
              "type": "integer",
              "minimum": 0,
              "description": "Free applications an account with no plan may start from an MCP client."
            },
            "remaining": {
              "type": "integer",
              "minimum": 0,
              "description": "Free MCP applications left."
            },
            "used": {
              "type": "integer",
              "minimum": 0,
              "description": "Free MCP applications used. A preparation that produced nothing is not counted."
            }
          },
          "required": [
            "limit",
            "remaining",
            "used"
          ],
          "additionalProperties": false
        },
        "monthly": {
          "$ref": "#/$defs/QuotaPeriodInfo"
        },
        "planDailyMax": {
          "type": "number",
          "description": "Plan daily limit for capping persona dailyLimit"
        },
        "weekly": {
          "$ref": "#/$defs/QuotaPeriodInfo"
        }
      },
      "required": [
        "allowed",
        "blockingPeriod",
        "daily",
        "earnedAppliesRemaining",
        "freeApplications",
        "hasAppliedBefore",
        "mcpFreeApplications",
        "monthly",
        "planDailyMax",
        "weekly"
      ],
      "additionalProperties": false
    },
    "meta": {
      "$ref": "#/$defs/ResponseMetadata"
    },
    "success": {
      "type": "boolean",
      "enum": [
        true
      ]
    }
  },
  "required": [
    "data",
    "success"
  ],
  "additionalProperties": false,
  "$defs": {
    "FreeApplicationsAllowance": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 0,
          "description": "Preparations a free account may run inside the rolling window."
        },
        "remaining": {
          "type": "integer",
          "minimum": 0,
          "description": "Preparations left. Zero means the swipe must be refused before it fires."
        },
        "resetAt": {
          "type": "string",
          "description": "ISO timestamp the oldest consumed attempt ages out."
        },
        "used": {
          "type": "integer",
          "minimum": 0,
          "description": "Preparations already consumed. Failed preparations are NOT counted."
        }
      },
      "required": [
        "limit",
        "remaining",
        "resetAt",
        "used"
      ],
      "additionalProperties": false
    },
    "QuotaPeriodInfo": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "number",
          "description": "Max allowed per period"
        },
        "remaining": {
          "type": "number",
          "description": "Remaining in current period"
        },
        "resetAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the period resets (null if not exhausted)"
        },
        "used": {
          "type": "number",
          "description": "Used in current period"
        }
      },
      "required": [
        "limit",
        "remaining",
        "resetAt",
        "used"
      ],
      "additionalProperties": false
    },
    "ResponseMetadata": {
      "type": "object",
      "properties": {
        "duration": {
          "type": "number",
          "minimum": 0,
          "description": "Request duration in milliseconds"
        },
        "performance": {
          "type": "object",
          "properties": {
            "dbQueries": {
              "type": "integer",
              "minimum": 0
            },
            "totalDbTime": {
              "type": "number",
              "minimum": 0
            }
          },
          "description": "Performance metrics (preview/local only)"
        },
        "requestId": {
          "type": "string",
          "description": "Unique request identifier"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp"
        },
        "version": {
          "type": "string",
          "description": "API version"
        }
      }
    }
  }
}