{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/blockvectra/json-schema/blockvectra-balance-response-schema.json",
  "title": "BalanceResponse",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/console.yaml#/components/schemas/BalanceResponse",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "balance_units",
    "balance_updated_at",
    "settled_through",
    "plan",
    "free_monthly_units",
    "max_calls_per_sec",
    "free_window_ends_at"
  ],
  "properties": {
    "balance_units": {
      "type": "integer",
      "format": "int64",
      "maximum": 9007199254740991,
      "description": "Settled balance (amount_units), can be negative. On free plan, remaining free grant constitutes this balance (free accounts have no paid top-ups; balance derived from grants)."
    },
    "balance_updated_at": {
      "$ref": "#/$defs/Timestamp"
    },
    "settled_through": {
      "description": "Cutoff timestamp of latest settlement; null if never settled.",
      "oneOf": [
        {
          "$ref": "#/$defs/Timestamp"
        },
        {
          "type": "null"
        }
      ]
    },
    "plan": {
      "type": "string",
      "enum": [
        "free",
        "paid"
      ],
      "description": "Account plan: `free` (free tier, no paid top-ups) or `paid` (paid tier, after first paid top-up)."
    },
    "free_monthly_units": {
      "description": "Free balance replenishment target (amount_units); null for paid tier. The historical field name does not imply a calendar month. At the end of a usage-started window (currently 30 days), eligible free accounts below the target are topped up to it; no accumulation or reduction of remaining credit.",
      "type": [
        "integer",
        "null"
      ],
      "format": "int64",
      "maximum": 9007199254740991
    },
    "max_calls_per_sec": {
      "description": "Per-second call limit per account for free tier; null for paid tier. Token bucket capacity and refill rate equal this value, shared across all keys, chains, and Data API for the account. Each call in batch counted individually.",
      "type": [
        "integer",
        "null"
      ],
      "format": "int64",
      "maximum": 9007199254740991
    },
    "free_window_ends_at": {
      "description": "Expiration timestamp of the current open free usage window (ISO 8601 UTC); null if account has no open window or is on the paid plan.",
      "oneOf": [
        {
          "$ref": "#/$defs/Timestamp"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "Timestamp": {
      "type": "string",
      "format": "date-time",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$",
      "description": "RFC 3339 UTC, second precision, ending in `Z` (`2026-09-26T08:00:00Z`); no fractional seconds, without `+00:00` timezone offsets."
    }
  }
}