{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lensmor/json-schema/lensmor-credit-balance-schema.json",
  "title": "CreditBalance",
  "description": "Current total and per-bucket Lensmor credit amounts for the API key owner.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lensmor-credits-api-openapi.yml#/components/schemas/CreditBalance",
  "type": "object",
  "required": [
    "totalAmount",
    "totalBalance",
    "subscriptionAmount",
    "subscriptionBalance",
    "addonAmount",
    "addonBalance",
    "addonExpireAt",
    "giftAmount",
    "giftBalance",
    "resetAt"
  ],
  "properties": {
    "totalAmount": {
      "type": "number",
      "description": "Total credits allocated across subscription, add-on, and gift buckets."
    },
    "totalBalance": {
      "type": "number",
      "description": "Total credits currently available to spend across all buckets."
    },
    "subscriptionAmount": {
      "type": "number",
      "description": "Credits allocated by the current subscription period."
    },
    "subscriptionBalance": {
      "type": "number",
      "description": "Subscription credits currently available to spend."
    },
    "addonAmount": {
      "type": "number",
      "description": "Total credits allocated through add-on purchases."
    },
    "addonBalance": {
      "type": "number",
      "description": "Add-on credits currently available to spend."
    },
    "addonExpireAt": {
      "type": [
        "number",
        "null"
      ],
      "description": "Unix timestamp for add-on credit expiry, or `null` when no expiry applies."
    },
    "giftAmount": {
      "type": "number",
      "description": "Total promotional or gifted credits allocated."
    },
    "giftBalance": {
      "type": "number",
      "description": "Promotional or gifted credits currently available to spend."
    },
    "resetAt": {
      "type": [
        "number",
        "null"
      ],
      "description": "Unix timestamp for the next subscription-credit reset, or `null` when unavailable."
    }
  }
}