{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/livetennisapi-com/json-schema/livetennisapi-com-usage-schema.json",
  "title": "Usage",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/livetennisapi-com-usage-api-openapi.yml#/components/schemas/Usage",
  "type": "object",
  "properties": {
    "principal": {
      "type": "string",
      "description": "Opaque ref to your own key"
    },
    "tier": {
      "type": "string",
      "enum": [
        "free",
        "basic",
        "pro",
        "ultra"
      ]
    },
    "base_tier": {
      "type": "string",
      "description": "Subscription tier; equals `tier` unless a temporary grant is active"
    },
    "tier_expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When a temporary tier grant reverts, else null"
    },
    "channel": {
      "type": "string"
    },
    "limits": {
      "type": "object",
      "properties": {
        "per_minute": {
          "type": [
            "integer",
            "null"
          ]
        },
        "per_day": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    },
    "today": {
      "type": "object",
      "properties": {
        "calls": {
          "type": "integer"
        },
        "errors": {
          "type": "integer"
        },
        "remaining_day": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Requests still SERVABLE today: the day allowance less SERVED calls (`calls - errors`). Refused requests never spend the allowance, so this does not fall when a `429`, `403` or `404` is returned. Null when the tier carries no day cap."
        }
      }
    },
    "history": {
      "type": "array",
      "description": "Last 30 days, oldest first",
      "items": {
        "type": "object",
        "properties": {
          "day": {
            "type": "string",
            "format": "date"
          },
          "calls": {
            "type": "integer"
          },
          "errors": {
            "type": "integer"
          }
        }
      }
    },
    "as_of": {
      "type": "string",
      "format": "date-time"
    }
  }
}