{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/audiopod-ai/json-schema/audiopod-ai-auto-topup-config-schema.json",
  "title": "AutoTopupConfig",
  "description": "Current automatic top-up settings, saved card and usage counters",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/audiopod-ai-api-wallet-api-openapi.yml#/components/schemas/AutoTopupConfig",
  "properties": {
    "enabled": {
      "type": "boolean",
      "title": "Enabled"
    },
    "threshold_cents": {
      "type": "integer",
      "title": "Threshold Cents"
    },
    "threshold_usd": {
      "type": "string",
      "title": "Threshold Usd"
    },
    "topup_amount_cents": {
      "type": "integer",
      "title": "Topup Amount Cents"
    },
    "topup_amount_usd": {
      "type": "string",
      "title": "Topup Amount Usd"
    },
    "max_topups_per_day": {
      "type": "integer",
      "title": "Max Topups Per Day"
    },
    "monthly_cap_cents": {
      "type": "integer",
      "title": "Monthly Cap Cents"
    },
    "monthly_cap_usd": {
      "type": "string",
      "title": "Monthly Cap Usd"
    },
    "has_payment_method": {
      "type": "boolean",
      "title": "Has Payment Method"
    },
    "card_brand": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Card Brand"
    },
    "card_last4": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Card Last4"
    },
    "day_charge_count": {
      "type": "integer",
      "title": "Day Charge Count"
    },
    "month_charged_cents": {
      "type": "integer",
      "title": "Month Charged Cents"
    },
    "last_charged_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Charged At"
    },
    "next_attempt_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Attempt At"
    },
    "consecutive_failures": {
      "type": "integer",
      "title": "Consecutive Failures"
    },
    "disabled_reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Disabled Reason"
    },
    "disabled_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Disabled At"
    },
    "limits": {
      "$ref": "#/$defs/AutoTopupLimits"
    }
  },
  "type": "object",
  "required": [
    "enabled",
    "threshold_cents",
    "threshold_usd",
    "topup_amount_cents",
    "topup_amount_usd",
    "max_topups_per_day",
    "monthly_cap_cents",
    "monthly_cap_usd",
    "has_payment_method",
    "day_charge_count",
    "month_charged_cents",
    "consecutive_failures",
    "limits"
  ],
  "$defs": {
    "AutoTopupLimits": {
      "properties": {
        "min_threshold_cents": {
          "type": "integer",
          "title": "Min Threshold Cents"
        },
        "max_threshold_cents": {
          "type": "integer",
          "title": "Max Threshold Cents"
        },
        "min_amount_cents": {
          "type": "integer",
          "title": "Min Amount Cents"
        },
        "max_amount_cents": {
          "type": "integer",
          "title": "Max Amount Cents"
        },
        "max_per_day": {
          "type": "integer",
          "title": "Max Per Day"
        },
        "min_monthly_cap_cents": {
          "type": "integer",
          "title": "Min Monthly Cap Cents"
        },
        "max_monthly_cap_cents": {
          "type": "integer",
          "title": "Max Monthly Cap Cents"
        }
      },
      "type": "object",
      "required": [
        "min_threshold_cents",
        "max_threshold_cents",
        "min_amount_cents",
        "max_amount_cents",
        "max_per_day",
        "min_monthly_cap_cents",
        "max_monthly_cap_cents"
      ],
      "title": "AutoTopupLimits",
      "description": "Server-enforced bounds for the auto top-up settings"
    }
  }
}