{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/grabbit-live/json-schema/grabbit-live-usage-schema.json",
  "title": "Usage",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/grabbit-live-openapi.json#/components/schemas/Usage",
  "type": "object",
  "properties": {
    "credits": {
      "type": "object",
      "properties": {
        "subscription": {
          "type": "integer"
        },
        "prepaid": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        }
      },
      "required": [
        "subscription",
        "prepaid",
        "total"
      ],
      "additionalProperties": {}
    },
    "plan": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "name",
        "status",
        "expires_at"
      ],
      "additionalProperties": {}
    },
    "usage": {
      "type": "object",
      "properties": {
        "grabs_last_30d": {
          "description": "All grabs, both environments.",
          "type": "integer"
        },
        "live_grabs_last_30d": {
          "type": "integer"
        }
      },
      "required": [
        "grabs_last_30d",
        "live_grabs_last_30d"
      ],
      "additionalProperties": {}
    },
    "environment": {
      "type": "string",
      "enum": [
        "live",
        "test"
      ]
    },
    "top_up": {
      "description": "Where to buy more credits.",
      "type": "string"
    }
  },
  "required": [
    "credits",
    "plan",
    "usage",
    "environment",
    "top_up"
  ],
  "additionalProperties": {}
}