{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/llm-broker-net/json-schema/llm-broker-net-broker-billing-status-schema.json",
  "title": "BrokerBillingStatus",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/llm-broker-net-openapi.json#/components/schemas/BrokerBillingStatus",
  "properties": {
    "balance_chf": {
      "type": "string"
    },
    "billed_until": {
      "format": "date",
      "type": [
        "string",
        "null"
      ]
    },
    "billing": {
      "enum": [
        "topup",
        "monthly"
      ],
      "type": "string"
    },
    "blocked_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "card": {
      "properties": {
        "brand": {
          "type": "string"
        },
        "expires": {
          "type": "string"
        },
        "last4": {
          "type": "string"
        }
      },
      "type": [
        "object",
        "null"
      ]
    },
    "card_setup_pending": {
      "type": "boolean"
    },
    "credit_limit_chf": {
      "type": "string"
    },
    "month_spent_chf": {
      "type": "string"
    },
    "topup": {
      "description": "Only for billing=topup, otherwise false.",
      "nullable": true,
      "oneOf": [
        {
          "type": "boolean"
        },
        {
          "properties": {
            "amount_chf": {
              "type": [
                "string",
                "null"
              ]
            },
            "enabled": {
              "type": "boolean"
            },
            "threshold_chf": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "type": "object"
        }
      ]
    }
  },
  "type": "object"
}