{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/internetdata-io/json-schema/internetdata-io-entitlement-schema.json",
  "title": "Entitlement",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/internetdata-io-entitlement-api-openapi.yml#/components/schemas/Entitlement",
  "type": "object",
  "required": [
    "org_id",
    "apikey",
    "plan",
    "usage"
  ],
  "properties": {
    "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "The organization the key belongs to."
    },
    "apikey": {
      "$ref": "#/$defs/EntitlementApikey"
    },
    "plan": {
      "$ref": "#/$defs/EntitlementPlan"
    },
    "usage": {
      "$ref": "#/$defs/EntitlementUsage"
    }
  },
  "$defs": {
    "EntitlementApikey": {
      "type": "object",
      "description": "The credential itself. The key is never echoed - only its ID, which is\nwhat the console shows and what you can act on.\n",
      "required": [
        "id",
        "expires",
        "allowed_cidrs"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "expires": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Null for a key with no end date, which is the normal case."
        },
        "allowed_cidrs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The source addresses this key may be used from. Empty means\nunrestricted, never \"deny all\".\n"
        }
      }
    },
    "EntitlementPlan": {
      "type": "object",
      "required": [
        "key",
        "name",
        "tier"
      ],
      "properties": {
        "key": {
          "type": "string",
          "description": "The plan the organization is on, as an identifier that is never\nrenamed or reused: `free` for the free plan, or a paid plan's key.\nCompare against it and show `name`. On `free`, usage counts the\nday's lookups answered with every field, its daily trial.\n"
        },
        "name": {
          "type": "string",
          "description": "The plan's name, as the site and console show it: `Unlimited` for\nthe free plan. Show this rather than a name built from `key`: a\nplan's name can change, and its key never does.\n"
        },
        "tier": {
          "type": "string",
          "enum": [
            "free",
            "starter",
            "scale",
            "max"
          ],
          "description": "The field tier, which decides how much of a lookup answer comes\nback; `free` is the free plan's. This list never gains a value: a\nnew plan reports one of these. What each tier includes is documented\non the lookup endpoint rather than repeated here, so there is one\nplace it can be wrong.\n"
        }
      }
    },
    "EntitlementUsage": {
      "type": "object",
      "required": [
        "requests",
        "quota",
        "hard_limit",
        "window_start",
        "window_end"
      ],
      "properties": {
        "requests": {
          "type": "integer",
          "format": "int64",
          "description": "Requests counted in the current window. The same number the lookup\nAPI gates on, and it can lag by a few seconds.\n"
        },
        "quota": {
          "type": "integer",
          "format": "int64",
          "description": "What the plan includes. Zero on a plan that includes none."
        },
        "hard_limit": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int64",
          "description": "Where full answers stop: past it, a paid key is answered with\nUnlimited's fields and `cap_reached: true`, uncharged, until the\nwindow ends or the cap is raised. `null` means never, which is the\nnormal state of an uncapped paid plan and is not the same as zero.\nAbove the quota and below this, requests are served and billed as\noverage.\n"
        },
        "window_start": {
          "type": "string",
          "format": "date-time",
          "description": "When the current allowance period began."
        },
        "window_end": {
          "type": "string",
          "format": "date-time",
          "description": "When the allowance next resets."
        }
      }
    }
  }
}