{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openmayhem-ai/json-schema/openmayhem-ai-balance-schema.json",
  "title": "Balance",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openmayhem-ai-openapi.json#/components/schemas/Balance",
  "type": "object",
  "required": [
    "object",
    "posted",
    "reserved",
    "available"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "balance"
    },
    "posted": {
      "$ref": "#/$defs/UsdDecimal"
    },
    "reserved": {
      "$ref": "#/$defs/UsdDecimal"
    },
    "available": {
      "$ref": "#/$defs/UsdDecimal"
    },
    "rails": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "posted": {
            "$ref": "#/$defs/UsdDecimal"
          },
          "reserved": {
            "$ref": "#/$defs/UsdDecimal"
          },
          "available": {
            "$ref": "#/$defs/UsdDecimal"
          }
        }
      }
    }
  },
  "$defs": {
    "UsdDecimal": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$",
      "description": "Non-negative decimal USD string with at most 6 decimal places, parsed with exact fixed-point arithmetic."
    }
  }
}