{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/monsitools/main/json-schema/monsitools-api-key-status-schema.json",
  "title": "ApiKeyStatus",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/monsitools-openapi.yml#/components/schemas/ApiKeyStatus",
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    },
    "hasKey": {
      "type": "boolean"
    },
    "createdAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "hint": {
      "type": [
        "string",
        "null"
      ],
      "description": "Last four characters of the key."
    },
    "usage": {
      "oneOf": [
        {
          "$ref": "#/$defs/ApiUsage"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "ApiUsage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "description": "YYYY-MM, UTC."
        },
        "calls": {
          "type": "integer"
        },
        "errors": {
          "type": "integer"
        },
        "topTools": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "slug": {
                "type": "string"
              },
              "calls": {
                "type": "integer"
              }
            }
          }
        },
        "lastUsed": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastStatus": {
          "type": [
            "integer",
            "null"
          ]
        },
        "previousMonth": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "month": {
              "type": "string"
            },
            "calls": {
              "type": "integer"
            }
          }
        }
      }
    }
  }
}