{
  "openapi": "3.1.1",
  "info": {
    "title": "Ocelot℠ Core",
    "version": "3.3.0",
    "summary": "Household portfolio optimization and wealth-strategy recommendations via\nMerton continuous-time portfolio theory with CRRA utility.\n",
    "description": "Ocelot℠ Core is a portfolio-optimization API operated by\n**Advisory API Systems LLC** (CRD #330083), a California state-registered\ninvestment adviser. The API applies Merton continuous-time portfolio theory\nwith constant-relative-risk-aversion (CRRA) utility to compute the optimal\nallocation of a household's investable wealth between the Empirical Global\nMarket Portfolio (EGMP) and a risk-free asset.\n\nThe EGMP is the *investable* global market portfolio: every asset class\nthat financial investors can buy and hold, sized at the market value of\nwhat they hold (the basis of Doeswijk, Lam & Swinkels 2020, State Street\n2025 and Goldman Sachs 2025) and delivered through one index fund per\nclass — currently eighteen funds (EGMP-18i; digital assets are three of\nthem, bitcoin, ether and XRP, each held through a fund that owns only\nthat coin). It is not the total-wealth\nportfolio of the pricing theory: owner-occupied housing, private businesses\nand human capital are not lines of it, because no investor can hold them;\nthey enter the calculation as the household's background wealth. Listed\nreal-estate companies are inside the stock funds at market weight, so the\nportfolio has no real-estate line; the real-estate fund VNQ appears in the\nderivation only as the proxy against which a household's real estate is\nmeasured. The lines and their weights are returned at runtime.\n\nThe calculation incorporates **all** of the household's economic assets:\nSocial Security, Medicare, pensions, human capital, real estate, vehicles,\nannuities, life insurance cash values, bank CDs, business interests, and\nother background wealth. CAPM-based discount rates and actuarial life\ntables are used to compute present values, and an iterative solver produces\nafter-tax expected returns and covariances.\n\n## Unit of analysis\n\nThe unit of analysis is the **household** — either a single individual\n(`client`) or a married couple (`client` + `spouse`). Risk tolerance is\nelicited via **revealed preference**: the maximum insurance premium the\nhousehold would pay to avoid a specified loss (`max_premium`), not through\na behavioral questionnaire.\n\n## Total-wealth framework\n\n- **Background wealth** — assets held fixed within the optimization\n  (Social Security, pensions, Medicare, primary residence, retained real\n  estate, human capital, retained business interests, annuities, life\n  insurance cash values, bank CDs, and miscellaneous illiquid assets).\n  These influence the optimal allocation but are **not** themselves\n  reallocated.\n- **Allocatable wealth** — the portion subject to optimization. The API\n  determines the fraction to invest in the Empirical Global Market\n  Portfolio versus the risk-free asset, given the household's risk\n  tolerance and the covariance structure of all assets.\n\n## Authentication\n\nThree authentication modes are supported. Exactly **one** is used on each\nrequest.\n\n- **`X-User-Token`** — RIA clients and other integrators, pre-provisioned\n  with a static token and billed monthly via Stripe graduated metered\n  billing. The payment method on file is charged automatically at\n  calendar month-end. Tier prices for successful `/core` calls\n  within a calendar month: 1–25 calls @ $34.95, 26–100 @ $27.95,\n  101+ @ $21.95.\n- **`X-Payment-Intent`** — pay-per-call individual clients. The caller\n  first posts to `POST /create-payment-intent` with a Stripe\n  `payment_method_id`, confirms the returned `client_secret` on the\n  client side via Stripe.js / Stripe Elements, then passes the\n  `payment_intent_id` on the header `X-Payment-Intent` when calling\n  `/core`. The card is captured **only** on a successful response.\n- **`X-Admin-Token`** — reserved for administrative endpoints (not\n  otherwise used in this version of the public spec).\n\nThe `/health`, `/openapi.json`, `/docs`, `/spec`, and\n`/create-payment-intent` endpoints require no authentication. All other\nendpoints require exactly one of the tokens above.\n\n## Pricing\n\nTwo segments:\n\n- **Individual Clients (pay-per-call):** Flat **$79.95** per successful\n  `/core` call. Charged at card capture.\n- **RIA Clients (X-User-Token):** Stripe graduated metered billing per\n  calendar month; payment method on file charged automatically at\n  month-end. Tiers: 1–25 calls @ $34.95, 26–100 @ $27.95, 101+ @ $21.95.\n\nFailed requests are never billed:\n- `/core` 4xx responses cancel the PaymentIntent authorization so no\n  hold persists on the card.\n- `/core` 5xx responses likewise cancel the hold.\n- Pay-per-call results are delivered only after the card capture succeeds.\n  In the rare event that capture fails after the allocation has been\n  computed, the response is still delivered with an explanatory\n  `payment_warning` field and **no charge is made** (see\n  `AdviceResponse.payment_warning`).\n\n## Residency and registration\n\nAdvisory API Systems LLC is currently registered only in the **State of\nCalifornia**. Both client and (if applicable) spouse must reside in\nCalifornia. Specifically:\n\n- `client.personal_info.address.state == \"CA\"`\n- `client.personal_info.address.zip_code ∈ [90000, 96199]`\n- If married: the spouse is subject to the same two constraints.\n\n## Community property\n\nCommunity-property states for optimization purposes are AZ, CA, ID, LA, NV,\nNM, TX, WA, WI. When the household's state is community-property, an\nownership of `community` is meaningful; `joint` and `community` are only\nmeaningful when the client is married.\n\n## Duplicate detection\n\nWhen a `spouse` block is supplied, the API automatically deduplicates\nassets across the client and spouse using these keys:\n\n| Asset           | Duplicate-detection key                          |\n|-----------------|---------------------------------------------------|\n| Employments     | `employer_name` + `employee_id`                   |\n| Businesses      | `ein`                                             |\n| IRA accounts    | `account_id`                                      |\n| 401(k) accounts | `account_id`                                      |\n| Pensions        | `pension_id`                                      |\n| Annuities       | `issuer` + `contract_number`                      |\n| Life insurance  | `insurer` + `policy_number`                       |\n| Real estate     | `address` + `city` + `state` + `zip`              |\n| Vehicles        | `vin`                                             |\n| Bank CDs        | `institution.name` + `account_number`             |\n\nDuplicate employments or businesses are surfaced as non-blocking\n`data_quality_warnings` on the success path, because a silently\ndouble-counted job would distort the human-capital PV and the resulting\nallocation.\n\n## Input validation\n\nAll `/core` requests are validated against the JSON Schema compiled\nfrom `input_spec.yaml`. Three families of rules are enforced:\n\n1. **Schema rules** — required fields, types, enums, numeric ranges.\n   Violations surface with `rule: schema.<keyword>`.\n2. **Array-item rules** — per-array-type conditional rules (e.g. a\n   `Multi-Family` property must have `units` in 2–4). Violations surface\n   with `rule: array_item_rules.<array_name>`.\n3. **Cross-field rules** — named higher-level consistency rules\n   (`marital_status_consistency`, `california_residency`,\n   `claiming_age_consistency`, `rents_xor_owner_occupied_per_person`,\n   `separate_property_only_when_separate_returns`,\n   `spouse_tax_filing_status_mirrors_client`,\n   `ssa_earnings_min_one_entry`). Violations surface with `rule:` equal to\n   the rule name.\n\nSee `ValidationDetail` below for the full taxonomy.\n",
    "contact": {
      "name": "Advisory API Systems LLC",
      "url": "https://ria.us",
      "email": "api@ria.us"
    },
    "license": {
      "name": "Proprietary — terms defined in the User Agreement",
      "url": "https://ria.us/agreement/User_Agreement.html"
    },
    "termsOfService": "https://ria.us/agreement/User_Agreement.html"
  },
  "servers": [
    {
      "url": "/",
      "description": "Same origin as the page that loaded this spec (the web server proxies the API paths to Plumber)"
    }
  ],
  "tags": [
    {
      "name": "System",
      "description": "Unauthenticated utility endpoints — health check, OpenAPI spec,\nSwagger UI, and the input-validation spec.\n"
    },
    {
      "name": "Payments",
      "description": "Stripe PaymentIntent authorization for pay-per-call individual clients.\n"
    },
    {
      "name": "Core",
      "description": "Household portfolio optimization and wealth-strategy recommendations.\n"
    }
  ],
  "security": [
    {
      "UserTokenAuth": []
    },
    {
      "PaymentIntentAuth": []
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "API health check",
        "description": "Returns the API's current health status, a server timestamp in the\n`America/Los_Angeles` time zone, the developer identifier, and the\nrunning API version. Requires no authentication. Suitable for uptime\nprobes.\n",
        "operationId": "healthCheck",
        "security": [],
        "responses": {
          "200": {
            "description": "API is healthy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                },
                "examples": {
                  "healthy": {
                    "summary": "Healthy response",
                    "value": {
                      "status": "healthy",
                      "timestamp": "2026-04-20 11:42:37 PDT",
                      "api_developer": "Advisory API Systems LLC",
                      "version": "3.3.0"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "OpenAPI specification (JSON)",
        "description": "Returns **this** specification as JSON, generated server-side from the\ncanonical `openapi.yaml` on each request. No authentication required.\n\nUseful for tooling (Postman import, Swagger UI, client-SDK generators).\n",
        "operationId": "getOpenApiSpec",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 specification document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A full OpenAPI 3.1 document. The schema is open-ended\n(`additionalProperties: true`) to avoid having the spec\nattempt to describe itself recursively.\n",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/docs": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Interactive API documentation (Swagger UI)",
        "description": "Serves a Swagger UI page that loads `/openapi.json` and renders\ninteractive documentation. Includes an input field for supplying an\n`X-User-Token` when using the built-in \"Try it out\" requests. No\nauthentication required to view the page itself.\n",
        "operationId": "getSwaggerUi",
        "security": [],
        "responses": {
          "200": {
            "description": "Swagger UI HTML page.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "Rendered HTML document."
                }
              }
            }
          }
        }
      }
    },
    "/bundle/{id}": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Download the results package of a /core run",
        "description": "RESULTS-BUNDLE-V3.2. Returns the client's zip whose link `/core`\nplaced in `results_bundle.url`, under the name in\n`results_bundle.file_name` (`Ocelot Core results - <Last name> -\n<YYYY-MM-DD HHMM> - client.zip`): the request as received (Social\nSecurity numbers masked), the client's results JSON, and the\nclient report as PDF (the adviser's report less its technical\nparts; no LaTeX source in the client's package). The\nadviser's package (the full response and the full report) is not\nserved here; it is filed on Dropbox only. The id is a random\n128-bit token that only that response carried, so no other\nauthentication is required; the package is kept for\n`results_bundle.expires_after_hours` (72 by default) and then\nremoved.\n",
        "operationId": "getResultsBundle",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The zip file (Content-Disposition attachment).",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or expired package.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/bundle/{id}/pdf": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Download the client report of a /core run as a PDF",
        "description": "RESULTS-BUNDLE-V3.6 (RESULTS-PAGE-V1.0). Returns the client report\nalone -- the PDF inside the zip of `GET /bundle/{id}` -- under the\nname `Ocelot Core results - <Last name> - <YYYY-MM-DD HHMM> - client\nreport.pdf`, served inline (Content-Disposition inline) so that a\nbrowser or a phone opens it in its own viewer. The link is\n`results_bundle.pdf_url` in the `/core` response; it is absent when\nthe PDF could not be produced on the server (`results_bundle.pdf`\nfalse; the zip then carries the LaTeX source). Same id, same\nlifetime and the same absence of any other authentication as the\nzip.\n",
        "operationId": "getResultsBundlePdf",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The PDF (Content-Disposition inline).",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or expired package, or no PDF was produced for it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/spec": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Input-validation specification",
        "description": "Returns `input_spec.yaml` serialized as JSON. This is the same\ndocument the backend compiles into its JSON Schema validator. The\nfrontend (`api.html`) fetches this endpoint to populate dropdown\nenums, numeric min/max values, and per-field hints — so the UI stays\nin sync with validation without duplicating rule definitions.\n\nNo authentication required.\n\nResponse shape (top-level keys): `meta`, `enums`, `ranges`, `required`,\n`array_items`, `conditional`, `error_response`.\n",
        "operationId": "getInputSpec",
        "security": [],
        "responses": {
          "200": {
            "description": "Input validation specification, serialized as JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpecResponse"
                }
              }
            }
          }
        }
      }
    },
    "/create-payment-intent": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Authorize a pay-per-call Stripe PaymentIntent",
        "description": "Creates a Stripe PaymentIntent in **manual-capture** mode authorizing\na charge of $79.95 for one upcoming `/core` call. The returned\n`client_secret` should be confirmed client-side with Stripe.js /\nStripe Elements (which handles 3-D Secure if the card requires it).\n\nAfter confirmation, pass the returned `payment_intent_id` as\n`X-Payment-Intent` on the subsequent `/core` call.\n\nThe card is captured only on a successful `/core` response. If\nthe `/core` call fails validation, errors, or you never make\nthe follow-up call, the authorization is cancelled and the card is\n**never charged**.\n\nThis endpoint requires no authentication. A browser (or other PCI-\ncompliant environment) is strongly recommended — curl-based flows\ncannot complete 3-D Secure and will break if the card triggers it.\n",
        "operationId": "createPaymentIntent",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentIntentRequest"
              },
              "examples": {
                "typical": {
                  "summary": "Typical request",
                  "value": {
                    "payment_method_id": "pm_1PExAmPlEtOkEn123"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PaymentIntent authorized in manual-capture mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntentResponse"
                },
                "examples": {
                  "typical": {
                    "summary": "Successful authorization",
                    "value": {
                      "status": "success",
                      "payment_intent_id": "pi_3NXyZ1AbCdEfGhIj0KlMnOpQ",
                      "client_secret": "pi_3NXyZ1AbCdEfGhIj0KlMnOpQ_secret_AbCdEfGh",
                      "amount": 79.95
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request — body absent, or `payment_method_id` missing / not `pm_*`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "missing_body": {
                    "summary": "No body supplied",
                    "value": {
                      "status": "error",
                      "message": "Request body required"
                    }
                  },
                  "bad_pm": {
                    "summary": "Invalid payment_method_id",
                    "value": {
                      "status": "error",
                      "message": "Valid payment_method_id required"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Stripe declined the payment method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "declined": {
                    "summary": "Card declined",
                    "value": {
                      "status": "error",
                      "error": "Payment Failed",
                      "message": "Your card was declined."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. Retry; if persistent, contact api@ria.us.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/core": {
      "post": {
        "tags": [
          "Core"
        ],
        "summary": "Compute household portfolio allocation and wealth strategies",
        "description": "The primary Ocelot℠ Core endpoint. Accepts a complete household profile\n— personal information, financial information, employments,\nbusinesses, retirement accounts, real estate, vehicles, bank CDs,\nlife insurance, annuities, and SSA earnings records — and returns:\n\n- The risk-aversion coefficient **γ** derived from the household's\n  `max_premium`.\n- Total, background, and allocatable household wealth.\n- Optimal allocation between the **Empirical Global Market Portfolio\n  (EGMP, investable basis)** and the risk-free asset.\n- Per-ticker EGMP investment amounts (one ETF per line; eighteen at the\n  current measurement).\n- After-tax portfolio statistics (expected return, standard\n  deviation, Sharpe ratio) for both the allocatable portion and the\n  total portfolio.\n- A **Household Economic Balance Sheet** (present-value based).\n- A **Retirement Accounts by Type** breakdown.\n- A **Household Income & Expense Summary**.\n- The allocation is derived on the measured market portfolio\n  (gmp_builder's `gmp_weights.json`) from the household's balance\n  sheet; optional top-level `reserves` (near-term expenses to be\n  paid with certainty) are taken out first and placed in Treasury\n  instruments by due date. The response carries `reserves` and\n  `optimal_portfolio_details` (the per-line derivation, the\n  risk-free layer, the account instructions, a plain-text report).\n- Curated wealth-building and wealth-preservation **strategy\n  recommendations**.\n- Non-blocking **data-quality warnings**, when applicable.\n\n### Authentication\n\nSupply **one** of:\n\n- `X-User-Token` header (RIA / integrator — metered monthly billing), or\n- `X-Payment-Intent` header (pay-per-call — card captured only on success).\n\n### Spouse handling\n\nIf `client.personal_info.married == true`, the `spouse` object is\nrequired and must contain both `personal_info` and `financial_info`.\nAssets supplied under both client and spouse that share a\nduplicate-detection key (see the introduction) are deduplicated\nautomatically, with a warning surfaced in `data_quality_warnings`\nwhen the duplicate is an employment or business.\n",
        "operationId": "core",
        "security": [
          {
            "UserTokenAuth": []
          },
          {
            "PaymentIntentAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdviceRequest"
              },
              "examples": {
                "single_client": {
                  "summary": "Single unmarried client (short example)",
                  "description": "Minimal viable request for a single client with one\nowner-occupied home, one vehicle, one 401(k), and several\npensions. Each pension's `type` accepts `government`,\n`military`, or `private`; this drives both its valuation\nbeta and per-source state income-tax treatment (defaults\nto `private`).\n",
                  "value": {
                    "client": {
                      "personal_info": {
                        "name": {
                          "first_name": "Henry",
                          "last_name": "Mason"
                        },
                        "address": {
                          "street_number": "4248",
                          "street_name": "La Salle Ave",
                          "city": "Culver City",
                          "state": "CA",
                          "zip_code": "90232"
                        },
                        "email_address": "api@ria.us",
                        "dob": "1930-06-18",
                        "gender": "male",
                        "married": false
                      },
                      "financial_info": {
                        "max_premium": 150000,
                        "household_liquid_wealth": 2131650.27,
                        "tax_filing_status": "single",
                        "quarters_of_coverage": 88,
                        "ssa_earnings_record": [
                          {
                            "year": 1974,
                            "earnings": 2044
                          },
                          {
                            "year": 1975,
                            "earnings": 1407
                          }
                        ],
                        "actual_monthly_benefit": 365,
                        "actual_claiming_age": 65,
                        "optimize_claiming": false,
                        "retirement": {
                          "defined_contribution_plans": {
                            "accounts_401k": [
                              {
                                "account_id": "401K-778899",
                                "account_type": "traditional",
                                "employer": "County of Podunk",
                                "custodian": "Podunk Insurance Company",
                                "balance": 73231.29
                              }
                            ]
                          },
                          "defined_benefit_plans": {
                            "pensions": [
                              {
                                "pension_id": "RETPEN",
                                "plan_type": "defined_benefit",
                                "type": "government",
                                "employer": "County of Coconut",
                                "administrator": "Coconut Administrator",
                                "status": "retired",
                                "annual_amount": 126600.48
                              }
                            ]
                          }
                        },
                        "real_estate": [
                          {
                            "address": "4248 La Salle Ave",
                            "city": "Culver City",
                            "state": "CA",
                            "zip": "90232",
                            "type": "Single Family",
                            "bedrooms": 5,
                            "bathrooms": 5,
                            "sqft": 2627,
                            "market_value": 1450000,
                            "monthly_rent": 6500,
                            "mortgage_balance": 0,
                            "purchase_price": 60000,
                            "purchase_year": 1974,
                            "purchase_month": 3,
                            "monthly_payment": 0,
                            "ownership": "individual",
                            "owner_occupied": true
                          }
                        ],
                        "vehicles": [
                          {
                            "vin": "1N4AL3AP4EC144655",
                            "mileage": 70978,
                            "purchase_price": 17000,
                            "current_value": 7500,
                            "purchase_year": 2015,
                            "purchase_month": 3,
                            "amount_owed": 0,
                            "monthly_payment": 0,
                            "ownership": "individual"
                          }
                        ]
                      }
                    }
                  }
                },
                "married_couple": {
                  "summary": "Married couple (long example)",
                  "description": "A married client and spouse with employments, businesses,\nreal estate, IRAs, 401(k)s, pensions, a deferred joint-life\nannuity with COLA, life insurance, a vehicle, and a bank\nCD.\n",
                  "value": {
                    "client": {
                      "personal_info": {
                        "name": {
                          "first_name": "John",
                          "last_name": "Smith"
                        },
                        "address": {
                          "street_number": "4240",
                          "street_name": "Baldwin Ave",
                          "city": "Culver City",
                          "state": "CA",
                          "zip_code": "90232"
                        },
                        "email_address": "john@example.com",
                        "dob": "1980-02-10",
                        "gender": "male",
                        "married": true,
                        "phone": {
                          "home_phone": "310-555-1212",
                          "mobile_phone": "213-555-1212"
                        }
                      },
                      "financial_info": {
                        "max_premium": 142000,
                        "household_liquid_wealth": 1000000,
                        "tax_filing_status": "married filing jointly",
                        "quarters_of_coverage": 92,
                        "ssa_earnings_record": [
                          {
                            "year": 2002,
                            "earnings": 142410
                          },
                          {
                            "year": 2003,
                            "earnings": 143320
                          },
                          {
                            "year": 2004,
                            "earnings": 144330
                          },
                          {
                            "year": 2005,
                            "earnings": 146330
                          },
                          {
                            "year": 2006,
                            "earnings": 148200
                          },
                          {
                            "year": 2007,
                            "earnings": 150230
                          },
                          {
                            "year": 2008,
                            "earnings": 150300
                          },
                          {
                            "year": 2009,
                            "earnings": 149780
                          },
                          {
                            "year": 2010,
                            "earnings": 149280
                          },
                          {
                            "year": 2011,
                            "earnings": 150050
                          },
                          {
                            "year": 2012,
                            "earnings": 151020
                          },
                          {
                            "year": 2013,
                            "earnings": 153590
                          },
                          {
                            "year": 2014,
                            "earnings": 153660
                          },
                          {
                            "year": 2015,
                            "earnings": 156520
                          },
                          {
                            "year": 2016,
                            "earnings": 159040
                          },
                          {
                            "year": 2017,
                            "earnings": 161140
                          },
                          {
                            "year": 2018,
                            "earnings": 163180
                          },
                          {
                            "year": 2019,
                            "earnings": 168700
                          },
                          {
                            "year": 2020,
                            "earnings": 168010
                          },
                          {
                            "year": 2021,
                            "earnings": 170780
                          },
                          {
                            "year": 2022,
                            "earnings": 174580
                          },
                          {
                            "year": 2023,
                            "earnings": 180610
                          },
                          {
                            "year": 2024,
                            "earnings": 183730
                          }
                        ],
                        "other_annual_income": 19000,
                        "other_income_ownership": "individual",
                        "other_background_wealth": 25000,
                        "other_background_wealth_ownership": "individual",
                        "employments": [
                          {
                            "employer_name": "Acme Software Company",
                            "location": {
                              "city": "Culver City",
                              "state": "CA"
                            },
                            "employee_id": "328",
                            "job_title": "Software Engineer",
                            "occupation_category": 6,
                            "income": 184000
                          }
                        ],
                        "businesses": [
                          {
                            "business_name": "John's Hardware LLC",
                            "ein": "78-5566676",
                            "business_category": 13,
                            "net_income": 130000,
                            "ownership": "community"
                          }
                        ],
                        "retirement": {
                          "defined_contribution_plans": {
                            "accounts_IRA": [
                              {
                                "account_id": "IRA-123456789",
                                "account_type": "traditional",
                                "custodian": "Fidelity Investments",
                                "balance": 177500
                              },
                              {
                                "account_id": "IRA-55308",
                                "account_type": "roth",
                                "custodian": "FFH",
                                "balance": 134000
                              },
                              {
                                "account_id": "IRA-52252",
                                "account_type": "sep",
                                "custodian": "HWW",
                                "balance": 40000
                              },
                              {
                                "account_id": "IRA-4432",
                                "account_type": "simple",
                                "custodian": "MMO",
                                "balance": 22000
                              }
                            ],
                            "accounts_401k": [
                              {
                                "account_id": "778899",
                                "account_type": "traditional",
                                "employer": "Acme Software Company",
                                "custodian": "Custodial Company of America",
                                "balance": 284365.15
                              },
                              {
                                "account_id": "77665",
                                "account_type": "roth",
                                "employer": "ABC Corp",
                                "custodian": "Fidelis",
                                "balance": 23000
                              },
                              {
                                "account_id": "7878990",
                                "account_type": "solo",
                                "employer": "XYZ LLC",
                                "custodian": "HHEU",
                                "balance": 12000
                              }
                            ]
                          },
                          "defined_benefit_plans": {
                            "pensions": [
                              {
                                "pension_id": "P8863760",
                                "plan_type": "defined_benefit",
                                "type": "government",
                                "employer": "City of Eureka",
                                "administrator": "HHTR",
                                "status": "vested",
                                "annual_amount": 68000
                              }
                            ]
                          },
                          "annuities": {
                            "contracts": [
                              {
                                "issuer": "Pac Life",
                                "contract_number": "ANN-66780",
                                "base_payment_amount": 1000,
                                "life": true,
                                "term_years": 0,
                                "ownership": "community",
                                "investment_in_contract": 10000,
                                "is_qualified": false,
                                "deferral_period": 10,
                                "benefit_growth_rate": 0.06,
                                "has_cola": true,
                                "cola_rate": 0.035,
                                "is_joint_life": true,
                                "survivor_percentage": 1
                              }
                            ]
                          }
                        },
                        "life_insurance": {
                          "policies": [
                            {
                              "insurer": "NW Life",
                              "policy_number": "INS-5548",
                              "policy_type": "whole",
                              "face_amount": 100000,
                              "net_surrender_value": 25000,
                              "annual_premium": 1000,
                              "ownership": "community"
                            }
                          ]
                        },
                        "real_estate": [
                          {
                            "address": "4240 Baldwin Ave",
                            "city": "Culver City",
                            "state": "CA",
                            "zip": "90232",
                            "type": "Multi-Family",
                            "bedrooms": 4,
                            "bathrooms": 2,
                            "sqft": 2000,
                            "market_value": 1250000,
                            "monthly_rent": 7000,
                            "mortgage_balance": 0,
                            "purchase_price": 340000,
                            "purchase_year": 2008,
                            "purchase_month": 1,
                            "monthly_payment": 0,
                            "ownership": "community",
                            "units": 2,
                            "owner_occupied": true
                          }
                        ],
                        "vehicles": [
                          {
                            "vin": "1N4AL3AP4EC144655",
                            "mileage": 70382,
                            "purchase_price": 17000,
                            "current_value": 7500,
                            "purchase_year": 2015,
                            "purchase_month": 3,
                            "amount_owed": 0,
                            "monthly_payment": 0,
                            "ownership": "community"
                          }
                        ],
                        "bank_CDs": [
                          {
                            "institution": {
                              "name": "Chase",
                              "branch": "5th and Spring"
                            },
                            "account_number": "CD-66580",
                            "title": "36 Month CD",
                            "principal": 0,
                            "account_balance": 36000,
                            "currency": "USD",
                            "issue_date": "2025-04-12",
                            "maturity_date": "2029-04-12",
                            "current_apy": 0.046,
                            "auto_renew": false,
                            "compounding_method": "daily",
                            "ownership": "community"
                          }
                        ]
                      }
                    },
                    "household_total_annual_expenses": 12000,
                    "spouse": {
                      "personal_info": {
                        "name": {
                          "first_name": "Jane",
                          "last_name": "Smith"
                        },
                        "address": {
                          "street_number": "4240",
                          "street_name": "Baldwin Ave",
                          "city": "Culver City",
                          "state": "CA",
                          "zip_code": "90232"
                        },
                        "email_address": "jane@example.com",
                        "dob": "1982-02-04",
                        "gender": "female"
                      },
                      "financial_info": {
                        "max_premium": 144000,
                        "tax_filing_status": "married filing jointly",
                        "quarters_of_coverage": 16,
                        "ssa_earnings_record": [
                          {
                            "year": 2014,
                            "earnings": 60000
                          },
                          {
                            "year": 2015,
                            "earnings": 65000
                          },
                          {
                            "year": 2016,
                            "earnings": 72000
                          },
                          {
                            "year": 2017,
                            "earnings": 80000
                          }
                        ],
                        "other_annual_income": 4000,
                        "other_income_ownership": "individual",
                        "other_background_wealth": 9000,
                        "other_background_wealth_ownership": "individual",
                        "employments": [
                          {
                            "employer_name": "Hotels, Inc.",
                            "location": {
                              "city": "Los Angeles",
                              "state": "CA"
                            },
                            "employee_id": "YH4458",
                            "job_title": "Manager",
                            "occupation_category": 7,
                            "income": 98000
                          }
                        ],
                        "businesses": [
                          {
                            "business_name": "Jane's Consulting",
                            "ein": "78-7765468",
                            "business_category": 14,
                            "net_income": 120000,
                            "ownership": "community"
                          }
                        ],
                        "retirement": {
                          "defined_contribution_plans": {
                            "accounts_IRA": [
                              {
                                "account_id": "SP-88214",
                                "account_type": "traditional",
                                "custodian": "HBX",
                                "balance": 10000
                              }
                            ],
                            "accounts_401k": [
                              {
                                "account_id": "SP4423",
                                "account_type": "roth",
                                "employer": "GGA Inc",
                                "custodian": "GUUE",
                                "balance": 5000
                              }
                            ]
                          },
                          "defined_benefit_plans": {
                            "pensions": [
                              {
                                "pension_id": "SPP-9980",
                                "plan_type": "defined_benefit",
                                "type": "private",
                                "employer": "GGU Inc",
                                "administrator": "ADM",
                                "status": "vested",
                                "annual_amount": 20000
                              }
                            ]
                          }
                        },
                        "real_estate": [
                          {
                            "address": "4248 La Salle Ave",
                            "city": "Culver City",
                            "state": "CA",
                            "zip": "90232",
                            "type": "Apartment",
                            "bedrooms": 15,
                            "bathrooms": 10,
                            "sqft": 8000,
                            "market_value": 2400000,
                            "monthly_rent": 14000,
                            "mortgage_balance": 0,
                            "purchase_price": 1236000,
                            "purchase_year": 2017,
                            "purchase_month": 3,
                            "monthly_payment": 0,
                            "ownership": "community",
                            "units": 5,
                            "owner_occupied": true
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Optimization completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdviceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON, or a request body that failed schema / array-\nitem / cross-field validation. The response `error` is always\n`validation_failed` (except for asset-validation failures, which\nsurface as `error: \"Asset validation failed\"`). `details[]`\nenumerates specific problems; it is empty when the body itself\nwas unparseable.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "missing_required_field": {
                    "summary": "Required field omitted",
                    "value": {
                      "status": "error",
                      "error": "validation_failed",
                      "message": "Request failed validation (1 issue). Your card has NOT been charged.",
                      "details": [
                        {
                          "field": "client.financial_info",
                          "message": "must have required property 'max_premium'",
                          "rule": "schema.required"
                        }
                      ]
                    }
                  },
                  "out_of_range": {
                    "summary": "Field present but outside allowed range",
                    "value": {
                      "status": "error",
                      "error": "validation_failed",
                      "message": "Request failed validation (1 issue). Your card has NOT been charged.",
                      "details": [
                        {
                          "field": "client.financial_info.max_premium",
                          "message": "must be > 50000",
                          "rule": "schema.exclusiveMinimum"
                        }
                      ]
                    }
                  },
                  "conditional_array_rule": {
                    "summary": "Array-item type-conditional rule violated",
                    "value": {
                      "status": "error",
                      "error": "validation_failed",
                      "message": "Request failed validation (1 issue). Your card has NOT been charged.",
                      "details": [
                        {
                          "field": "client.financial_info.real_estate[0].units",
                          "message": "units must be between 2 and 4 for Multi-Family",
                          "rule": "array_item_rules.real_estate"
                        }
                      ]
                    }
                  },
                  "cross_field_residency": {
                    "summary": "California-residency cross-field check failed",
                    "value": {
                      "status": "error",
                      "error": "validation_failed",
                      "message": "Request failed validation (1 issue). Your card has NOT been charged.",
                      "details": [
                        {
                          "field": "client.personal_info.address.state",
                          "message": "Client state must be 'CA' (service is California-only).",
                          "rule": "california_residency"
                        }
                      ]
                    }
                  },
                  "malformed_json": {
                    "summary": "Body not parseable as JSON",
                    "value": {
                      "status": "error",
                      "error": "validation_failed",
                      "message": "Invalid JSON in request body. Your card has NOT been charged.",
                      "details": []
                    }
                  },
                  "asset_validation_failure": {
                    "summary": "Real-estate address or VIN validation failed",
                    "value": {
                      "status": "error",
                      "error": "Asset validation failed",
                      "message": "Request failed asset validation (1 issue). Your card has NOT been charged.",
                      "details": [
                        {
                          "field": "client.financial_info.vehicles[0].vin",
                          "message": "VIN failed check-digit validation (49 CFR 565).",
                          "rule": "vehicle_vin_validation"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid `X-User-Token`. Only returned when\n`X-User-Token` authentication was attempted. Absent auth headers\nsurface as 402 instead, since pay-per-call is the default mode.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid_token": {
                    "summary": "Token not recognized or revoked",
                    "value": {
                      "status": "error",
                      "error": "Unauthorized",
                      "message": "Invalid or missing X-User-Token"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Missing, invalid, expired, or already-captured `X-Payment-Intent`.\nCallers should create a fresh PaymentIntent via\n`POST /create-payment-intent` and retry.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "missing_payment_intent": {
                    "summary": "No `X-Payment-Intent` header supplied",
                    "value": {
                      "status": "error",
                      "error": "Payment Required",
                      "message": "X-Payment-Intent header required for pay-per-call requests."
                    }
                  },
                  "invalid_payment_intent": {
                    "summary": "PaymentIntent expired, captured, or unknown",
                    "value": {
                      "status": "error",
                      "error": "Payment Required",
                      "message": "X-Payment-Intent is invalid, expired, or already captured."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error during optimization. Any pending\npay-per-call Stripe authorization is cancelled, so no charge is\nmade. Callers should retry with exponential backoff; if the\nerror persists, contact api@ria.us with the request payload and\ntimestamp.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "optimization_failure": {
                    "summary": "Unexpected error during optimization",
                    "value": {
                      "status": "error",
                      "error": "internal_error",
                      "message": "An internal error occurred during optimization. Your card has NOT been charged."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/allocate": {
      "post": {
        "tags": [
          "Core"
        ],
        "summary": "Optimal portfolio from a balance sheet given directly (allocation, reserves, account instructions)",
        "description": "The allocation procedure of `/core` on a balance sheet supplied\ndirectly, in the form the portfolio project's configuration uses:\nliquid wealth (funds, brokerage cash, checking), **reserves** for\nnear-term expenses that must be paid with certainty, the **background\nitems** (pensions, Social Security, Medicare, a house, obligations)\neach valued at its after-tax present value over a horizon, and the\nrisk aversion gamma. It returns the same allocation as `/core`'s\n`optimal_portfolio_details` and, on the same inputs, the same figures\nas the portfolio project's rebalancer:\n\n- the market portfolio is **read** from gmp_builder's\n  `gmp_weights.json` (schema `GMP-WEIGHTS-V1`), not estimated; its\n  implementation weights `x_i` are the speculative holding;\n- the reserves are taken out of liquid wealth and placed in Treasury\n  instruments by due date; the allocation is applied to the residue;\n- every background item is added, with its sign, to give the shadow\n  wealth `W~`;\n- `alpha* = premium / (gamma · sigma²)`, `m = (W~/W) · alpha*`,\n  `spec_i = m · x_i`, `q_i = Σ h_j H_j / W` on each hedged line, floors\n  where `spec − q < 0`, the spillover of each floored remainder onto\n  the surviving lines through regression coefficients measured from\n  three years of daily returns (covariance shrunk toward its\n  diagonal), the no-borrowing cap, the risky share and the risk-free\n  holding; a sensitivity table over gamma;\n- the **risk-free layer** (reserves by due date, the risk-free\n  holding in the Treasury money fund, checking) and ordered\n  **instructions for the accounts**, plus a plain-text report.\n\nThe body is either an `AllocationInputs` object or an object holding\none under `allocation_inputs`. Results are identical to the portfolio\nproject's when the same `gmp_weights.json` and the same price CSV\n(`covariance.prices_csv`) are used; with no price file the API fetches\nthe window from Yahoo Finance itself.\n\nAuthentication, rate limiting, usage logging and billing are those of\n`/core` (one use per successful call).\n",
        "operationId": "allocate",
        "security": [
          {
            "UserTokenAuth": []
          },
          {
            "PaymentIntentAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/AllocationInputs"
                  },
                  {
                    "type": "object",
                    "required": "allocation_inputs",
                    "properties": {
                      "allocation_inputs": {
                        "$ref": "#/components/schemas/AllocationInputs"
                      }
                    }
                  }
                ]
              },
              "examples": {
                "trust": {
                  "summary": "A retiree with a house, pensions, a care obligation and two reserves",
                  "value": {
                    "allocation_inputs": {
                      "label": "example household",
                      "gamma": 3,
                      "life_expectancy_years": 2.5,
                      "valuation_date": "2026-09-28",
                      "egmp": "gmp_weights.json",
                      "balance_sheet": {
                        "funds": 589390.12,
                        "brokerage_cash": 1260099.13,
                        "checking": 123257.05
                      },
                      "reserves": [
                        {
                          "purpose": "April tax balance",
                          "amount": 150000,
                          "due": "2027-04-15"
                        },
                        {
                          "purpose": "House preservation work",
                          "amount": 105000,
                          "due": "2027-03-01"
                        }
                      ],
                      "background_items": [
                        {
                          "name": "pensions",
                          "kind": "stream",
                          "annual": 177258,
                          "after_tax": 0.7,
                          "real_rate": 0.02,
                          "growth": 0,
                          "sign": 1
                        },
                        {
                          "name": "house",
                          "kind": "fixed",
                          "value": 2000000,
                          "sign": 1,
                          "loading": 0.6667,
                          "proxy": "VNQ"
                        },
                        {
                          "name": "care obligation",
                          "kind": "stream",
                          "annual": 272400,
                          "after_tax": 1,
                          "real_rate": 0.02,
                          "growth": 0.07,
                          "sign": -1
                        },
                        {
                          "name": "gift",
                          "kind": "lump",
                          "amount": 150000,
                          "nominal_rate": 0.04,
                          "sign": -1
                        }
                      ],
                      "accounts": {
                        "brokerage": "Schwab brokerage (...572)",
                        "checking": "Schwab Bank checking (...093)",
                        "treasury_fund": "SNSXX",
                        "checking_target": 30000
                      },
                      "cash_flow": {
                        "monthly_spending": 25000,
                        "monthly_income": 15600
                      },
                      "covariance": {
                        "prices_csv": "cov_prices.csv"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The allocation, the reserves, the risk-free layer, the instructions and the report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllocationResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON, a validation failure, or an input the procedure cannot run on (a missing file, a bad item, no prices). The card is not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid `X-User-Token`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Invalid or unauthorized `X-Payment-Intent`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Per-token rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "UserTokenAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-User-Token",
        "description": "Static API token issued by Advisory API Systems LLC to a registered\nRIA client. Successful `/core` calls are recorded as Stripe\nmetered-usage events and charged automatically each month against\nthe payment method on file, per the graduated tier schedule:\n1–25 calls/month @ $34.95, 26–100 @ $27.95, 101+ @ $21.95.\nPer-token rate limit: 20 requests/hour.\n"
      },
      "PaymentIntentAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Payment-Intent",
        "description": "A Stripe PaymentIntent ID (`pi_...`) previously authorized via\n`POST /create-payment-intent` and confirmed client-side with\nStripe.js / Stripe Elements. The authorization is captured ($79.95)\nonly on a successful `/core` response. On any failure mode the\nhold is cancelled and the card is never charged.\n"
      },
      "AdminTokenAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Admin-Token",
        "description": "Administrative token. Not used by any public endpoint in this\nversion of the spec; listed here for completeness.\n"
      }
    },
    "schemas": {
      "GenderEnum": {
        "type": "string",
        "enum": ["male", "female"],
        "description": "Used for actuarial life-expectancy calculations (separate male /\nfemale cohort life tables are used for present-value discounting of\nlife-contingent cash flows).\n"
      },
      "OwnershipEnum": {
        "type": "string",
        "enum": ["individual", "joint", "community"],
        "default": "individual",
        "description": "Asset or income ownership.\n\n- `individual` — titled in one person's name.\n- `joint`      — titled jointly (e.g., JTWROS). Only meaningful when\n                 the client is married.\n- `community`  — community property under state law. Only meaningful\n                 when the client is married **and** the household is\n                 in a community-property state (AZ, CA, ID, LA, NV,\n                 NM, TX, WA, WI).\n\nIf `client.personal_info.married == false`, ownership on every asset\nand income item must equal `individual`.\n"
      },
      "TaxFilingStatusEnum": {
        "type": "string",
        "enum": ["single", "married filing jointly", "married filing separately", "head of household"],
        "description": "Must align with marital status:\n\n- Unmarried clients may use `single` or `head of household`.\n- Married clients may use `married filing jointly`,\n  `married filing separately`, or `head of household` (the last only\n  when spouses have lived apart for 6+ months with a qualifying\n  dependent).\n\nThe spouse's filing status is auto-synced: MFJ → MFJ; MFS or\nHoH-while-married → MFS. See cross-field rule\n`spouse_tax_filing_status_mirrors_client`.\n"
      },
      "OccupationCategoryEnum": {
        "type": "integer",
        "enum": [6, 7, 8, 9, 10],
        "description": "Employment-category code driving the human-capital β in the\ncovariance matrix:\n\n- `6`  = High-skill (professional, technical, managerial)\n- `7`  = Mid-skill (administrative, sales, skilled trades)\n- `8`  = Public sector (government, education)\n- `9`  = Low-skill (service, retail, hospitality)\n- `10` = Manual labor (construction, manufacturing)\n"
      },
      "BusinessCategoryEnum": {
        "type": "integer",
        "enum": [11, 12, 13, 14, 15],
        "description": "Business-category code driving the business-equity β:\n\n- `11` = Technology (software, hardware, IT)\n- `12` = Manufacturing\n- `13` = Retail (stores, e-commerce)\n- `14` = Services (consulting, healthcare, other)\n- `15` = Agriculture\n"
      },
      "IRAAccountTypeEnum": {
        "type": "string",
        "enum": ["traditional", "roth", "sep", "simple"],
        "description": "IRA sub-type. `sep` and `simple` are employer-sponsored IRAs.\n"
      },
      "K401AccountTypeEnum": {
        "type": "string",
        "enum": ["traditional", "roth", "solo"],
        "description": "401(k) sub-type. `solo` = Solo (one-participant) 401(k), valid only\nwhen the household has business income (not merely employment\nincome).\n"
      },
      "PensionPlanTypeEnum": {
        "type": "string",
        "enum": ["defined_benefit", "cash_balance"],
        "description": "`defined_benefit` is the classic final-pay / career-average plan;\n`cash_balance` is a hybrid plan with an individual hypothetical\naccount balance.\n"
      },
      "PensionTypeEnum": {
        "type": "string",
        "enum": ["government", "private"],
        "description": "`government` pensions receive a lower covariance β (closer to\nrisk-free) than `private` pensions, to reflect the stronger\npolitical/legal protection of government benefits.\n"
      },
      "PensionStatusEnum": {
        "type": "string",
        "enum": ["active", "vested", "deferred", "retired"]
      },
      "LifeInsurancePolicyTypeEnum": {
        "type": "string",
        "enum": ["whole", "universal", "variable_universal", "indexed_universal", "term"]
      },
      "RealEstateTypeEnum": {
        "type": "string",
        "enum": ["Single Family", "Condo", "Townhouse", "Manufactured", "Multi-Family", "Apartment", "Land"],
        "description": "Property classification. Conditional requirements:\n\n- **Single Family / Condo / Townhouse / Manufactured** — bedrooms,\n  bathrooms, sqft required and > 0; `units` not used.\n- **Multi-Family** — 2–4 units; bedrooms/bathrooms/sqft required.\n- **Apartment** — 5+ units; bedrooms/bathrooms/sqft required.\n- **Land** — bedrooms/bathrooms/sqft/units not used;\n  `owner_occupied` must not be `true`.\n"
      },
      "BankCDCompoundingEnum": {
        "type": "string",
        "enum": ["daily", "monthly", "quarterly", "annually"],
        "default": "daily"
      },
      "EGMPTickerEnum": {
        "type": "string",
        "description": "ETF ticker symbol for one of the lines of the Empirical Global\nMarket Portfolio (EGMP, investable basis). The specific tickers and their weights are\nreturned at runtime in the `/core` response and are not\nenumerated here.\n"
      },
      "BalanceSheetAssetTypeEnum": {
        "type": "string",
        "enum": ["Allocatable Wealth", "Retirement Savings", "Capitalized Income Streams", "Tangible Background Assets", "Other Background Assets"],
        "description": "Top-level grouping used in the balance-sheet asset list."
      },
      "BalanceSheetLiabilityTypeEnum": {
        "type": "string",
        "enum": "Expenses",
        "description": "Top-level grouping used in the balance-sheet liability list. In the\nMerton framework, liabilities are the **present value of future\nexpenses** — a single `Expenses` category.\n"
      },
      "IncomeStatementIncomeTypeEnum": {
        "type": "string",
        "enum": ["Earned Income", "Asset-Based Income", "Retirement Income", "Other Income"],
        "description": "Grouping for the income statement `income[]` array.\n"
      },
      "IncomeStatementExpenseTypeEnum": {
        "type": "string",
        "enum": "Recurring",
        "description": "Grouping for the income statement `expenses[]` array."
      },
      "IncomeStatementFutureIncomeTypeEnum": {
        "type": "string",
        "enum": "Deferred",
        "description": "Grouping for the income statement `future_income[]` array."
      },
      "Name": {
        "type": "object",
        "required": ["first_name", "last_name"],
        "properties": {
          "first_name": {
            "type": "string",
            "minLength": 1
          },
          "last_name": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "Address": {
        "type": "object",
        "required": ["street_number", "street_name", "city", "state", "zip_code"],
        "properties": {
          "street_number": {
            "type": "string",
            "description": "Street number portion of the street address."
          },
          "street_name": {
            "type": "string",
            "description": "Street name portion of the street address."
          },
          "unit_number": {
            "type": "string",
            "description": "Apartment, suite, or unit designation. Optional."
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "Two-letter USPS state code. For the client/spouse residence\naddress this must be `CA` — Advisory API Systems LLC is\nregistered only in California. Community-property states for\noptimization purposes: AZ, CA, ID, LA, NV, NM, TX, WA, WI.\n"
          },
          "zip_code": {
            "type": "string",
            "description": "5-digit US ZIP code (9-digit ZIP+4 accepted). For the\nclient/spouse residence address the 5-digit prefix must fall in\nthe California range 90000–96199 (cross-field rule\n`california_residency`).\n"
          }
        }
      },
      "Phone": {
        "type": "object",
        "description": "At least one phone number is recommended but none is required.\n",
        "properties": {
          "home_phone": {
            "type": "string"
          },
          "mobile_phone": {
            "type": "string"
          },
          "work_phone": {
            "type": "string"
          }
        }
      },
      "Location": {
        "type": "object",
        "description": "City/state pair used on Employment items.",
        "properties": {
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          }
        }
      },
      "SSAEarningsRecord": {
        "type": "object",
        "required": ["year", "earnings"],
        "description": "A single-year row from the client's (or spouse's) official Social\nSecurity Administration earnings statement (available at ssa.gov).\nOnly SSA-covered earnings should be supplied — the SSA statement\nexcludes non-covered earnings automatically.\n",
        "properties": {
          "year": {
            "type": "integer",
            "minimum": 1937,
            "maximum": 2100,
            "description": "Calendar year of the reported earnings."
          },
          "earnings": {
            "type": "number",
            "minimum": 0,
            "description": "Social Security–covered earnings for the year, in nominal\ndollars, exactly as shown on the SSA earnings statement.\n"
          }
        }
      },
      "Employment": {
        "type": "object",
        "required": ["employer_name", "employee_id"],
        "description": "A single present or future employment relationship. Used to project\nhuman capital (present value of future labor earnings). Multiple\nemployments are summed.\n\nDuplicate detection key across client / spouse: `employer_name` +\n`employee_id`. Duplicates are not fatal; they surface as a\nnon-blocking `data_quality_warnings` entry on the success path.\n",
        "properties": {
          "employer_name": {
            "type": "string",
            "description": "Employer name. Part of the duplicate-detection key."
          },
          "employee_id": {
            "type": "string",
            "description": "Employer-assigned employee identifier. Part of the\nduplicate-detection key.\n"
          },
          "location": {
            "$ref": "#/components/schemas/Location"
          },
          "job_title": {
            "type": "string"
          },
          "occupation_category": {
            "$ref": "#/components/schemas/OccupationCategoryEnum"
          },
          "income": {
            "type": "number",
            "minimum": 0,
            "description": "Current annual gross employment income (W-2 wages)."
          },
          "expected_retirement_age": {
            "type": "number",
            "minimum": 50,
            "maximum": 85,
            "description": "Age at which the employee plans to stop working this job. Used\nto bound remaining human-capital PV.\n"
          }
        }
      },
      "Business": {
        "type": "object",
        "required": ["business_name", "ein", "business_category", "net_income", "ownership"],
        "description": "A business interest held by the household. Drives business-capital\nPV and income-statement business-income lines. Duplicate detection\nkey across client / spouse: `ein`.\n",
        "properties": {
          "business_name": {
            "type": "string"
          },
          "ein": {
            "type": "string",
            "description": "Federal Employer Identification Number. Primary duplicate-\ndetection key.\n"
          },
          "business_category": {
            "$ref": "#/components/schemas/BusinessCategoryEnum"
          },
          "net_income": {
            "type": "number",
            "description": "Annual net income from the business (may be negative)."
          },
          "ownership": {
            "$ref": "#/components/schemas/OwnershipEnum"
          }
        }
      },
      "IRAAccount": {
        "type": "object",
        "required": ["account_id", "account_type", "balance"],
        "description": "An individual IRA account. Always individually owned by law\n(no `ownership` field). Duplicate-detection key: `account_id`.\n",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Account identifier. Primary duplicate-detection key."
          },
          "account_type": {
            "$ref": "#/components/schemas/IRAAccountTypeEnum"
          },
          "custodian": {
            "type": "string",
            "description": "IRA custodian (e.g., Fidelity, Schwab)."
          },
          "balance": {
            "type": "number",
            "minimum": 0
          }
        }
      },
      "K401Account": {
        "type": "object",
        "required": ["account_id", "account_type", "balance"],
        "description": "An individual 401(k) account. Always individually owned by law.\nDuplicate-detection key: `account_id`.\n",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Primary duplicate-detection key."
          },
          "account_type": {
            "$ref": "#/components/schemas/K401AccountTypeEnum"
          },
          "employer": {
            "type": "string"
          },
          "custodian": {
            "type": "string"
          },
          "balance": {
            "type": "number",
            "minimum": 0
          }
        }
      },
      "Pension": {
        "type": "object",
        "required": ["pension_id", "plan_type", "type", "status", "annual_amount"],
        "description": "A defined-benefit or cash-balance pension. Always individually\nowned. Duplicate-detection key: `pension_id`.\n",
        "properties": {
          "pension_id": {
            "type": "string",
            "description": "Primary duplicate-detection key."
          },
          "plan_type": {
            "$ref": "#/components/schemas/PensionPlanTypeEnum"
          },
          "type": {
            "$ref": "#/components/schemas/PensionTypeEnum"
          },
          "employer": {
            "type": "string"
          },
          "administrator": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/PensionStatusEnum"
          },
          "annual_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Annual pension payment (or the expected annual payment at\nretirement for non-retired statuses).\n"
          }
        }
      },
      "Annuity": {
        "type": "object",
        "required": ["issuer", "contract_number", "base_payment_amount", "ownership"],
        "description": "A commercial annuity contract. Duplicate-detection key across\nclient/spouse: `issuer` + `contract_number`. Deferred annuities do\n**not** contribute to current-income totals until payments begin;\nthey appear in `income_statement.future_income[]` with\n`starts_in_years`.\n",
        "properties": {
          "issuer": {
            "type": "string",
            "description": "Insurance-company issuer. Part of the duplicate key."
          },
          "contract_number": {
            "type": "string",
            "description": "Contract number. Part of the duplicate key."
          },
          "base_payment_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Base annual payment before COLA or deferral growth."
          },
          "life": {
            "type": "boolean",
            "default": true,
            "description": "`true` for lifetime annuities; `false` for period-certain. If\n`false`, `term_years` must be supplied (> 0).\n"
          },
          "term_years": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of guaranteed-payment years. Required when `life = false`.\n"
          },
          "ownership": {
            "$ref": "#/components/schemas/OwnershipEnum"
          },
          "investment_in_contract": {
            "type": "number",
            "minimum": 0,
            "description": "Cost basis in the annuity contract, used for IRC §72 exclusion\nratio on non-qualified distributions.\n"
          },
          "is_qualified": {
            "type": "boolean",
            "default": false,
            "description": "`true` if held inside a qualified retirement account or funded\nwith pre-tax dollars (fully taxable distributions, subject to\nRMDs). `false` for non-qualified annuities funded with after-tax\ndollars (only earnings taxable; no lifetime RMDs).\n"
          },
          "deferral_period": {
            "type": "integer",
            "minimum": 0,
            "description": "Years until payments begin. `0` = immediate annuity.\n"
          },
          "benefit_growth_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 0.2,
            "description": "Annual growth rate applied during the deferral period."
          },
          "has_cola": {
            "type": "boolean",
            "default": false,
            "description": "Whether payments receive a cost-of-living adjustment."
          },
          "cola_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 0.1,
            "description": "Annual COLA rate. Required when `has_cola = true`; ignored\notherwise.\n"
          },
          "is_joint_life": {
            "type": "boolean",
            "default": false,
            "description": "Whether payments continue while either annuitant is alive."
          },
          "survivor_percentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 1,
            "description": "Fraction of the base payment that continues after the first\nannuitant's death. Required when `is_joint_life = true`.\n"
          }
        }
      },
      "LifeInsurance": {
        "type": "object",
        "description": "Container for the household's life-insurance policy list.",
        "properties": {
          "policies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LifeInsurancePolicy"
            }
          }
        }
      },
      "LifeInsurancePolicy": {
        "type": "object",
        "required": ["insurer", "policy_number", "policy_type", "face_amount", "ownership"],
        "description": "A single life-insurance policy. Only the **net surrender value**\ncounts toward background wealth (not the face amount). Duplicate\ndetection key: `insurer` + `policy_number`.\n",
        "properties": {
          "insurer": {
            "type": "string",
            "description": "Part of the duplicate-detection key."
          },
          "policy_number": {
            "type": "string",
            "description": "Part of the duplicate-detection key."
          },
          "policy_type": {
            "$ref": "#/components/schemas/LifeInsurancePolicyTypeEnum"
          },
          "face_amount": {
            "type": "number",
            "minimum": 0,
            "description": "Death benefit. Not included in current allocatable wealth; used\nfor estate-planning context only.\n"
          },
          "net_surrender_value": {
            "type": "number",
            "minimum": 0,
            "description": "Cash surrender value net of fees and loans. This is what counts\ntoward background wealth.\n"
          },
          "annual_premium": {
            "type": "number",
            "minimum": 0,
            "description": "Annual premium. Flows into the income statement expenses."
          },
          "ownership": {
            "$ref": "#/components/schemas/OwnershipEnum"
          }
        }
      },
      "RealEstate": {
        "type": "object",
        "required": ["address", "city", "state", "zip", "type", "market_value", "purchase_price", "purchase_year", "purchase_month"],
        "description": "A single real-estate holding. Duplicate-detection key across client/\nspouse: `address` + `city` + `state` + `zip`.\n\nCurrent market value and monthly rent are supplied by the caller\n(`market_value`, `monthly_rent`); the API does not look them up.\n\nConditional rules (enforced server-side — see\n`array_item_rules.real_estate`):\n\n- `type != Land` → `bedrooms`, `bathrooms`, `sqft`, `monthly_rent`\n  required (`bedrooms`/`bathrooms`/`sqft` > 0).\n- `type == Land` → `owner_occupied` must not be `true`.\n- `type == Multi-Family` → `units` required, in range 2–4.\n- `type == Apartment` → `units` required, in range 5–999.\n\nCross-field rule `rents_xor_owner_occupied_per_person`: each person\nmay have at most one `owner_occupied = true` property, and cannot\nhave any if `rents_residence = true`.\n",
        "properties": {
          "address": {
            "type": "string",
            "description": "Street address. Part of the duplicate-detection key."
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          },
          "zip": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/RealEstateTypeEnum"
          },
          "bedrooms": {
            "type": "integer",
            "minimum": 0,
            "description": "Total bedrooms (across all units, for Multi-Family / Apartment).\nRequired when `type != Land`.\n"
          },
          "bathrooms": {
            "type": "number",
            "minimum": 0,
            "description": "Total bathrooms (half-baths allowed). Required when\n`type != Land`.\n"
          },
          "sqft": {
            "type": "number",
            "minimum": 0,
            "description": "Total building square footage. Required when `type != Land`.\n"
          },
          "units": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of dwelling units. Required for `Multi-Family` (2–4) and\n`Apartment` (5+); ignored otherwise.\n"
          },
          "occupancy": {
            "type": "string",
            "enum": ["owner_occupied", "rented", "vacant", "occupied_rent_free", "mixed"],
            "description": "HOUSEHOLD-FACTS-V1.0. How the property is occupied.\n`owner_occupied`: the rent entered is the comparable rent,\ncounted as non-taxable imputed rent. `rented`: the rent is\ntaxable rental income. `vacant` and `occupied_rent_free`: no\nrent of either kind; the property stays on the balance sheet at\nits market value and carries only its running costs. `mixed`:\nthe owner lives in one unit and lets the others (the owner's\nunit's share imputed, the rest taxable). At most one property\nper person may be `owner_occupied` or `mixed`; Land can only be\n`vacant` or `rented`. Replaces `owner_occupied` (still accepted:\n`true` → `owner_occupied`; otherwise `rented` when a rent is\nentered, else `vacant`).\n"
          },
          "occupant_relationship": {
            "type": "string",
            "enum": ["family", "trustee_or_agent", "other"],
            "description": "For occupied_rent_free: who lives there; printed in the statements."
          },
          "occupant_pays_annual": {
            "type": "number",
            "minimum": 0,
            "description": "For `occupied_rent_free`: what the occupant pays each year\ntoward the property's running costs; subtracted from them.\n"
          },
          "operating_expenses": {
            "$ref": "#/components/schemas/OperatingExpenses"
          },
          "owner_occupied": {
            "type": "boolean",
            "default": false,
            "deprecated": true,
            "description": "Former occupancy flag, read as `occupancy = owner_occupied`\n(HOUSEHOLD-FACTS-V1.0); prefer `occupancy`.\n`true` if the owner lives in the property. At most one property\nper person may be owner-occupied (cross-field rule). For\nMulti-Family / Apartment with owner occupancy, rent from the\nother units is taxable rental income while the owner's unit's\nshare is non-taxable imputed rent. Cannot be `true` if\n`rents_residence = true` at the financial-info level, and must\nnot be `true` for `type = Land`.\n"
          },
          "market_value": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Caller's estimate of the property's current market value (what\nit would sell for today — a recent appraisal, an online\nestimate, or comparable sales). Must be strictly positive.\n"
          },
          "monthly_rent": {
            "type": "number",
            "minimum": 0,
            "description": "Total monthly rent for the whole property, all units combined.\nFor an owner-occupied home, the rent a comparable home would\ncommand (used as non-taxable imputed rent). Required for every\n`type` except `Land`, where it is ignored and treated as 0.\n"
          },
          "mortgage_balance": {
            "type": "number",
            "minimum": 0,
            "description": "Current outstanding mortgage principal."
          },
          "purchase_price": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Original purchase price (cost basis). Must be strictly positive\n— zero would break downstream cost-basis / capital-gains /\ndepreciation math.\n"
          },
          "purchase_year": {
            "type": "integer",
            "minimum": 1900,
            "maximum": 2100
          },
          "purchase_month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "monthly_payment": {
            "type": "number",
            "minimum": 0,
            "description": "Monthly mortgage payment (P&I). Property taxes, homeowners\ninsurance, HOA fees, utilities, maintenance, and reserves are\nestimated automatically by the API from property type and\ncurrent market value — **do not** add them to\n`household_total_annual_expenses`.\n"
          },
          "ownership": {
            "$ref": "#/components/schemas/OwnershipEnum"
          }
        }
      },
      "Vehicle": {
        "type": "object",
        "required": ["vin", "mileage", "purchase_price", "current_value", "purchase_year", "purchase_month"],
        "description": "A single vehicle. Duplicate-detection key: `vin`. VIN is validated\nagainst 49 CFR 565 (check-digit + allowed characters). The current\nmarket value is supplied by the caller (`current_value`); the API\ndoes not look it up.\n",
        "properties": {
          "vin": {
            "type": "string",
            "minLength": 17,
            "maxLength": 17,
            "pattern": "^[A-HJ-NPR-Z0-9]{17}$",
            "description": "17-character Vehicle Identification Number. Must exclude the\nletters I, O, Q (49 CFR 565.15(d)) and pass the check-digit in\nposition 9. Primary duplicate-detection key.\n"
          },
          "mileage": {
            "type": "integer",
            "minimum": 0,
            "description": "Current odometer reading."
          },
          "purchase_price": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Original purchase price (cost basis). Must be strictly positive."
          },
          "current_value": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Caller's estimate of the vehicle's current private-party market\nvalue. Must be strictly positive.\n"
          },
          "purchase_year": {
            "type": "integer",
            "minimum": 1900,
            "maximum": 2100
          },
          "purchase_month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "amount_owed": {
            "type": "number",
            "minimum": 0,
            "description": "Outstanding loan balance against the vehicle, if any."
          },
          "monthly_payment": {
            "type": "number",
            "minimum": 0,
            "description": "Monthly loan payment (principal + interest). Aggregated\nas annual debt service in the Household Income & Expense\nSummary (Total Annual Vehicle Loan Payments).\n"
          },
          "ownership": {
            "$ref": "#/components/schemas/OwnershipEnum"
          }
        }
      },
      "BankCD": {
        "type": "object",
        "required": ["account_balance", "current_apy"],
        "description": "A certificate of deposit held as a background asset. Do **not** list\na CD purchased as the implementation of the risk-free allocation —\nonly permanently retained CDs belong here. Duplicate-detection key\nacross client/spouse: `institution.name` + `account_number`.\n",
        "properties": {
          "institution": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Institution name. Part of the duplicate-detection key."
              },
              "branch": {
                "type": "string"
              }
            }
          },
          "account_number": {
            "type": "string",
            "description": "Part of the duplicate-detection key."
          },
          "title": {
            "type": "string",
            "description": "Human-readable title (e.g., \"36-Month CD\")."
          },
          "principal": {
            "type": "number",
            "minimum": 0,
            "description": "Original principal deposited."
          },
          "account_balance": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Current balance (principal + accrued interest). Must be\nstrictly positive.\n"
          },
          "currency": {
            "type": "string",
            "default": "USD",
            "description": "ISO 4217 currency code."
          },
          "issue_date": {
            "type": "string",
            "format": "date"
          },
          "maturity_date": {
            "type": "string",
            "format": "date"
          },
          "current_apy": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1,
            "description": "Current APY as a decimal (e.g., `0.046` for 4.6%). Must be\nstrictly greater than zero — an APY of zero is semantically\nequivalent to \"missing\" and is rejected.\n"
          },
          "auto_renew": {
            "type": "boolean",
            "default": false
          },
          "compounding_method": {
            "$ref": "#/components/schemas/BankCDCompoundingEnum"
          },
          "ownership": {
            "$ref": "#/components/schemas/OwnershipEnum"
          }
        }
      },
      "RetirementAccounts": {
        "type": "object",
        "description": "Container for one person's retirement accounts. IRAs, 401(k)s, and\npensions are always individually owned by law — `ownership` is **not**\na field on those items. Annuities **are** subject to ownership\n(individual / joint / community).\n",
        "properties": {
          "defined_contribution_plans": {
            "type": "object",
            "properties": {
              "accounts_IRA": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IRAAccount"
                }
              },
              "accounts_401k": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/K401Account"
                }
              }
            }
          },
          "defined_benefit_plans": {
            "type": "object",
            "properties": {
              "pensions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Pension"
                }
              }
            }
          },
          "annuities": {
            "type": "object",
            "properties": {
              "contracts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Annuity"
                }
              }
            }
          }
        }
      },
      "ClientPersonalInfo": {
        "type": "object",
        "required": ["name", "address", "email_address", "dob", "gender", "married"],
        "properties": {
          "name": {
            "$ref": "#/components/schemas/Name"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "phone": {
            "$ref": "#/components/schemas/Phone"
          },
          "email_address": {
            "type": "string",
            "format": "email"
          },
          "dob": {
            "type": "string",
            "format": "date",
            "description": "Date of birth (YYYY-MM-DD)."
          },
          "gender": {
            "$ref": "#/components/schemas/GenderEnum"
          },
          "married": {
            "type": "boolean",
            "description": "If `true`, the top-level `spouse` object is required and must\ninclude both `personal_info` and `financial_info`. If `false`,\nthe `spouse` object must be **absent**, the client's filing\nstatus is restricted to `single` / `head of household`, and\nevery asset `ownership` field must be `individual`.\n"
          },
          "is_disabled_for_ss_purposes": {
            "type": "boolean",
            "default": false,
            "description": "If `true`, the client is treated as eligible for Social\nSecurity Disability Insurance (SSDI) per 42 U.S.C. § 423,\nwhich relaxes the standard 40-QC fully-insured threshold:\nages 31+ need only 20 QC in the last 40 quarters; younger\nages need progressively fewer. Medicare eligibility opens\nafter the SSDI 24-month waiting period (42 U.S.C. § 426(b);\nESRD and ALS waive the wait).\n\nSSDI mode also suppresses future-earnings projection in the\nAIME computation (a disabled worker is no longer accruing\nearnings) and overrides claiming age to current age (SSDI\nbenefits begin immediately, not at retirement). The SSDI\ncomputation-years formula per 42 U.S.C. § 415(b)(2)(A) is\napplied via AIME rescaling rather than the standard 35-year\nretirement denominator.\n"
          }
        }
      },
      "SpousePersonalInfo": {
        "type": "object",
        "required": ["name", "address", "email_address", "dob", "gender"],
        "description": "Required when `client.personal_info.married == true`. `married` is\nimplicit on the spouse side (submitting a spouse block is itself a\nrepresentation of spousal authority — User Agreement §2.7).\n",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/Name"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "phone": {
            "$ref": "#/components/schemas/Phone"
          },
          "email_address": {
            "type": "string",
            "format": "email"
          },
          "dob": {
            "type": "string",
            "format": "date"
          },
          "gender": {
            "$ref": "#/components/schemas/GenderEnum"
          },
          "is_disabled_for_ss_purposes": {
            "type": "boolean",
            "default": false,
            "description": "Same semantics as on the client. When `true`, the spouse is\ntreated as SSDI-eligible with relaxed QC requirements and\nMedicare access via the SSDI pathway.\n"
          }
        }
      },
      "ClientFinancialInfo": {
        "type": "object",
        "required": ["tax_filing_status", "household_liquid_wealth", "quarters_of_coverage"],
        "description": "The client's complete financial picture. Array fields\n(`employments`, `businesses`, `real_estate`, `vehicles`, `bank_CDs`,\nand retirement sub-arrays) may be omitted entirely; missing arrays\nare treated as empty.\n",
        "properties": {
          "risk_aversion": {
            "$ref": "#/components/schemas/RiskAversion"
          },
          "housing_status": {
            "type": "string",
            "enum": ["owns", "rents", "care_facility", "with_family", "rent_free_other_property", "other"],
            "description": "HOUSEHOLD-FACTS-V1.0. Where the client lives. `owns` requires one\n`real_estate` item with `occupancy = owner_occupied` (or `mixed`);\n`rents` puts the rent in the household expenses and forbids an\nowner-occupied property; `care_facility`, `with_family`,\n`rent_free_other_property` and `other` need no property at all.\nReplaces `rents_residence` (still accepted: `true` → `rents`).\n"
          },
          "care_facility": {
            "type": "object",
            "description": "The facility, when `housing_status = care_facility`; printed in the statements.",
            "properties": {
              "name": {
                "type": "string"
              }
            }
          },
          "max_premium": {
            "type": "number",
            "exclusiveMinimum": 50000,
            "exclusiveMaximum": 300000,
            "description": "Accepted as the `willingness_to_pay` method when `risk_aversion`\nis absent (HOUSEHOLD-FACTS-V1.0); prefer `risk_aversion`.\nMaximum insurance premium, in dollars, the household would pay\nto avoid a 10% chance of a $400,000 loss on $1,000,000 of\nwealth. Used to derive the CRRA risk-aversion coefficient γ via\nrevealed preference. Must be strictly between $50,000 and\n$300,000 (endpoints excluded).\n"
          },
          "tax_filing_status": {
            "$ref": "#/components/schemas/TaxFilingStatusEnum"
          },
          "household_liquid_wealth": {
            "type": "number",
            "minimum": 0,
            "description": "Total household wealth available to invest (cash, brokerage\nbalances, and any other liquid funds not captured in the\nretirement-accounts, real-estate, vehicles, bank-CDs, life-\ninsurance, annuity, or other-background-wealth fields).\n"
          },
          "client_separate_liquid_wealth": {
            "type": "number",
            "minimum": 0,
            "description": "Portion of `household_liquid_wealth` that is the client's\nseparate property (inheritance, gifts, pre-marital assets).\nOnly permitted when filing is MFS (or HoH-while-married + MFS\nspouse). See cross-field rule\n`separate_property_only_when_separate_returns`.\n"
          },
          "quarters_of_coverage": {
            "type": "integer",
            "minimum": 0,
            "maximum": 160,
            "description": "Social Security quarters of coverage (CURRENT snapshot at\ninput). Typically auto-computed from `ssa_earnings_record`\n(if supplied) against SSA's indexed earnings thresholds\n(42 U.S.C. §213(a)(2)). 40 quarters are required both for\nSocial Security retirement benefits on the client's own\nrecord (42 U.S.C. §414(a) \"fully insured\" status) and for\npremium-free Medicare Part A (42 U.S.C. §426).\n\nFor eligibility purposes the model PROJECTS forward from the\ncurrent snapshot using the client's current salary: each\nyear of work earns up to 4 QC, capped at 160 total. A\n35-year-old at 20 QC currently earning $60K will be modeled\nas 140 QC at retirement and treated as fully insured. A\nclient with no current earnings won't accrue projected QC\nand will remain ineligible if the snapshot is below 40.\n\nMedicare eligibility additionally honors the spousal-record\npathway: a married client whose spouse projects to 40+ QC\nis treated as eligible for premium-free Part A (42 U.S.C.\n§426(b)). The mirror pathway for Social Security\n(claiming 50% of an insured spouse's PIA per 42 U.S.C.\n§402(b)) is not yet implemented on the client side; the\nspouse-on-client direction at plumber.R:6086 IS. SSDI/ESRD\ndisability pathways are likewise not yet modeled.\n"
          },
          "self_employed": {
            "type": "boolean",
            "default": false,
            "description": "Affects Social Security (SECA vs. FICA) and Medicare surcharge\ncalculations.\n"
          },
          "other_annual_income": {
            "type": "number",
            "minimum": 0,
            "description": "Annual **taxable** income not captured elsewhere — trust\ndistributions, royalties, alimony received, disability payments,\nnon-real-estate rental income, etc. Do NOT include gifts or\ninheritances (IRC §102(a) exclusion) — those roll into\n`household_liquid_wealth` or `other_background_wealth`.\nDo NOT double-count income already reported via `employments`,\n`businesses`, pensions, annuities, or Social Security.\n"
          },
          "other_income_ownership": {
            "$ref": "#/components/schemas/OwnershipEnum"
          },
          "other_background_wealth": {
            "type": "number",
            "minimum": 0,
            "description": "Net current value (value minus debt) of background assets not\ncaptured elsewhere — collectibles, precious metals, private\nequity, hedge funds, LP interests, cryptocurrency, mineral/water\nrights, IP, unvested RSUs/options, deferred compensation\nbalances, structured settlement receivables, tax-lien\ncertificates, etc.\n"
          },
          "other_background_wealth_ownership": {
            "$ref": "#/components/schemas/OwnershipEnum"
          },
          "actual_monthly_benefit": {
            "type": "number",
            "minimum": 0,
            "description": "Current actual monthly Social Security benefit. Supply only if\nthe client is already claiming.\n"
          },
          "actual_claiming_age": {
            "type": "number",
            "minimum": 62,
            "maximum": 70,
            "description": "Age at which Social Security was actually claimed."
          },
          "fixed_claiming_age": {
            "type": "number",
            "minimum": 62,
            "maximum": 70,
            "description": "Planned Social Security claiming age. If set, overrides\n`assume_optimal_claiming` and `optimize_claiming`. At most one\nof `actual_claiming_age` and `fixed_claiming_age` may be\nsupplied (cross-field rule `claiming_age_consistency`).\n"
          },
          "expected_retirement_age": {
            "type": "number",
            "minimum": 50,
            "maximum": 85,
            "description": "Age at which the client plans to stop working. Used to bound\nremaining employment-income PV. Defaults to Full Retirement Age\nwhen not supplied.\n"
          },
          "assume_optimal_claiming": {
            "type": "boolean",
            "default": true,
            "description": "For clients age 62+ who have not yet claimed: assume claiming at\nage 70 to maximize delayed retirement credits. Ignored when\n`fixed_claiming_age` is set or `optimize_claiming` is `true`.\n"
          },
          "optimize_claiming": {
            "type": "boolean",
            "default": true,
            "description": "Maximize benefits by delaying to age 70. Ignored when\n`fixed_claiming_age` is set.\n"
          },
          "ssa_earnings_record": {
            "type": "array",
            "description": "Historical SSA-covered earnings by year, from the client's\nofficial Social Security earnings statement. Optional — omit\nentirely (or supply an empty array) if the client has never\nhad SSA-covered employment. When omitted, `quarters_of_coverage`\nis taken from the value supplied directly (must still be\nprovided, even if zero).\n",
            "items": {
              "$ref": "#/components/schemas/SSAEarningsRecord"
            }
          },
          "employments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Employment"
            }
          },
          "businesses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Business"
            }
          },
          "retirement": {
            "$ref": "#/components/schemas/RetirementAccounts"
          },
          "life_insurance": {
            "$ref": "#/components/schemas/LifeInsurance"
          },
          "rents_residence": {
            "type": "boolean",
            "default": false,
            "deprecated": true,
            "description": "Former housing flag, read as `housing_status = rents`\n(HOUSEHOLD-FACTS-V1.0); prefer `housing_status`.\nIf `true`, the client does not own the home they live in; no\nproperty entry may be owner-occupied. The annual\nrent should be included in `household_total_annual_expenses`.\n"
          },
          "real_estate": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RealEstate"
            }
          },
          "vehicles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vehicle"
            }
          },
          "bank_CDs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BankCD"
            }
          }
        }
      },
      "RiskAversion": {
        "type": "object",
        "description": "HOUSEHOLD-FACTS-V1.0. The person's risk aversion and the method that\nsupplied it. `willingness_to_pay`: `max_premium`, inverted by the\ninsurance question (the former bare field). `direct`: `gamma`\n(0.5–15) with `determined_by` and a written `basis`, all required —\na trustee's substituted judgment, an adviser's measurement. A direct\nγ outside 0.5–10 is accepted and flagged `advisor_review`.\n`market_implied`: (μ_M − r_f)/σ_M² on the allocation's own premium\nand volatility (2.78 on the default calibration) and nothing else;\na different γ is a `direct` γ with its basis (THREE-MEASURES-V1.0:\n`cautious_step` is rejected). Two willingness-to-pay answers aggregate by\naveraging the premiums and inverting; any other pair averages the γ's.\nPRUDENCE-V1.0: a second measure may be given beside the method's —\n`max_premium` beside a `direct` or `market_implied` method, `gamma`\n(with its own `gamma_basis`) beside a `willingness_to_pay` or\n`market_implied` method. Every measure is a candidate; the more\ncautious (the higher γ) governs, and the results record them all.\n",
        "required": "method",
        "properties": {
          "method": {
            "type": "string",
            "enum": ["willingness_to_pay", "direct", "market_implied"]
          },
          "max_premium": {
            "type": "number",
            "exclusiveMinimum": 50000,
            "exclusiveMaximum": 300000
          },
          "gamma": {
            "type": "number",
            "minimum": 0.5,
            "maximum": 15
          },
          "determined_by": {
            "type": "string",
            "enum": ["client", "spouse", "trustee", "attorney_in_fact", "adviser"]
          },
          "basis": {
            "type": "string"
          },
          "gamma_basis": {
            "type": "string",
            "description": "Where a `gamma` given beside a non-direct method came from."
          }
        },
        "example": {
          "method": "direct",
          "gamma": 3,
          "determined_by": "trustee",
          "basis": "Substituted judgment: the market-implied world-average investor (2.78) one step to the cautious side; counsel's letter and written concurrences of 2026-09-18."
        }
      },
      "OperatingExpenses": {
        "type": "object",
        "description": "HOUSEHOLD-FACTS-V1.0. A property's annual running costs. `estimated`\n(default): the type rate on the market value (4.65% for a single-\nfamily house, of which 0.90% is property tax). `actual`: `annual_amount`\nas entered. Under either method `annual_property_tax`, when given,\nreplaces the estimate's tax component alone (Proposition 13).\n",
        "properties": {
          "method": {
            "type": "string",
            "enum": ["estimated", "actual"],
            "default": "estimated"
          },
          "annual_amount": {
            "type": "number",
            "minimum": 0
          },
          "annual_property_tax": {
            "type": "number",
            "minimum": 0
          }
        }
      },
      "ExpenseItem": {
        "type": "object",
        "required": ["category", "annual_amount"],
        "properties": {
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": ["housing", "care", "medical", "insurance", "living", "transportation", "education", "support_of_others", "other"]
          },
          "annual_amount": {
            "type": "number",
            "minimum": 0
          },
          "growth_rate": {
            "type": "number",
            "minimum": -0.5,
            "maximum": 0.5,
            "description": "The item's own growth rate, a decimal (0.07 for medical costs, say); the inflation rate if omitted."
          },
          "term_years": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Years the item lasts; the remaining life if omitted, and never beyond it."
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "description": "The date the item ends (an alternative to term_years)."
          },
          "committed": {
            "type": "boolean",
            "description": "EXPENSE-FLOOR-V1.0. true: a committed item, paid whatever the markets do, a liability on the balance sheet at its after-tax present value and part of the shadow wealth. false: discretionary, spending that scales with wealth, not a liability; reported in the plan beside the sustainable spending. Omitted: by category (everything but `other` is committed)."
          }
        },
        "example": {
          "description": "Ivy Park at Culver City",
          "category": "care",
          "annual_amount": 239000,
          "growth_rate": 0.07
        }
      },
      "SpouseFinancialInfo": {
        "type": "object",
        "required": ["tax_filing_status", "quarters_of_coverage"],
        "description": "Spouse's financial picture. Note that\n`household_liquid_wealth` lives only on the client side — the\nspouse side carries `spouse_separate_liquid_wealth` instead.\n",
        "properties": {
          "risk_aversion": {
            "$ref": "#/components/schemas/RiskAversion"
          },
          "housing_status": {
            "type": "string",
            "enum": ["owns", "rents", "care_facility", "with_family", "rent_free_other_property", "other"],
            "description": "Where the spouse lives (HOUSEHOLD-FACTS-V1.0); see ClientFinancialInfo."
          },
          "care_facility": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              }
            }
          },
          "max_premium": {
            "type": "number",
            "exclusiveMinimum": 50000,
            "exclusiveMaximum": 300000,
            "description": "Accepted as the `willingness_to_pay` method when `risk_aversion`\nis absent; prefer `risk_aversion`.\nSpouse's willingness-to-pay premium. Two willingness-to-pay\nanswers are averaged and inverted; any other pair of methods\naverages the two γ's.\n"
          },
          "tax_filing_status": {
            "type": "string",
            "enum": ["married filing jointly", "married filing separately"],
            "description": "Auto-synced with the client's filing status. If client files\nMFJ → spouse MFJ. If client files MFS or HoH-while-married →\nspouse MFS (cross-field rule\n`spouse_tax_filing_status_mirrors_client`).\n"
          },
          "spouse_separate_liquid_wealth": {
            "type": "number",
            "minimum": 0,
            "description": "Portion of `household_liquid_wealth` that is the spouse's\nseparate property. Only permitted under MFS / HoH-while-married +\nMFS.\n"
          },
          "quarters_of_coverage": {
            "type": "integer",
            "minimum": 0,
            "maximum": 160
          },
          "self_employed": {
            "type": "boolean",
            "default": false
          },
          "other_annual_income": {
            "type": "number",
            "minimum": 0
          },
          "other_income_ownership": {
            "$ref": "#/components/schemas/OwnershipEnum"
          },
          "other_background_wealth": {
            "type": "number",
            "minimum": 0
          },
          "other_background_wealth_ownership": {
            "$ref": "#/components/schemas/OwnershipEnum"
          },
          "actual_monthly_benefit": {
            "type": "number",
            "minimum": 0
          },
          "actual_claiming_age": {
            "type": "number",
            "minimum": 62,
            "maximum": 70
          },
          "fixed_claiming_age": {
            "type": "number",
            "minimum": 62,
            "maximum": 70
          },
          "expected_retirement_age": {
            "type": "number",
            "minimum": 50,
            "maximum": 85
          },
          "assume_optimal_claiming": {
            "type": "boolean",
            "default": true
          },
          "optimize_claiming": {
            "type": "boolean",
            "default": true
          },
          "ssa_earnings_record": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SSAEarningsRecord"
            }
          },
          "employments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Employment"
            }
          },
          "businesses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Business"
            }
          },
          "retirement": {
            "$ref": "#/components/schemas/RetirementAccounts"
          },
          "life_insurance": {
            "$ref": "#/components/schemas/LifeInsurance"
          },
          "rents_residence": {
            "type": "boolean",
            "default": false,
            "deprecated": true,
            "description": "Former housing flag, read as `housing_status = rents`."
          },
          "real_estate": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RealEstate"
            }
          },
          "vehicles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vehicle"
            }
          },
          "bank_CDs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BankCD"
            }
          }
        }
      },
      "ClientInfo": {
        "type": "object",
        "required": ["personal_info", "financial_info"],
        "properties": {
          "personal_info": {
            "$ref": "#/components/schemas/ClientPersonalInfo"
          },
          "financial_info": {
            "$ref": "#/components/schemas/ClientFinancialInfo"
          }
        }
      },
      "SpouseInfo": {
        "type": "object",
        "required": ["personal_info", "financial_info"],
        "description": "Required when `client.personal_info.married == true`. Must include\nboth `personal_info` and `financial_info` blocks.\n",
        "properties": {
          "personal_info": {
            "$ref": "#/components/schemas/SpousePersonalInfo"
          },
          "financial_info": {
            "$ref": "#/components/schemas/SpouseFinancialInfo"
          }
        }
      },
      "AdviceRequest": {
        "type": "object",
        "required": "client",
        "description": "Root request body for `POST /core`. Contains client, optional\nspouse, and household-level parameters.\n",
        "properties": {
          "client": {
            "$ref": "#/components/schemas/ClientInfo"
          },
          "spouse": {
            "$ref": "#/components/schemas/SpouseInfo"
          },
          "household_total_annual_expenses": {
            "type": "number",
            "minimum": 0,
            "description": "Combined annual living expenses for everyone in the household —\nfood, clothing, transportation fuel, travel, entertainment, pet\ncare, personal care, etc. **Do not** include any real-estate\ncosts for owned properties (property taxes, homeowners\ninsurance, HOA, maintenance, utilities, reserves, mortgage\npayments) — those come from each `real_estate` entry (estimated\nfrom its type, or entered in `operating_expenses`). If the\nhousehold rents (`housing_status = rents`), **do** include annual\nrent here. When `household_expense_items` is given, the items\nreplace this total (a total that disagrees is reported in\n`household_facts.expense_items.note`).\n"
          },
          "household_expense_items": {
            "type": "array",
            "description": "HOUSEHOLD-FACTS-V1.0. The household's expenses, itemized. Each\nitem is discounted on its own: the growing annuity of the\nmodel's expense present value, at the item's `growth_rate`\n(default: the inflation rate) over its `term_years` or until\nits `end_date` (default and cap: the person's remaining life).\nThe income statement lists the items; the balance sheet shows\nthe present value by category.\n",
            "items": {
              "$ref": "#/components/schemas/ExpenseItem"
            }
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "description": "Optional, YYYY-MM-DD. The date the reserves are discounted to and the balance sheet is dated (default: the day of the call)."
          },
          "reserves": {
            "type": "array",
            "description": "Near-term expenses to be paid with certainty; taken out of the household's liquid wealth at present value before the optimization (what remains is the allocatable wealth) and placed in Treasury instruments by due date.",
            "items": {
              "$ref": "#/components/schemas/Reserve"
            }
          },
          "accounts": {
            "$ref": "#/components/schemas/Accounts"
          },
          "allocation": {
            "$ref": "#/components/schemas/AllocationSettings"
          },
          "goals": {
            "type": "array",
            "description": "PLAN-V1.0. Dated outlays beyond the ordinary expenses (a boat, a\nwedding, a gift). A `committed` goal is funded today with a\nTreasury (or TIPS) at its after-tax present value, held outside\nthe rule and counted with the reserves; a `discretionary` goal\nchanges nothing in the allocation, and the response's `plan.goals`\nsays what buying it on its date would mean.\n",
            "items": {
              "$ref": "#/components/schemas/Goal"
            }
          },
          "holdings": {
            "type": "array",
            "description": "PLAN-V1.0. The fund positions already held, for the trade list and\nfor the deferred tax on the unrealized gain (`cost_basis`: the\nposition's total basis; absent, taken equal to its value).\n",
            "items": {
              "$ref": "#/components/schemas/Holding"
            }
          },
          "plan": {
            "$ref": "#/components/schemas/PlanSettings"
          }
        }
      },
      "HealthResponse": {
        "type": "object",
        "required": ["status", "timestamp", "api_developer", "version"],
        "properties": {
          "status": {
            "type": "string",
            "enum": "healthy"
          },
          "timestamp": {
            "type": "string",
            "description": "Server time in America/Los_Angeles,\nformatted `YYYY-MM-DD HH:MM:SS TZ`.\n"
          },
          "api_developer": {
            "type": "string",
            "description": "Always `Advisory API Systems LLC`."
          },
          "version": {
            "type": "string",
            "description": "Semantic version of the running API (e.g., `3.2.0`)."
          }
        }
      },
      "SpecResponse": {
        "type": "object",
        "description": "The input-validation specification (`input_spec.yaml` → JSON).\nConsumed by the frontend to render field rules, enums, and ranges.\nTop-level keys mirror the YAML structure.\n",
        "properties": {
          "meta": {
            "type": "object",
            "additionalProperties": true,
            "description": "Version and product info. Keys include `spec_version`, `product`,\nand free-text `notes`.\n"
          },
          "enums": {
            "type": "object",
            "additionalProperties": true,
            "description": "Named lists of allowed string/integer values."
          },
          "ranges": {
            "type": "object",
            "additionalProperties": true,
            "description": "Named numeric bounds."
          },
          "required": {
            "type": "object",
            "additionalProperties": true,
            "description": "Per-section lists of always-required fields."
          },
          "array_items": {
            "type": "object",
            "additionalProperties": true,
            "description": "Per-array-type required/optional/conditional rules."
          },
          "conditional": {
            "type": "object",
            "additionalProperties": true,
            "description": "Cross-field rules keyed by rule name."
          },
          "error_response": {
            "type": "object",
            "additionalProperties": true,
            "description": "Documented contract for /core 400 responses."
          }
        }
      },
      "PaymentIntentRequest": {
        "type": "object",
        "required": "payment_method_id",
        "properties": {
          "payment_method_id": {
            "type": "string",
            "pattern": "^pm_",
            "description": "Stripe payment-method identifier (`pm_...`). Typically obtained\nclient-side via Stripe Elements' `stripe.createPaymentMethod()`.\n"
          }
        }
      },
      "PaymentIntentResponse": {
        "type": "object",
        "required": ["status", "payment_intent_id", "client_secret", "amount"],
        "properties": {
          "status": {
            "type": "string",
            "enum": "success"
          },
          "payment_intent_id": {
            "type": "string",
            "description": "Stripe PaymentIntent identifier (`pi_...`)."
          },
          "client_secret": {
            "type": "string",
            "description": "Client secret for the PaymentIntent. Pass to\n`stripe.confirmCardPayment()` in the browser to complete the\nauthorization (this is where 3-D Secure challenges are handled,\nif required).\n"
          },
          "amount": {
            "type": "number",
            "description": "Authorization amount in dollars (currently $79.95). Card is\ncaptured only on a successful `/core` response.\n"
          }
        }
      },
      "AdviceResponse": {
        "type": "object",
        "required": ["client_personal_information", "household_max_premium", "household_gamma", "risk_free_rate", "household", "empirical_global_market_portfolio_contents", "optimal_risk_free_allocation", "strategy_recommendations", "balance_sheet", "retirement_accounts_by_type", "income_statement"],
        "description": "Complete allocation and wealth-strategy response. `payment_warning`\nis set only in the rare case where computation succeeded but the\nStripe card-capture subsequently failed — the allocation is still\nreturned, and **no charge is made**.\n",
        "properties": {
          "client_personal_information": {
            "$ref": "#/components/schemas/ClientPersonalInformationEcho"
          },
          "household_max_premium": {
            "type": "number",
            "description": "Combined household willingness-to-pay premium used to derive γ.\nFor a single-client household this equals the client's\n`max_premium`; for a married household it is the combined figure.\n"
          },
          "household_gamma": {
            "type": "number",
            "description": "Household CRRA risk-aversion coefficient γ: inverted from\n`household_max_premium` (willingness to pay), set directly, or\ntaken from the market, as `risk_aversion` reports.\nHigher γ = more risk-averse.\n"
          },
          "risk_aversion": {
            "type": "object",
            "description": "HOUSEHOLD-FACTS-V1.0. How γ was obtained: `method`, `gamma`,\n`household_max_premium` (willingness to pay only),\n`determined_by`, `basis`, `market_implied_gamma` (the\nworld-average investor on the allocation's calibration),\n`advisor_review` (γ outside 0.5–10), `persons` (each person's\nresolution) and `disclosure` (the sentence printed under the\nbalance sheet).\n"
          },
          "household_facts": {
            "type": "object",
            "description": "HOUSEHOLD-FACTS-V1.0. `housing` (each person's status and\nlabel), `real_estate` (each property's occupancy, rent\ntreatment, operating expenses and their method), and\n`prudence` (PRUDENCE-V1.0: the suitability and prudence record --\n`exposure`, the market share of total wealth and the total-wealth\nbeta by component; `alternatives`, a target-date fund, a 60/40\nportfolio, the all-stock portfolio of Anarkulova, Cederburg and\nO'Doherty and cash priced on the same figures with their\nequivalent annual fee; `suitability`, willingness beside ability,\nthe one-in-ten and one-in-a-hundred bad years, and flags for the\nadviser). `risk_aversion.governing` records every risk-tolerance\nfigure supplied and which governs (the more cautious).\n`discount_rates` (AFTER-TAX-RATES-V1.0: the basis, the after-tax\nrisk-free rate, market return and Treasury yield, and each\ncategory's after-tax and pre-tax rate and beta) sits beside\n`risk_free_rate`, which also carries `treasury_after_tax`.\n`expense_items` (`used`, the annual total, the present value,\neach item's present value, and a note when the typed total\ndisagrees with the items).\n"
          },
          "results_bundle": {
            "type": "object",
            "description": "RESULTS-BUNDLE-V3.2. The client's results package, offered for\ndownload: `Ocelot Core results - <Last name> - <YYYY-MM-DD HHMM>\n- client.zip` with the request as received (Social Security\nnumbers masked), the client's results JSON (the full response\nless the derivation and its tax block, the discount-rate table,\nthe alternatives and flags of the prudence record, the\nassumptions, the single-factor comparison and the plain-text\nengine report -- the same cuts api.html applies to the screen)\nand the client report as PDF: the adviser's report less those\nsame parts, with the Sharpe ratios explained (the .tex source is\nin the adviser's package only; it is included here only when the\nPDF could not be produced). `available`, `id`, `url`\n(`GET /bundle/{id}`, no authentication — the id is the key),\n`file_name` (the download's name), `contents` (the file names\ninside), `pdf`, `pdf_note` (when the PDF could not be produced\non the server), `size_bytes`, `expires_after_hours`; since\nRESULTS-BUNDLE-V3.6 also `pdf_url` (`GET /bundle/{id}/pdf`, the\nclient report alone, inline; absent -- null or \"NA\" -- when no\nPDF was produced), `pdf_file_name` and `pdf_size_bytes`;\n`client` repeats the same block. `adviser` describes the\nadviser's package, which is not downloadable (`download: false`)\nbut filed on Dropbox: `contents` (the request, the full response,\nthe adviser's report of every input and every result with the\nderivations, PDF and .tex), `pdf`, `dropbox` (the folder).\n`dropbox` names every folder used (`client`:\n`<root>/Client/<user>/<YYYY>/<MM>/`, `adviser`:\n`<root>/Advisor/<user>/<YYYY>/<MM>/`, which since RESULTS-BUNDLE-V3.3\nalso receives one run record per call, `... - run record.json`;\nnothing is written to the API folder any more). When a package\ncould not be prepared, its `available` is false and `reason`\nsays why; the results are unaffected.\n"
          },
          "plan": {
            "type": "object",
            "description": "PLAN-V1.0. The spending rule on the shadow wealth (Deep Money,\nStep 8) and the goals. `horizon` {planning_age, years, basis};\n`parameters` {gamma, risk_free_after_tax, premium, vol, lambda,\nalpha_liquid, wealth_ratio (W / W~), r_p, sigma_p,\ntime_preference, g, spending_growth_offset, kappa, horizon_years,\nannuity_factor}; `sustainable_spending` {first_year (beyond the\nentered expenses, nominal, after tax), share_of_shadow_wealth,\nexpected_growth, volatility, entered_expenses, note};\n`funded_ratio` {assets, liabilities, ratio, surplus} from the\nbalance sheet; `deferred_tax` {funds_value, cost_basis,\nunrealized_gain, rate, liability} from holdings[].cost_basis;\n`goals[]` -- a committed goal with {present_value, yield,\nyield_after_tax, instrument, instruction}, a discretionary one\nwith {amount_at_date, gross_sale_after_tax,\nunrealized_gain_fraction, capital_gains_rate, wealth_at_date\n{median, p25, p75}, share_of_wealth, probability_affordable,\nspending_reduction_after, liquidity_note}; `committed_goals_pv`;\n`notes`. `available` is false, with `reason`, when the\nbalance-sheet allocation did not run.\n"
          },
          "risk_free_rate": {
            "$ref": "#/components/schemas/RiskFreeRate"
          },
          "assumptions_and_references": {
            "type": "object",
            "description": "ASSUMPTIONS-REFS-V1.0. Every assumption the run made, stated with\nthe run's own values: `assumptions[]` {id, title, assumption,\njustification, references (ids), reference_numbers}, and\n`references[]` {n, id, citation, summary} -- the academic\nliterature each assumption rests on, each with a summary of what\nthe work shows. Shown on the results page after the allocation\ndetails and in the report as its own section.\n"
          },
          "market_parameters": {
            "type": "object",
            "description": "MARKET-PARAMS-V1.0. The market assumptions this run used:\n`risk_free_rate` (live, FRED), `premium` and `expected_return`\n(= risk-free + premium; the premium is a STATED long-run\nassumption, `premium_source`), `volatility` with\n`volatility_measured`, `volatility_source` and\n`volatility_window` (measured from the market portfolio's price\nhistory on the server, else the long-run fallback), and\n`allocation_engine` {premium, volatility} as the balance-sheet\nallocation uses them. The CAPM discount rates behind the balance\nsheet are built from these. `household.optimal_portfolio` keeps\nthe older single-factor statistics under that label.\n"
          },
          "household": {
            "$ref": "#/components/schemas/HouseholdBlock"
          },
          "empirical_global_market_portfolio_contents": {
            "type": "array",
            "description": "The ETFs constituting the Empirical Global Market Portfolio\n(EGMP, investable basis; one per line, eighteen at the current\nmeasurement), ordered by descending weight, with per-ticker weights\nand dollar amounts the household should invest based on the\noptimal allocation.\n",
            "items": {
              "$ref": "#/components/schemas/PortfolioComponent"
            }
          },
          "optimal_risk_free_allocation": {
            "type": "object",
            "required": "household",
            "properties": {
              "household": {
                "$ref": "#/components/schemas/RiskFreeAllocation"
              }
            }
          },
          "strategy_recommendations": {
            "type": "object",
            "description": "Map of strategy-name → strategy recommendation. The key is the\nstrategy's display name (e.g., `\"Traditional 401(k)\"`,\n`\"Roth Conversion Strategies\"`). The value contains short\ndescription, long-form URL, rationale, risk factors, and IRS\ncitations. Which strategies are returned depends on the\nhousehold's profile — a solo client with no W-2 income will not\nsee a Mega Backdoor Roth strategy, etc.\n",
            "additionalProperties": {
              "$ref": "#/components/schemas/StrategyRecommendation"
            }
          },
          "balance_sheet": {
            "$ref": "#/components/schemas/BalanceSheet"
          },
          "retirement_accounts_by_type": {
            "$ref": "#/components/schemas/RetirementAccountsByType"
          },
          "income_statement": {
            "$ref": "#/components/schemas/IncomeStatement"
          },
          "data_quality_warnings": {
            "$ref": "#/components/schemas/DataQualityWarnings"
          },
          "payment_warning": {
            "type": "string",
            "description": "Present only in the rare case where computation succeeded but\nStripe card-capture subsequently failed after two retries. In\nthat case the allocation is delivered in full and the card is\nnot charged; the user is directed to email `api@ria.us` if they\nwould like to be billed manually.\n"
          }
        }
      },
      "ClientPersonalInformationEcho": {
        "type": "object",
        "description": "Echo of selected client-identifying fields so callers (and their\nlogs) can correlate requests with responses without retaining the\nfull request body.\n",
        "properties": {
          "client_first_name": {
            "type": "string"
          },
          "client_last_name": {
            "type": "string"
          },
          "client_email_address": {
            "type": "string"
          }
        }
      },
      "HouseholdBlock": {
        "type": "object",
        "required": ["total_allocatable_wealth", "total_background_wealth", "total_wealth", "optimal_allocation", "optimal_portfolio"],
        "properties": {
          "total_allocatable_wealth": {
            "type": "number",
            "description": "Total household wealth subject to optimization (echoed from\n`household_liquid_wealth` in the request, rounded to cents).\n"
          },
          "total_background_wealth": {
            "type": "number",
            "description": "Present value of all background assets — Social Security,\nMedicare, pensions, human capital, real estate, annuities, life\ninsurance cash values, vehicles, bank CDs, and other background\nwealth.\n"
          },
          "total_wealth": {
            "type": "number",
            "description": "Sum of allocatable and background wealth."
          },
          "optimal_allocation": {
            "type": "object",
            "required": ["empirical_global_market_portfolio", "risk_free_asset"],
            "properties": {
              "empirical_global_market_portfolio": {
                "type": "number",
                "minimum": 0,
                "maximum": 1,
                "description": "Fraction of allocatable wealth to invest in the EGMP (α*).\n"
              },
              "risk_free_asset": {
                "type": "number",
                "minimum": 0,
                "maximum": 1,
                "description": "Fraction to hold risk-free (equals `1 −\nempirical_global_market_portfolio`).\n"
              }
            }
          },
          "certainty_equivalent": {
            "type": "object",
            "description": "Single-period certainty equivalent of total household wealth,\nin dollars, implied by the CRRA utility evaluated at the\nrecommended allocation after the [0, 1] no-leverage cap. When\nthe cap binds, this differs from (and is below) the certainty\nequivalent of the unconstrained optimum. Omitted (empty\nobject) when the value cannot be computed for numerical edge\ncases. This is NOT a Lifetime Certainty Equivalent.\n",
            "properties": {
              "basis": {
                "type": "string",
                "enum": "single_period_total_wealth"
              },
              "value": {
                "type": "number",
                "description": "Dollar amount, rounded to cents."
              }
            }
          },
          "optimal_portfolio": {
            "$ref": "#/components/schemas/OptimalPortfolio"
          }
        }
      },
      "OptimalPortfolio": {
        "type": "object",
        "required": ["allocatable", "total"],
        "description": "Expected return, standard deviation, and Sharpe ratio for the\nportfolio at two scopes (allocatable, total) and two tax\ntreatments (before_tax, after_tax).  Ocelot℠ Core optimizes for\nthe after-tax case because pre-tax inputs systematically\noverallocate to the risky portfolio; before-tax values are\nincluded for comparison and reporting.  All numbers are\nrounded to 4 decimals.\n",
        "properties": {
          "allocatable": {
            "$ref": "#/components/schemas/PortfolioStatPair"
          },
          "total": {
            "$ref": "#/components/schemas/PortfolioStatPair"
          }
        }
      },
      "PortfolioStatPair": {
        "type": "object",
        "required": ["before_tax", "after_tax"],
        "properties": {
          "before_tax": {
            "$ref": "#/components/schemas/PortfolioStatTriple"
          },
          "after_tax": {
            "$ref": "#/components/schemas/PortfolioStatTriple"
          }
        }
      },
      "PortfolioStatTriple": {
        "type": "object",
        "required": ["expected_return", "std_dev", "sharpe_ratio"],
        "properties": {
          "expected_return": {
            "type": "number",
            "description": "Expected return (decimal, e.g. 0.1957 = 19.57%)."
          },
          "std_dev": {
            "type": "number",
            "description": "Standard deviation (decimal).  NOT variance."
          },
          "sharpe_ratio": {
            "type": "number",
            "description": "Sharpe ratio = (expected_return - rf) / std_dev, where rf is\ntaken on the SAME tax basis as the numerator and denominator\n(before_tax uses rf_before_tax, after_tax uses rf_after_tax).\n"
          }
        }
      },
      "RiskFreeRate": {
        "type": "object",
        "required": ["before_tax", "after_tax"],
        "description": "Risk-free rate on both tax bases.  before_tax is the long-bond\nnominal yield used as `rf` throughout the model; after_tax is\n`rf * (1 - effective_investment_tax_rate)`, used when the\nobjective is the after-tax Sharpe ratio.\n",
        "properties": {
          "before_tax": {
            "type": "number",
            "description": "Pre-tax risk-free rate (decimal)."
          },
          "after_tax": {
            "type": "number",
            "description": "After-tax risk-free rate (decimal)."
          }
        }
      },
      "PortfolioComponent": {
        "type": "object",
        "required": ["ticker", "name", "proxy_for", "weight", "household_amount_to_invest"],
        "properties": {
          "ticker": {
            "$ref": "#/components/schemas/EGMPTickerEnum"
          },
          "name": {
            "type": "string",
            "description": "ETF full name."
          },
          "proxy_for": {
            "type": "string",
            "description": "Asset class the ticker represents within the EGMP. Specific\nasset-class labels are returned at runtime and are not\nenumerated here.\n"
          },
          "weight": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Fraction of the market portfolio this ticker represents."
          },
          "household_amount_to_invest": {
            "type": "number",
            "minimum": 0,
            "description": "Dollar amount the household should invest in this ticker —\nequals `total_allocatable_wealth ×\noptimal_allocation.empirical_global_market_portfolio × weight`,\nrounded to cents.\n"
          }
        }
      },
      "RiskFreeAllocation": {
        "type": "object",
        "required": ["name", "household_allocation", "amount_to_invest", "description"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Always `Risk-Free Asset`."
          },
          "household_allocation": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Fraction of allocatable wealth held risk-free."
          },
          "amount_to_invest": {
            "type": "number",
            "minimum": 0,
            "description": "Dollar amount to hold in the risk-free asset."
          },
          "description": {
            "type": "string",
            "description": "Always `Optimal household allocation to risk-free asset`."
          }
        }
      },
      "StrategyRecommendation": {
        "type": "object",
        "description": "A single curated wealth-building or wealth-preservation strategy\nrecommendation. Which strategies are returned depends on the\nhousehold's profile; strategies not applicable to the household are\nsuppressed server-side.\n",
        "required": ["short_description", "long_description", "rationale"],
        "properties": {
          "short_description": {
            "type": "string",
            "description": "One-paragraph summary of the strategy, including 2026 statutory\ndollar limits where applicable.\n"
          },
          "long_description": {
            "type": "string",
            "format": "uri",
            "description": "URL to the full article for this strategy on the firm's\neducational site (e.g.,\n`https://www.ria.us/strategies/Roth_IRA.html`).\n"
          },
          "rationale": {
            "type": "string",
            "description": "Why this strategy may be suitable for a household of this\nprofile.\n"
          },
          "risk_factors": {
            "description": "One or more risks associated with the strategy. Most strategies\nreturn an array of strings; a handful return a single string.\n",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "irs_citation": {
            "type": "string",
            "description": "Relevant IRS Code section, Treasury Regulation, or other\nauthoritative reference. Usually present but not guaranteed on\nevery strategy.\n"
          }
        }
      },
      "BalanceSheet": {
        "type": "object",
        "required": ["assets", "liabilities", "net_worth"],
        "description": "Household Economic Balance Sheet. This is **not** a GAAP balance\nsheet — it is a Merton-framework economic balance sheet where the\nprincipal liability is the present value of future expenses and\nassets include the present value of future income streams (human\ncapital, business capital, Social Security, pensions, annuities).\n",
        "properties": {
          "assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceSheetAsset"
            }
          },
          "liabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceSheetLiability"
            }
          },
          "net_worth": {
            "type": "number",
            "description": "Economic net worth = sum of asset values − sum of liability\nvalues. Equals `total_wealth` from the household block to within\nrounding.\n"
          }
        }
      },
      "BalanceSheetAsset": {
        "type": "object",
        "required": ["name", "type", "value"],
        "description": "A single line item on the assets side. Items with the same `type`\n(and optionally `subcategory`) are grouped together by the\nfrontend renderer, with \"Total ...\" lines emitted after each group.\n",
        "properties": {
          "name": {
            "type": "string",
            "description": "Line-item label (e.g., `Market`, `Riskless`, `Traditional IRAs`,\n`Real Estate, at Market Value`, `High-skill Employment PV`,\n`Government Pensions PV`, `Total Human Capital`,\n`Total Tangible Background Assets`).\n"
          },
          "type": {
            "$ref": "#/components/schemas/BalanceSheetAssetTypeEnum"
          },
          "subcategory": {
            "type": "string",
            "description": "Optional second-level grouping. Observed values include\n`Human Capital`, `Business Capital`,\n`Social Security & Medicare`, `Pensions & Annuities`,\n`Other Income`.\n"
          },
          "value": {
            "type": "number",
            "description": "Dollar value of the line item."
          }
        }
      },
      "BalanceSheetLiability": {
        "type": "object",
        "required": ["name", "type", "value"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Line-item label (e.g., `Total Annual Expenses PV`).\n"
          },
          "type": {
            "$ref": "#/components/schemas/BalanceSheetLiabilityTypeEnum"
          },
          "value": {
            "type": "number",
            "description": "Dollar value of the liability (present value of future\nexpenses).\n"
          }
        }
      },
      "RetirementAccountsByType": {
        "type": "object",
        "required": ["traditional_ira", "roth_ira", "sep_ira", "simple_ira", "traditional_401k", "roth_401k", "solo_401k"],
        "description": "Household totals by retirement-account type, summed across client\nand spouse. All seven keys are always present; types the household\ndoes not have are returned as `0`.\n",
        "properties": {
          "traditional_ira": {
            "type": "number",
            "minimum": 0
          },
          "roth_ira": {
            "type": "number",
            "minimum": 0
          },
          "sep_ira": {
            "type": "number",
            "minimum": 0
          },
          "simple_ira": {
            "type": "number",
            "minimum": 0
          },
          "traditional_401k": {
            "type": "number",
            "minimum": 0
          },
          "roth_401k": {
            "type": "number",
            "minimum": 0
          },
          "solo_401k": {
            "type": "number",
            "minimum": 0
          }
        }
      },
      "IncomeStatement": {
        "type": "object",
        "required": ["income", "expenses", "net_income"],
        "description": "Household income statement. `future_income[]` captures income\nstreams that will **begin** after a deferral period (e.g., deferred\nannuities) — **not** included in current-year `income[]` totals or\n`net_income`, by design.\n",
        "properties": {
          "income": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncomeItem"
            }
          },
          "expenses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncomeStatementExpenseItem"
            }
          },
          "net_income": {
            "type": "number",
            "description": "Sum of income items (including their internal \"Total ...\" lines\naren't double-counted) minus sum of expense items. Reported\nbefore personal income tax.\n"
          },
          "future_income": {
            "type": "array",
            "description": "Future-income streams (deferred annuities, etc.). Empty array if\nthe household has none.\n",
            "items": {
              "$ref": "#/components/schemas/FutureIncomeItem"
            }
          }
        }
      },
      "IncomeItem": {
        "type": "object",
        "required": ["name", "type", "annual_amount"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Income-line label (e.g., `High-skill Employment Income`,\n`Retail Business Income`, `Pension Income`,\n`Social Security Income`, `RMD Income`, `Investment Income`,\n`Real Estate Rental Income (Actual)`,\n`Imputed Rent (Owner-Occupied)`, `Other Annual Income`, or a\n`Total ...` rollup).\n"
          },
          "type": {
            "$ref": "#/components/schemas/IncomeStatementIncomeTypeEnum"
          },
          "subcategory": {
            "type": "string",
            "description": "Optional second-level grouping (e.g., `Human Capital`,\n`Business Capital`).\n"
          },
          "annual_amount": {
            "type": "number"
          },
          "note": {
            "type": "string",
            "description": "Free-text note rendered by the web UI beneath the line (e.g.,\n`Taxable rental income from tenant-occupied properties`,\n`Non-taxable economic benefit of owner-occupied housing`).\n"
          }
        }
      },
      "IncomeStatementExpenseItem": {
        "type": "object",
        "required": ["name", "type", "annual_amount"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Expense-line label (e.g.,\n`Total Annual Real Estate Expenses`,\n`Total Annual Household Expenses`).\n"
          },
          "type": {
            "$ref": "#/components/schemas/IncomeStatementExpenseTypeEnum"
          },
          "annual_amount": {
            "type": "number"
          }
        }
      },
      "FutureIncomeItem": {
        "type": "object",
        "required": ["name", "type", "annual_amount"],
        "properties": {
          "name": {
            "type": "string",
            "description": "E.g., `Deferred Annuity Income (Future)`.\n"
          },
          "type": {
            "$ref": "#/components/schemas/IncomeStatementFutureIncomeTypeEnum"
          },
          "annual_amount": {
            "type": "number"
          },
          "deferred_cola_portion": {
            "type": "number",
            "description": "Portion of the deferred income that comes from COLA growth\nduring deferral. Present only when non-zero.\n"
          },
          "deferred_joint_survivor_portion": {
            "type": "number",
            "description": "Portion representing joint-life survivor continuation. Present\nonly when non-zero.\n"
          },
          "starts_in_years": {
            "type": "number",
            "description": "Years until payments begin, averaged across multiple deferred\nannuities if more than one is present.\n"
          },
          "note": {
            "type": "string",
            "description": "Typically `Not included in current income; will begin after\ndeferral period`.\n"
          }
        }
      },
      "DataQualityWarnings": {
        "type": "object",
        "description": "Non-blocking data-quality advisories. Present only when the API\ndetects issues the household should review — a duplicate EIN, a\nduplicate `employer_name` + `employee_id`, etc. If no issues are\nfound, this field is absent (not `{}`).\n\nThe web interface renders this as a yellow advisory panel. Surfacing\nthese on the success path discharges the fiduciary duty to disclose\nmaterial facts that could affect the client's decision (CA Corp\nCode §25235; CCR §260.238).\n",
        "properties": {
          "employment_business": {
            "type": "object",
            "description": "Warnings related to duplicate or inconsistent employment /\nbusiness entries across client and spouse.\n",
            "properties": {
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Free-text warning messages for the end-user.\n"
              },
              "duplicate_businesses": {
                "type": "boolean",
                "description": "`true` when two businesses share the same `ein` across the\nclient and spouse blocks. The duplicate is deduplicated\nserver-side; this flag warns the user.\n"
              },
              "duplicate_employments": {
                "type": "boolean",
                "description": "`true` when two employments share the same `employer_name` +\n`employee_id` across client and spouse. The duplicate is\ndeduplicated server-side.\n"
              }
            }
          }
        }
      },
      "Goal": {
        "type": "object",
        "required": ["purpose", "amount", "date"],
        "description": "PLAN-V1.0. A dated outlay beyond the ordinary expenses. `committed`:\nthe article's set-aside -- funded today with a Treasury maturing\nbefore the date (TIPS when `inflation_linked`), sized at the bill's\npresent value at the AFTER-TAX yield, held outside the rule, removed\nfrom the allocatable and the shadow wealth together with the\nobligation; it appears among the reserves with `source: goal` and\ncounts in the reserves rule. `discretionary`: future consumption that\nscales with wealth; nothing in the allocation changes, and\n`plan.goals[]` reports the wealth expected at the date, the cost\nafter the capital-gains tax on the sale, the share of wealth it takes,\nthe probability it can be paid while the household stays fully funded\nfor its entered expenses, and the permanent reduction in sustainable\nspending afterwards.\n",
        "properties": {
          "purpose": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "In today's dollars unless in_todays_dollars is false."
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "When it is paid; after the valuation date."
          },
          "kind": {
            "type": "string",
            "enum": ["committed", "discretionary"],
            "default": "discretionary"
          },
          "in_todays_dollars": {
            "type": "boolean",
            "default": true,
            "description": "true: amount is inflated to the date at the inflation rate; false: amount is the nominal sum due."
          },
          "inflation_linked": {
            "type": "boolean",
            "description": "Committed goals: fund with TIPS at the real yield (default: in_todays_dollars)."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "Holding": {
        "type": "object",
        "required": "symbol",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "shares": {
            "type": "number",
            "minimum": 0
          },
          "price": {
            "type": "number",
            "minimum": 0
          },
          "cost_basis": {
            "type": "number",
            "minimum": 0,
            "description": "PLAN-V1.0: the position's total cost basis, for the deferred tax on the unrealized gain."
          }
        }
      },
      "PlanSettings": {
        "type": "object",
        "description": "PLAN-V1.0. The spending rule's settings. `planning_age` (70-110): the\nage at which the plan ends (default: the life expectancy of the\nlonger-lived person, so that the spending base and the balance\nsheet's expense liabilities end on the same date; the article's\nconvention is 100). `time_preference` (0-0.10): delta, the rate of\ntime preference (default: the after-tax risk-free rate).\n`spending_growth_offset` (-0.05-0.05): added to the planned growth\nrate of spending (0: the rule's own; a household that wants level\nreal spending enters minus the reported g).\n",
        "properties": {
          "planning_age": {
            "type": "number",
            "minimum": 70,
            "maximum": 110
          },
          "time_preference": {
            "type": "number",
            "minimum": 0,
            "maximum": 0.1
          },
          "spending_growth_offset": {
            "type": "number",
            "minimum": -0.05,
            "maximum": 0.05
          }
        }
      },
      "Reserve": {
        "type": "object",
        "required": ["purpose", "amount"],
        "description": "A near-term expense that must be paid with certainty (a tax balance,\ncontracted work, tuition, a car). On `/core` the array sits at the top\nlevel of the request. Each reserve is carried at its PRESENT VALUE\n(RESERVE-PV-V1.0; after tax from PLAN-V1.0): amount / (1 + y (1 - t_f))^t,\nwhere t is the time in years (days / 365.25) from the valuation date\nto the due date, y the Treasury yield for that tenor and t_f the\nhousehold's federal marginal rate on the interest (Treasury interest\nis exempt from state tax; the rate is estimated from the request's\nincome), interpolated on FRED's constant-maturity\ncurve (the pipeline's gmp_builder/treasury_yields.json when present,\notherwise fetched from FRED; a reserve flagged inflation_linked is\ndiscounted on the real TIPS curve). The sum of the present values is\ntaken out of the household's liquid wealth before anything else is\ncomputed -- what remains is the allocatable wealth -- and each reserve\nis held outside the optimization in a Treasury instrument sized to that\npresent value: the Treasury money fund when due within a year (or with\nno date), a Treasury bill or note of the bill's face value maturing\nabout a month before the bill when due later. On the balance sheet\nthe reserve is an asset and the bill a liability, both at present\nvalue. A reserve without a due date is carried at face value.\n",
        "properties": {
          "purpose": {
            "type": "string",
            "description": "What the money is for (e.g. 'April tax balance')."
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "description": "The bill, in dollars (whole dollars are used): the face value due on the date."
          },
          "due_date": {
            "type": "string",
            "format": "date",
            "description": "YYYY-MM-DD. The date the bill is paid; the reserve is discounted to the valuation date from it. Optional; without it the reserve is carried at face value in the money fund and sold as the bill falls due."
          },
          "instrument": {
            "type": "string",
            "description": "Optional override of the instrument the API would choose."
          },
          "inflation_linked": {
            "type": "boolean",
            "description": "If true the amount is in today's dollars: it is discounted on the real (TIPS) curve, and when due more than a year out a TIPS maturing before the bill is named instead of a nominal Treasury."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "BackgroundItem": {
        "type": "object",
        "required": ["name", "kind"],
        "description": "Something the household owns or owes that cannot be traded, valued at\nits after-tax present value over the horizon (as the portfolio\nproject's intake values them). `sign` is +1 for an asset and −1 for an\nobligation. `kind` selects the formula:\n- `stream`: annual × after_tax × a(horizon, real_rate − growth), with\n  a(n, r) = (1 − (1 + r)^−n) / r;\n- `balance`: balance × after_tax;\n- `lump`: amount × (1 + nominal_rate)^−horizon;\n- `fixed`: value.\nEach present value is rounded to the nearest $100 before it enters\nthe shadow wealth. An item with a `loading` and a `proxy` fund is\nhedged through that fund: loading × value / W is subtracted from the\nproxy's line (a house: loading 2/3 on VNQ).\n",
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": ["stream", "balance", "lump", "fixed"]
          },
          "sign": {
            "type": "integer",
            "enum": [1, -1],
            "default": 1
          },
          "annual": {
            "type": "number",
            "description": "stream: the annual amount in today's dollars."
          },
          "after_tax": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 1,
            "description": "stream, balance: fraction kept after tax."
          },
          "real_rate": {
            "type": "number",
            "description": "stream: real discount rate (e.g. 0.02)."
          },
          "growth": {
            "type": "number",
            "default": 0,
            "description": "stream: real growth of the amount (0.07 for care costs)."
          },
          "balance": {
            "type": "number",
            "description": "balance: the account balance."
          },
          "amount": {
            "type": "number",
            "description": "lump: the amount at the horizon."
          },
          "nominal_rate": {
            "type": "number",
            "description": "lump: nominal discount rate (e.g. 0.04)."
          },
          "value": {
            "type": "number",
            "description": "fixed: the value today."
          },
          "loading": {
            "type": "number",
            "default": 0,
            "description": "Fraction of the value that moves with the proxy fund."
          },
          "proxy": {
            "type": "string",
            "description": "Ticker of the fund the item is hedged through (e.g. VNQ)."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "AllocationInputs": {
        "type": "object",
        "required": ["gamma", "balance_sheet"],
        "description": "The balance-sheet form of the allocation's inputs, for `POST\n/allocate`. (`/core` builds the same inputs itself from the household\nit is given: gamma from the max premium, the allocatable wealth less\nthe request's `reserves`, its own background wealth, and the real\nestate as the hedged asset.)\n",
        "properties": {
          "label": {
            "type": "string",
            "description": "Free text printed at the head of the report."
          },
          "gamma": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Coefficient of relative risk aversion."
          },
          "egmp_premium": {
            "type": "number",
            "default": 0.04,
            "description": "mu_EGMP − r_f (the portfolio project's calibration)."
          },
          "egmp_vol": {
            "type": "number",
            "default": 0.12,
            "description": "sigma_EGMP."
          },
          "life_expectancy_years": {
            "type": "number",
            "description": "The horizon over which streams and lump sums are valued: life\nexpectancy for a retiree, years to the goal otherwise. Required\nwhen any background item is a stream or a lump sum.\n"
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "description": "Date of the balances; today if omitted. Reserve due dates are measured from it."
          },
          "egmp": {
            "description": "The market portfolio: a plain file name in the server's EGMP folder\n(default `gmp_weights.json`), a GMP-WEIGHTS-V1 object sent inline,\nor a bare list of `{ticker, x}` lines.\n",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object"
              },
              {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            ]
          },
          "balance_sheet": {
            "type": "object",
            "required": ["funds", "brokerage_cash", "checking"],
            "properties": {
              "funds": {
                "type": "number",
                "description": "Fund positions at market."
              },
              "brokerage_cash": {
                "type": "number",
                "description": "Brokerage cash, money funds included."
              },
              "checking": {
                "type": "number"
              },
              "other_liquid": {
                "type": "number",
                "default": 0
              }
            }
          },
          "reserves": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Reserve"
            }
          },
          "background_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BackgroundItem"
            }
          },
          "hedges": {
            "type": "array",
            "description": "Optional explicit hedges `{item, value, loading, proxy}` overriding the loadings of the background items.",
            "items": {
              "type": "object"
            }
          },
          "accounts": {
            "type": "object",
            "description": "Labels used in the instructions.",
            "properties": {
              "brokerage": {
                "type": "string"
              },
              "checking": {
                "type": "string"
              },
              "treasury_fund": {
                "type": "string",
                "default": "SNSXX"
              },
              "treasury_fund_name": {
                "type": "string"
              },
              "checking_target": {
                "type": "number",
                "description": "Balance to bring checking to at the monthly transfer."
              }
            }
          },
          "cash_flow": {
            "type": "object",
            "properties": {
              "monthly_spending": {
                "type": "number"
              },
              "monthly_income": {
                "type": "number",
                "description": "Income deposited to checking each month."
              }
            }
          },
          "tax": {
            "$ref": "#/components/schemas/TaxBlock"
          },
          "covariance": {
            "type": "object",
            "description": "The spillover regression's inputs (the rebalancer's cov_* settings).",
            "properties": {
              "prices_csv": {
                "description": "A plain file name in the EGMP folder: a Date-indexed CSV of\ndaily closes with one column per ticker (the universe plus the\nproxies BTC-USD, ETH-USD and XRP-USD), as written by\ntests/egmp/export_cov_prices.py — or the same data sent\ninline as `{dates: [...], closes: {TICKER: [...]}}`. Omitted:\nthe API fetches the window from Yahoo Finance.\n",
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object"
                  }
                ]
              },
              "window_years": {
                "type": "number",
                "default": 3
              },
              "shrink": {
                "type": "number",
                "default": 0.25,
                "description": "Shrinkage of the covariance toward its diagonal."
              },
              "min_days": {
                "type": "integer",
                "default": 200
              },
              "proxies": {
                "type": "object",
                "default": {
                  "BTC": "BTC-USD",
                  "ETH": "ETH-USD",
                  "XRPZ": "XRP-USD"
                },
                "description": "Longer-lived series spliced into a young fund's history.",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          },
          "spillover_method": {
            "type": "string",
            "enum": ["proportional", "exact"],
            "default": "proportional"
          },
          "holdings": {
            "type": "array",
            "description": "Optional current positions with a price each, for the trade list.",
            "items": {
              "type": "object",
              "required": "symbol",
              "properties": {
                "symbol": {
                  "type": "string"
                },
                "shares": {
                  "type": "number"
                },
                "price": {
                  "type": "number"
                },
                "cost_basis": {
                  "type": "number",
                  "description": "PLAN-V1.0: carried to the trade list with the unrealized gain."
                }
              }
            }
          },
          "interest_tax_rate": {
            "type": "number",
            "description": "PLAN-V1.0: the federal marginal rate on Treasury interest; the reserves are discounted at y (1 - interest_tax_rate). Default 0 on /allocate; /core supplies the household's rate."
          }
        }
      },
      "AllocationResult": {
        "type": "object",
        "description": "The allocation in the fields the portfolio project writes to its\nconfiguration, plus the reserves, the risk-free layer, the\ninstructions and a plain-text report. `/core` returns this object as\n`optimal_portfolio_details`.\n",
        "properties": {
          "schema": {
            "type": "string",
            "enum": "EGMP-ALLOCATION-V1"
          },
          "version": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": "CLIENT-DERIVE-V1.0"
          },
          "label": {
            "type": "string"
          },
          "generated": {
            "type": "string"
          },
          "valuation_date": {
            "type": "string"
          },
          "egmp": {
            "type": "object",
            "properties": {
              "variant": {
                "type": "string"
              },
              "built": {
                "type": "string"
              },
              "basis": {
                "type": "string"
              },
              "universe_T": {
                "type": "number"
              },
              "n_lines": {
                "type": "integer"
              },
              "source": {
                "type": "string"
              }
            }
          },
          "egmp_lines": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "inputs": {
            "type": "object"
          },
          "balance_sheet": {
            "type": "object",
            "description": "liquid, reserves, residue (W), background present values, shadow (W~), ratio, hedges, notes."
          },
          "derivation": {
            "type": "object",
            "description": "The per-line derivation — alpha_star, W, W_shadow,\nratio, m, the per-line table (x, spec, q, net_unconstrained, pi,\nfinal, dollars, floored), the floored set, remainders, the\nregression coefficients b, kappa (raw and clipped), the common\nfactor, the cap, risky_share, cov_notes, the sensitivity table\n(each row the whole procedure re-run at that gamma, with its\nrisky_share, risk_free_from_rule, scale and note) and\n`cap_binds_below_gamma`, the risk aversion below which the\nno-borrowing cap binds (by bisection on the procedure).\nWith a tax block (TAX-AWARE-V1.0) `method` is CLIENT-DERIVE-V2.0,\n`W` is the after-tax residue A (`W_market_value` the residue at\nmarket value), each line carries d, location (T taxable / S\nsheltered), holding_taxable, holding_tax_deferred_pretax,\nholding_tax_exempt, `exposure_total` is the exposure before the\ngross-up, `accounts` the after-tax balances and the risk-free\nholding per account, and `tax` the rates, r_f, delta, the\nmortality hazard, lambda, tau_g_eff, delta_M, alpha_star_pretax,\nd_mean and the per-line character, yield, tau_d, kappa, d and\nwedge.\n"
          },
          "derivation_pretax": {
            "type": "object",
            "description": "With a tax block: the same derivation by the pre-tax rule (CLIENT-DERIVE-V1.0) for comparison — alpha_star, m, risky_share, risk_free_share, line_weights, sensitivity, cap_binds_below_gamma."
          },
          "allocation": {
            "type": "object",
            "properties": {
              "alpha_star": {
                "type": "number"
              },
              "multiplier": {
                "type": "number"
              },
              "risky_share_of_residue": {
                "type": "number"
              },
              "risky_target_value": {
                "type": "number"
              },
              "risk_free_set_aside": {
                "type": "number"
              },
              "line_weights": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                }
              },
              "line_dollars": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                }
              },
              "excluded_symbols": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          },
          "risk_free_layer": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "destination": {
                  "type": "string"
                },
                "amount": {
                  "type": "number"
                },
                "instrument": {
                  "type": "string"
                },
                "instruction": {
                  "type": "string"
                },
                "due": {
                  "type": "string"
                }
              }
            }
          },
          "risk_free_layer_total": {
            "type": "number"
          },
          "risk_free_layer_detail": {
            "type": "object"
          },
          "sensitivity": {
            "type": "object"
          },
          "sensitivity_explanation": {
            "type": "object",
            "description": "SENSITIVITY-EXPLAINED-V1.0: the sensitivity table explained in plain English from the household's own figures -- why the rows at and below the cap's boundary are identical (the rule is sized on total wealth, the multiplier exceeds one, the no-borrowing cap sets the holding), why a capped row can show less than one hundred percent, and what to take from the table. `adviser` is the full account, `client` the abbreviated one without symbols; each an array of paragraphs. The client's results carry `client` alone.",
            "properties": {
              "adviser": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "client": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "trades": {
            "type": "object",
            "nullable": true
          },
          "account_instructions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "report_text": {
            "type": "string",
            "description": "The whole result as plain text, in the layout of the rebalancing report."
          },
          "payment_warning": {
            "type": "string",
            "description": "Present only if a pay-per-call capture failed after the result was computed."
          }
        }
      },
      "AllocationSettings": {
        "type": "object",
        "description": "Optional `allocation` object on `/core`. `method` selects the\nallocation reported: `egmp` (default) is the balance-sheet allocation\non the measured market portfolio; `single_factor` reports the\nsingle-factor Merton result alone. The other fields are rarely needed.\n",
        "properties": {
          "method": {
            "type": "string",
            "enum": ["egmp", "single_factor"],
            "default": "egmp"
          },
          "egmp": {
            "type": "string",
            "description": "File name of the market portfolio in the EGMP folder (default gmp_weights.json)."
          },
          "egmp_premium": {
            "type": "number",
            "default": 0.04
          },
          "egmp_vol": {
            "type": "number",
            "default": 0.12
          },
          "real_estate_hedge": {
            "type": "string",
            "enum": ["blend", "single_proxy"],
            "default": "blend",
            "description": "RE-BLEND-V3.0. blend (default): each property carries the loadings acted on -- the positive posterior loadings of housing on the stock lines (VTI and VXUS, by market weight) and SCHP, from the pipeline's re_loadings.json, where the regression of the de-smoothed FHFA house-price index on VTI, SCHP and BND at the three-year horizon is combined by precision with the published evidence (no covariance of housing with the funds: Flavin and Yamashita 2002; Cocco 2005; Case, Cotter and Gabriel 2011; Jorda et al. 2019) -- times a class factor (owner-occupied home 0.8125, other property 1); l_f x value is subtracted from each fund, never below zero. A negative posterior loading (housing against nominal bonds in 2004-2026) is reported and not acted on. Without re_loadings.json there is no hedge. single_proxy: the pre-V1.6 treatment, real_estate_loading on real_estate_proxy for every property."
          },
          "real_estate_loading": {
            "type": "number",
            "default": 0.6667,
            "description": "Used only with real_estate_hedge = single_proxy: the loading of the household's real estate on real_estate_proxy."
          },
          "real_estate_proxy": {
            "type": "string",
            "default": "VNQ",
            "description": "Used only with real_estate_hedge = single_proxy."
          },
          "spillover_method": {
            "type": "string",
            "enum": ["proportional", "exact"],
            "default": "proportional"
          },
          "valuation_date": {
            "type": "string",
            "format": "date"
          },
          "covariance": {
            "type": "object",
            "description": "As in AllocationInputs.covariance (prices_csv defaults to cov_prices.csv when that file exists in the EGMP folder)."
          },
          "tax": {
            "description": "TAX-AWARE-V1.0. `/core` builds the household's tax block itself from\nits tax engine (the federal marginal rate on ordinary income, the\nfederal long-term rate, the NIIT, the state's marginal rate, the\nclient's remaining life as the mortality hazard) and derives the\nallocation by the tax-aware alpha vector. An object here overrides\nthose fields one by one (and adds `accounts` when part of the\nallocatable wealth is in an IRA or a Roth); `false` switches the\ntax-aware rule off and reports the pre-tax rule.\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/TaxBlock"
              },
              {
                "type": "boolean"
              }
            ]
          }
        }
      },
      "TaxBlock": {
        "type": "object",
        "description": "The household's taxes for the tax-aware alpha vector (TAX-AWARE-V1.0;\nthe companion report *The Merton Alpha Vector with Income,\nCapital-Gains, and Related Taxes*). Marginal rates as decimals. The\ncombined rate on each character of income is federal + NIIT + state\n(or federal + NIIT + state × (1 − federal) when `salt_deductible`).\nThe rule: the accrual-equivalent capital-gains rate\nτ_g^eff = τ_g κ/(κ + δ + m) (κ the realisation hazard, δ the after-tax\nTreasury yield, m = 1/life expectancy) gives each line's retention\nfactor d_i = 1 − τ_g^eff; the household's wedge on the market premium\nδ_M = Σ x_i δ_i over the lines held in the taxable account, with\nδ_i = [r_f(τ_i − τ_g,i^eff) − y_i(τ_d,i − τ_g,i^eff)]/d_i, gives\nα* = (p + δ_M)/(γσ²); after-tax liquid wealth replaces W; each line's\nexposure is divided by d_i (by 1 − τ_w in an IRA) to reach the holding;\nthe sign of δ_i places the line in the taxable or a sheltered account.\n",
        "required": ["federal_ordinary", "federal_qualified", "federal_ltcg", "niit", "state"],
        "properties": {
          "federal_ordinary": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Federal marginal rate on ordinary income (interest, non-qualified dividends)."
          },
          "federal_qualified": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Federal rate on qualified dividends (the long-term schedule: 0, 0.15 or 0.20)."
          },
          "federal_ltcg": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Federal statutory rate on long-term capital gains."
          },
          "niit": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Net investment income tax, 0.038 or 0."
          },
          "state": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "State marginal rate (California taxes every character alike)."
          },
          "salt_deductible": {
            "type": "boolean",
            "default": false,
            "description": "True when the state tax is deductible federally at the margin (the SALT cap does not bind)."
          },
          "withdrawal_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "τ_w on tax-deferred balances (default: the ordinary federal + state rate)."
          },
          "realization_hazard": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.1,
            "description": "κ, the share of unrealized gain realized in a year (an index fund: about 0.10)."
          },
          "risk_free_rate": {
            "type": "number",
            "description": "r_f for the wedge (default: the 3-month Treasury yield of treasury_yields.json)."
          },
          "life_expectancy_years": {
            "type": "number",
            "description": "e, for the mortality hazard m = 1/e (default: the block's life_expectancy_years; on /core the client's remaining life)."
          },
          "kappa_by_line": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "description": "Per-ticker realization hazards."
          },
          "characters": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "enum": ["qualified", "interest", "treasury", "municipal", "reit", "collectible", "none"]
            },
            "description": "Per-ticker income character overriding the defaults."
          },
          "yields": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "description": "Per-ticker income yields overriding the fund files' trailing yields."
          },
          "accounts": {
            "type": "object",
            "description": "The allocatable wealth by account type; default: all taxable with no unrealized gain. The parts must sum to the liquid wealth.",
            "properties": {
              "taxable": {
                "type": "number",
                "description": "Market value of the taxable accounts (default: liquid wealth less the sheltered balances)."
              },
              "unrealized_gain": {
                "type": "number",
                "default": 0,
                "description": "Unrealized gain in the taxable accounts; its deferred tax at τ_g^eff reduces after-tax wealth."
              },
              "tax_deferred": {
                "type": "number",
                "default": 0,
                "description": "Pre-tax balance of traditional IRAs and 401(k)s, worth (1 − τ_w) per dollar."
              },
              "tax_exempt": {
                "type": "number",
                "default": 0,
                "description": "Roth balances."
              }
            }
          }
        }
      },
      "Accounts": {
        "type": "object",
        "description": "Optional labels used in the instructions (`/core` and `/allocate`).",
        "properties": {
          "brokerage": {
            "type": "string"
          },
          "checking": {
            "type": "string"
          },
          "treasury_fund": {
            "type": "string",
            "default": "SNSXX"
          },
          "treasury_fund_name": {
            "type": "string"
          },
          "checking_target": {
            "type": "number"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": "status",
        "description": "Uniform error envelope returned on all non-2xx responses from every\nendpoint. The HTTP status code conveys the broad category (400 =\nvalidation, 401 = auth, 402 = payment, 500 = server error). The\n`error` field is a stable machine-readable identifier — callers\nshould branch on `error`, not on `message` (which may be reworded\nacross releases). When present, `details[]` lists per-field\nvalidation problems suitable for programmatic display next to form\nfields.\n",
        "properties": {
          "status": {
            "type": "string",
            "enum": "error",
            "description": "Always `error` on non-2xx responses."
          },
          "error": {
            "type": "string",
            "description": "Stable machine-readable error category. Observed values:\n`validation_failed`, `Asset validation failed`, `Unauthorized`,\n`Payment Required`, `Payment Failed`, `Missing advisor context`,\n`internal_error`.\n",
            "examples": ["validation_failed", "Payment Required"]
          },
          "message": {
            "type": "string",
            "description": "Human-readable error message suitable for display.",
            "examples": "Request failed validation (1 issue). Your card has NOT been charged."
          },
          "details": {
            "type": "array",
            "description": "Per-field validation problems. Present primarily when `error` is\n`validation_failed` or `Asset validation failed`. Each entry\nidentifies a specific field and the rule it violated. An empty\narray indicates the request body was itself malformed (e.g.,\nnon-JSON).\n",
            "items": {
              "$ref": "#/components/schemas/ValidationDetail"
            }
          },
          "trace": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Server-side stack trace. Returned only when the `DEBUG`\nenvironment variable is `TRUE` on the server. Not present in\nproduction responses.\n"
          }
        }
      },
      "ValidationDetail": {
        "type": "object",
        "required": ["field", "message", "rule"],
        "description": "A single field-level validation failure, surfaced inside\n`ErrorResponse.details` for `validation_failed` and\n`Asset validation failed` responses.\n",
        "properties": {
          "field": {
            "type": "string",
            "description": "Dot-path to the offending field, relative to the request body\nroot. Array items use bracket notation; root-level violations\nuse `(root)`.\n",
            "examples": ["client.financial_info.max_premium", "client.financial_info.real_estate[0].type", "spouse"]
          },
          "message": {
            "type": "string",
            "description": "Human-readable description of the failure.",
            "examples": ["must have required property 'max_premium'", "Must be 'individual' (got 'joint') when client is unmarried."]
          },
          "rule": {
            "type": "string",
            "description": "Stable identifier for the rule that was violated. Use this for\nprogrammatic handling; do not parse `message`. Values fall into\nthree families:\n\n1. `schema.<keyword>` — JSON Schema violation. `<keyword>` is\n   the keyword that failed: `required`, `type`, `minimum`,\n   `maximum`, `exclusiveMinimum`, `exclusiveMaximum`, `enum`,\n   `pattern`, `minItems`, `minLength`, etc.\n2. `array_item_rules.<array_name>` — conditional rule on an\n   array item (e.g., `array_item_rules.real_estate` fires when\n   a Multi-Family property's `units` is outside 2–4).\n3. Named cross-field rules:\n     - `marital_status_consistency`\n     - `california_residency`\n     - `claiming_age_consistency`\n     - `rents_xor_owner_occupied_per_person`\n     - `separate_property_only_when_separate_returns`\n     - `spouse_tax_filing_status_mirrors_client`\n     - `ssa_earnings_min_one_entry`\n     - `vehicle_vin_validation` (asset-validation path)\n     - `real_estate_address_validation` (asset-validation path)\n",
            "examples": ["schema.required", "array_item_rules.real_estate", "california_residency"]
          }
        }
      }
    }
  }
}