{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/leap-labs-com/json-schema/leap-labs-com-account-response-schema.json",
  "title": "AccountResponse",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/disco-openapi.json#/components/schemas/AccountResponse",
  "properties": {
    "user_id": {
      "type": "string",
      "title": "User Id",
      "description": "User UUID"
    },
    "email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Email",
      "description": "User email address"
    },
    "organization": {
      "$ref": "#/$defs/AccountOrganization"
    },
    "plan": {
      "$ref": "#/$defs/AccountPlan"
    },
    "credits": {
      "$ref": "#/$defs/AccountCredits"
    },
    "payment_method": {
      "$ref": "#/$defs/AccountPaymentMethod"
    },
    "stripe_publishable_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stripe Publishable Key",
      "description": "Stripe publishable key for client-side payment method tokenization"
    },
    "stripe_customer_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stripe Customer Id",
      "description": "Stripe customer ID"
    }
  },
  "type": "object",
  "required": [
    "user_id",
    "email",
    "organization",
    "plan",
    "credits",
    "payment_method",
    "stripe_publishable_key",
    "stripe_customer_id"
  ],
  "$defs": {
    "AccountCredits": {
      "properties": {
        "subscription": {
          "type": "integer",
          "title": "Subscription",
          "description": "Credits from subscription allowance"
        },
        "purchased": {
          "type": "integer",
          "title": "Purchased",
          "description": "Credits from pack purchases"
        },
        "total": {
          "type": "integer",
          "title": "Total",
          "description": "Total available credits"
        }
      },
      "type": "object",
      "required": [
        "subscription",
        "purchased",
        "total"
      ],
      "title": "AccountCredits"
    },
    "AccountOrganization": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Organization UUID"
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Organization name"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "AccountOrganization"
    },
    "AccountPaymentMethod": {
      "properties": {
        "on_file": {
          "type": "boolean",
          "title": "On File",
          "description": "Whether a payment method is attached"
        },
        "card_last4": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Card Last4",
          "description": "Last 4 digits of card"
        },
        "card_brand": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Card Brand",
          "description": "Card brand (visa, mastercard, etc.)"
        }
      },
      "type": "object",
      "required": [
        "on_file",
        "card_last4",
        "card_brand"
      ],
      "title": "AccountPaymentMethod"
    },
    "AccountPlan": {
      "properties": {
        "tier": {
          "type": "string",
          "title": "Tier",
          "description": "Current plan tier ID"
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Human-readable plan name"
        },
        "monthly_credits": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Monthly Credits",
          "description": "Credits included per month"
        },
        "price_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Price Usd",
          "description": "Monthly price in USD"
        }
      },
      "type": "object",
      "required": [
        "tier",
        "name",
        "monthly_credits",
        "price_usd"
      ],
      "title": "AccountPlan"
    }
  }
}