{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zvid-io/json-schema/zvid-io-credit-balance-schema.json",
  "title": "CreditBalance",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zvid-io-credits-api-openapi.yml#/components/schemas/CreditBalance",
  "type": "object",
  "properties": {
    "balance": {
      "type": "integer",
      "description": "Total available credits from subscription and add-on pools"
    },
    "subscriptionCredits": {
      "type": "integer",
      "description": "Credits remaining in the current subscription period"
    },
    "addonCredits": {
      "type": "object",
      "description": "Add-on credit pool and historical add-on totals",
      "properties": {
        "balance": {
          "type": "integer",
          "description": "Available add-on credits"
        },
        "totalEarned": {
          "type": "integer",
          "description": "Total add-on credits earned over all time"
        },
        "totalSpent": {
          "type": "integer",
          "description": "Total add-on credits spent over all time"
        }
      },
      "required": [
        "balance",
        "totalEarned",
        "totalSpent"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "balance",
    "subscriptionCredits",
    "addonCredits"
  ],
  "additionalProperties": false
}