{
  "openapi": "3.1.0",
  "webhooks": {
    "traderEvents": {
      "post": {
        "operationId": "receiveTraderEvents",
        "tags": [
          "Webhooks"
        ],
        "summary": "Your endpoint receives a batch of trader events.",
        "description": "RixTrade POSTs to the URL you register. VERIFY EVERY DELIVERY before acting on it.\n\n**X-Rix-Signature** carries `t=<unix-seconds>,v1=<hex hmac-sha256>`. Recompute the MAC over the EXACT RAW BYTES of the body -- not over a re-serialisation of the parsed JSON, which will differ and fail to verify. Compare in constant time, and reject a timestamp outside your tolerance so a captured delivery cannot be replayed later.\n\n**Idempotency:** dedupe on each event's own `id`, NEVER on X-Rix-Batch-Id. A retry mints a fresh batch id, so deduping on it would re-execute every event in the batch.\n\n**Respond 2xx quickly.** Anything else is retried with backoff; do your work after acknowledging, not before.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookDelivery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged. The batch will not be redelivered."
          },
          "500": {
            "description": "Any non-2xx is retried with backoff."
          }
        },
        "parameters": [
          {
            "name": "X-Rix-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix-seconds>,v1=<hex hmac-sha256 over the raw body>"
          },
          {
            "name": "X-Rix-Key-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Which signing key produced the signature. Present so a rotation can be verified against both keys during the overlap."
          },
          {
            "name": "X-Rix-Batch-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifies this delivery ATTEMPT. Not an idempotency key -- see above."
          },
          {
            "name": "X-Rix-Event-Count",
            "in": "header",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "X-Rix-Api-Version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  },
  "info": {
    "title": "RixTrade Trader API",
    "version": "0.1.0",
    "description": "Per-user programmatic trading API.\n\nGENERATED from the code that enforces it (backend/src/contract/emit.ts). Do not edit:\n`npm run contract:check` regenerates and fails the build on any hand edit.\n\n## Conventions\n\n- **Money** is a JSON number in DOLLARS. Two decimals. Negative = debit.\n- **`limit_price` is a SIGNED NET** for the whole structure: negative = debit (you pay),\n  positive = credit (you receive). The fill rule is `net_price >= limit_price` on that\n  signed value.\n- **`structure_units` is not a contract count.** It is the number of whole structures;\n  the price axis is the GCD spread.\n- **Idempotency-Key is REQUIRED on order placement.** Reuse the same key when retrying\n  THAT order; generate a fresh one per distinct intent.\n- **`retry`** on every refusal says whether resending the identical request can succeed.\n\n## Venue\n\nFills are SIMULATED against vendor NBBO on paper accounts. Orders are not routed to any\nvenue, and there are no partial fills: `filled_quantity` is 0 or the full quantity. The\nfields exist so that a future venue does not become a breaking change."
  },
  "servers": [
    {
      "url": "https://rixtrade.com/api",
      "description": "production"
    }
  ],
  "components": {
    "securitySchemes": {
      "traderApiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A trader API key: `Authorization: Bearer rtk_live_...` (or `rtk_test_...` for sandbox)."
      },
      "sessionAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "A signed-in browser session. Unscoped: a session is the person's full authority."
      }
    },
    "headers": {
      "XRateLimitBurst": {
        "description": "Bucket capacity for this credential, after any rate tier.",
        "schema": {
          "type": "integer"
        }
      },
      "XRateLimitRefillPerSecond": {
        "description": "Sustained refill rate, after any rate tier.",
        "schema": {
          "type": "integer"
        }
      },
      "XRateLimitRemaining": {
        "description": "Tokens left in the bucket at the moment this request was charged.",
        "schema": {
          "type": "integer"
        }
      },
      "XRequestId": {
        "description": "Correlation id. Present on EVERY response, 2xx included -- quote it to support.",
        "schema": {
          "type": "string"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before resending. Sent on RATE-LIMIT refusals (429), where the bucket's refill time is known exactly. NOT sent on other `retry: \"backoff\"` refusals -- a halt, an absent quote or a closed market has no computable reopening time, and a number invented for one would send you back into the same wall on schedule. Use your own backoff there, and treat `retry` as the signal that waiting is the remedy at all.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "schemas": {
      "ErrorCode": {
        "type": "string",
        "description": "KNOWN VALUES (143, and the list GROWS): NOT_AUTHENTICATED, INVALID_API_KEY, MISSING_SCOPE, KEY_NOT_PERMITTED, ROUTE_NOT_DECLARED, ACCOUNT_NOT_FOUND, KEY_NOT_FOUND, INVALID_REQUEST, UNSUPPORTED_MEDIA_TYPE, PAYLOAD_TOO_LARGE, PROTOCOL, INVALID_SCOPE, IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_IN_FLIGHT, IDEMPOTENT_REPLAY_OF_REFUSAL, RATE_LIMITED, IDEMPOTENCY_KEY_EXPIRED, TRADER_API_DISABLED, STALE_DATA, SYMBOL_NOT_FOUND, BATCH_TOO_LARGE, UNDERLYING_UNAVAILABLE, DEMAND_REGISTRATION_DISABLED, DEMAND_LIMIT_EXCEEDED, MARKETDATA_DISABLED, MARKETDATA_NOT_ENTITLED, MARGIN_UNAVAILABLE, ORDER_NOT_A_ROLL, HISTORY_COVERAGE_INCOMPLETE, HISTORY_BUSY, INVALID_CURSOR, ACCOUNT_ADDRESS_CONFLICT, UNSUPPORTED_API_VERSION, IP_NOT_ALLOWED, ORDER_MARKET_CLOSED, ORDER_NO_QUOTES, ORDER_INSUFFICIENT_FUNDS, ORDER_DUPLICATE_LEG, ORDER_CLIENT_ORDER_ID_IN_USE, ORDER_LEG_COUNT, ORDER_INVALID_QUANTITY, ORDER_OVER_CLOSE, ORDER_NOT_FOUND, ORDER_NOT_PENDING, ORDER_WOULD_CLOSE_EXISTING, ORDER_STO_DELTA_FLOOR, ORDER_LEG_INTENT_MISMATCH, ORDER_MARGIN_INCREASE_EXCEEDS_BP, ORDER_CANCEL_FAILED, ACCOUNT_FAILED, ACCOUNT_DISABLED, ACCOUNT_CLOSING_ONLY, TRADING_HALTED, POLICY_REFUSED, ORDER_INTENT_MISMATCH, ORDER_MAX_POSITIONS, TRADING_OPEN_HALTED, NOT_FOUND, INTERNAL, KEY_CANNOT_MANAGE_KEYS, BAD_JSON, UNKNOWN_ACTION, ORDER_0DTE_CUTOFF, ORDER_STO_DELTA_UNKNOWN, ORDER_STO_MIN_CREDIT, CLOSE_EXCEEDS_LIFECYCLE, CLOSE_LEG_OF_STRUCTURE, ORDER_FIELD_NOT_APPLICABLE, ORDER_TRAIL_UNIT_MISMATCH, ORDER_TRAIL_EXCEEDS_EXTREME, ORDER_TRAIL_EXTREME_MISSING, RULE_MAX_DRAWDOWN, RULE_TRAILING_DRAWDOWN, RULE_ZERO_EQUITY_FLOOR, RULE_DAILY_LOSS, RULE_MAX_OPEN_POSITIONS, RULE_TRADING_HOURS, PROTECT_BAD_UNDERLYING_STOP, PROTECT_BAD_UNDERLYING_TARGET, PROTECT_NO_UNDERLYING_QUOTE, KEY_CANNOT_MANAGE_WEBHOOKS, INVALID_WEBHOOK_URL, WEBHOOK_ALREADY_EXISTS, WEBHOOK_SIGNING_UNAVAILABLE, OPRA_AGREEMENT_REQUIRED, ENTITLEMENT_UNAVAILABLE, PROTECT_BAD_STOP_DIRECTION, PROTECT_BAD_TARGET_DIRECTION, PROTECT_ZERO_MARK, PROTECT_NO_POSITION, PROTECT_QTY_EXCEEDS_POSITION, PROTECT_STOP_OVER_CAPACITY, PROTECT_TARGET_OVER_CAPACITY, PROTECT_NEEDS_STOP_OR_TARGET, POSITION_NOT_FOUND, PROTECT_LEG_OF_STRUCTURE, COPY_FOLLOWER_CANNOT_PLACE, COPY_FOLLOWER_CANNOT_CANCEL, COPY_FOLLOWER_CANNOT_MODIFY, COPY_SELF_FOLLOW, COPY_INVALID_MULTIPLIER, COPY_ALREADY_LINKED, COPY_DIFFERENT_USERS, COPY_LEADER_IS_FOLLOWER, COPY_FOLLOWER_IS_LEADER, COPY_FOLLOWER_NOT_FLAT, COPY_ACCOUNT_NOT_FOUND, COPY_NOT_FOLLOWING, COPY_LEADER_NOT_ACCEPTING, COPY_CANNOT_LEAD, COPY_FOLLOWERS_OUT_OF_SCOPE, ACCOUNT_REWOUND, CASH_NO_SHORT_CLOSE, CASH_NO_SHORT_OPEN, COPY_RELATIONSHIP_CHANGED, FIRM_CONTRACT_BLOCKED, FIRM_CONTRACT_NOT_ALLOWED, ORDER_BLOCKED_TICKER, ORDER_BRACKET_CHILD_LOCKED, ORDER_CONTRACT_CEASED, ORDER_DAY_CUTOFF, ORDER_DIFFERENT_UNDERLYINGS, ORDER_EXPIRED_CONTRACT, ORDER_FEED_NOT_READY, ORDER_FORCE_FILL_NEEDS_PRICE, ORDER_NO_OVERNIGHT_INDEX, ORDER_POSITION_AWAITING_SETTLEMENT, ORDER_QTY_EXCEEDS_POSITION, ORDER_QTY_RATIO_SPREAD, ORDER_RESTRICTED_INDEX, ORDER_TRIGGER_AT_SPOT, ORDER_TRIGGER_CROSSES_EXIT, ORDER_TRIGGER_INVALID_PRICE, ORDER_TRIGGER_NO_SPOT, ORDER_ZERO_BID_OPENING, REDUCE_ONLY_NO_POSITION, RULE_MAX_CONTRACTS_PER_ORDER, RULE_TRADING_DISABLED, TICKER_NOT_OPENABLE, ORDER_INSTRUMENT_MALFORMED, ORDER_INSTRUMENT_NOT_PLACEABLE. Stable machine code — branch on this, never on `error`. Every code is described in the document’s `x-error-catalogue`, which gives its `retry` class and, for codes the engine raises, the HTTP status it arrives as and the `detail` keys it carries. New codes are added over time: keep a default arm and fall back to `retry`."
      },
      "RixTradeError": {
        "type": "object",
        "required": [
          "error",
          "code",
          "retry",
          "request_id"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable. Do not branch on this."
          },
          "request_id": {
            "type": "string",
            "description": "Quote this to support. Also on every response as the X-Request-Id header."
          },
          "code": {
            "$ref": "#/components/schemas/ErrorCode",
            "description": "Stable machine code. Branch on this, never on `error`."
          },
          "retry": {
            "type": "string",
            "description": "'backoff': the refusal is transient, resending the identical bytes may succeed. 'never': something about the request or a durable state must change first — retrying is a loop."
          },
          "detail": {
            "description": "Structured context for this refusal, on the codes that carry it. An OBJECT or an ARRAY of objects — field-validation failures arrive as an array, one entry per bad field, which is the commonest refusal you will see. The shape varies by `code`, so branch on `code` rather than on the shape here.",
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            ]
          }
        }
      },
      "AccountResponse": {
        "$id": "#/components/schemas/AccountResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Account id. This is the `{account_id}` in every account-scoped path."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled",
              "failed",
              "passed"
            ],
            "description": "The account's lifecycle state. ⚠️ `active` does NOT mean \"you can open a position\". An account can be `active` and still refuse every open — read `closing_only` as well, which is a separate axis and the one that decides whether opens are accepted."
          },
          "account_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account's trading permissions — notably `cash` versus `margin`, which decides whether short options are allowed at all."
          },
          "currency": {
            "type": "string",
            "const": "USD",
            "description": "Always `USD`. Every money field on this API is in dollars."
          },
          "cash_balance": {
            "type": "number",
            "description": "Settled cash, in dollars."
          },
          "unsettled_cash": {
            "type": "number",
            "description": "Proceeds not yet settled. Present in equity but NOT usable as buying power — `available_bp` on the portfolio is the number that decides what you can open."
          },
          "starting_balance": {
            "type": "number",
            "description": "What the account was funded with. The baseline every drawdown and profit target is measured against."
          },
          "realized_pnl": {
            "type": "number",
            "description": "Closed profit and loss since funding, in dollars."
          },
          "locked_buying_power": {
            "type": "number",
            "description": "Buying power reserved by working orders and open positions."
          },
          "risk_collateral_locked": {
            "type": "number",
            "description": "Collateral held against defined-risk and short positions."
          },
          "drawdown_floor": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "THE EQUITY LEVEL THIS ACCOUNT IS LIQUIDATED AT. This is a prop account: the forced-close trigger is a drawdown floor, not a margin call. Compare it against `liquidation_value` on /portfolio — what closing every position at market would net — to get your true distance to breach, and de-risk on that. ⚠️ That is the comparand the platform itself uses. This response deliberately carries no “equity” field, because computing one would mean loading your whole book on a read priced as a cheap account lookup. Read `drawdown_floor_enforced` alongside it: it says whether crossing this actually liquidates the account. Computed server-side on purpose — do not re-derive it. A client-side mirror of a related number once read $71,655 while the gate was enforcing $1,878, and a client whose floor differs from ours finds out by being liquidated. Null when the account has no drawdown configuration."
          },
          "trailing_floor": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The trailing arm of the drawdown floor, published separately so you can see how the floor was arrived at. Null when the account has no trailing drawdown."
          },
          "max_drawdown_floor": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The static max-drawdown arm of the floor. Null when the account has no static drawdown."
          },
          "drawdown_binding": {
            "type": "string",
            "enum": [
              "trailing",
              "max_drawdown",
              "none"
            ],
            "description": "WHICH arm currently binds — the one your equity reaches first on the way down, and therefore the one `drawdown_floor` is equal to. `none` when no drawdown rule applies."
          },
          "dd_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the trailing drawdown is measured — which equity series its peak tracks."
          },
          "peak_equity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The highest equity this account has reached, which is what a trailing floor trails. It only ratchets up."
          },
          "profit_target": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The equity level at which this account passes, in dollars. Null when it has no target."
          },
          "daily_loss_limit": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The most this account may lose in one session before it is closed out, in dollars. Null when there is no daily limit."
          },
          "closing_only": {
            "type": "boolean",
            "description": "TRUE means opens are refused and only closes are accepted. ⚠️ Check this before every open. It is a SEPARATE axis from `status`: an account in closing-only still reports `status: \"active\"`, so a strategy that reads only the status sees a healthy account, sends an open, and is refused with a code it had no way to anticipate."
          },
          "max_contracts_per_order": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Largest order this account may place, in contracts. Null when uncapped."
          },
          "max_open_positions": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Most positions this account may hold at once. Null when uncapped."
          },
          "consistency_limit": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "THE RULE THAT DECIDES WHETHER YOU PASS, and the one most likely to surprise you: your best single day's realized profit must be no more than this FRACTION of your total profit across all winning days. `0.30` means 30%. ⚠️ An account can sit AT its profit target and not pass, because this gate refused. Compare `current_consistency` against this before concluding a target has been met. Null when the account has no consistency rule — a positive statement, not an absence."
          },
          "current_consistency": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Where you stand against `consistency_limit`, as the same FRACTION: `max_day_profit / total_profit`. Below the limit passes; above it does not. ⚠️ NULL WHILE A LIMIT EXISTS MEANS ZERO PROFITABLE CLOSED DAYS, and that BLOCKS a pass on its own — an account can be over its target on unrealized equity and still not pass, because the gate requires realized winning days. Do not read this null as \"fine\". This is a cached figure, refreshed after trades and briefly throttled, so it can be a few seconds stale; the pass gate recomputes it fresh and never reads this cache. Treat it as the indicator, not the authority."
          },
          "consistency_max_day_profit": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your best single day's REALIZED profit, in dollars — the numerator of `current_consistency`. Trading days are bucketed in Eastern time, and only days after the account's most recent reset count."
          },
          "consistency_total_profit": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The SUM of realized profit across every winning day, in dollars — the denominator of `current_consistency`. ⚠️ A money total, not a count of days, despite what a \"profit days\" reading of the name would suggest. Losing days are excluded entirely; they neither add nor subtract."
          },
          "day_start_equity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "THE ANCHOR OF THE DAILY-LOSS RULE. The platform enforces `day_start_equity − liquidation_value` against `daily_loss_limit`, so this is the number you need to answer “how much more can I lose today”. ⚠️ `day_pnl` on /portfolio is NOT this measurement and must not be substituted: it compares against YESTERDAY’S SNAPSHOT, a different quantity taken at a different instant, so subtracting it from `daily_loss_limit` yields a figure the gate disagrees with. Pair this with `liquidation_value` from /portfolio. Null before the first session boundary has stamped it."
          },
          "failed_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "WHY the account failed, when `status` is `failed`. Until this shipped the only way to ask was to send an order you did not want filled and read `detail.reason` off the refusal — which a read-only credential could not do at all. Null unless failed."
          },
          "failed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it failed."
          },
          "disabled_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "WHY the account was disabled, when `status` is `disabled`. Null unless disabled."
          },
          "disabled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was disabled."
          },
          "passed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the account passed its evaluation. Null unless passed."
          },
          "min_trading_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "A PASS GATE THAT WAS INVISIBLE. An account can sit at its profit target, satisfy the consistency gate, and still not pass because it has not traded on enough distinct days. Null means no such gate. ⚠️ The COUNT toward this is deliberately not published here: it is computed in the engine, and re-deriving it on this surface would create a second source of truth about whether you have passed."
          },
          "max_calendar_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "The evaluation window in calendar days from account creation. Null means no deadline."
          },
          "evaluation_expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When `max_calendar_days` runs out, computed from the account’s creation instant so you do not re-implement the deadline. Null when there is no such gate."
          },
          "trading_hours_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "AN ENFORCED PRE-TRADE GATE THAT APPEARED ON NO RESPONSE. Orders outside this window are refused with RULE_TRADING_HOURS — a published code carrying `retry: \"backoff\"`, i.e. the API told you to wait and retry against a window you could not read. ET wall clock as “HH:MM:SS”, passed through exactly as the engine holds it rather than reformatted, so the window you read is the window it compares against. Null means unrestricted."
          },
          "trading_hours_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The other end of that window. ET, \"HH:MM:SS\"."
          },
          "drawdown_floor_enforced": {
            "type": "boolean",
            "description": "Whether crossing `drawdown_floor` actually liquidates this account. `drawdown_floor` tells you to “de-risk on that”, and what that advice MEANS differs entirely depending on this flag — which is why the floor was incomplete without it."
          },
          "archived": {
            "type": "boolean",
            "description": "Archived accounts are read-only history. Already published on the account LIST; its absence here was an inconsistency between two views of the same row."
          }
        },
        "required": [
          "id",
          "status",
          "account_type",
          "currency",
          "cash_balance",
          "unsettled_cash",
          "starting_balance",
          "realized_pnl",
          "locked_buying_power",
          "risk_collateral_locked",
          "drawdown_floor",
          "trailing_floor",
          "max_drawdown_floor",
          "drawdown_binding",
          "dd_mode",
          "peak_equity",
          "profit_target",
          "daily_loss_limit",
          "closing_only",
          "max_contracts_per_order",
          "max_open_positions",
          "consistency_limit",
          "current_consistency",
          "consistency_max_day_profit",
          "consistency_total_profit",
          "day_start_equity",
          "failed_reason",
          "failed_at",
          "disabled_reason",
          "disabled_at",
          "passed_at",
          "min_trading_days",
          "max_calendar_days",
          "evaluation_expires_at",
          "trading_hours_start",
          "trading_hours_end",
          "drawdown_floor_enforced",
          "archived"
        ]
      },
      "AccountsListResponse": {
        "$id": "#/components/schemas/AccountsListResponse",
        "type": "object",
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraderAccount"
            },
            "description": "Every account this credential can address. Start here: each account-scoped path needs an `account_id`, and this is how you learn one."
          }
        },
        "required": [
          "accounts"
        ]
      },
      "Bar": {
        "$id": "#/components/schemas/Bar",
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "description": "Bar OPEN time — the start of the interval, not the end — as an RFC 3339 UTC timestamp."
          },
          "o": {
            "type": "number",
            "description": "Opening price for the interval, in dollars."
          },
          "h": {
            "type": "number",
            "description": "Highest price during the interval, in dollars."
          },
          "l": {
            "type": "number",
            "description": "Lowest price during the interval, in dollars."
          },
          "c": {
            "type": "number",
            "description": "Closing price for the interval, in dollars."
          },
          "v": {
            "type": "number",
            "description": "Contracts (or shares, on an underlying) traded during the interval."
          },
          "vwap": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Volume-weighted average price over the interval. Null when not available."
          },
          "n": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of trades in the interval, when the vendor reported one. NULL means \"not reported\", never 0 — a zero here would be a claim that nothing traded."
          }
        },
        "required": [
          "t",
          "o",
          "h",
          "l",
          "c",
          "v",
          "vwap",
          "n"
        ]
      },
      "BulkPlaceResponse": {
        "$id": "#/components/schemas/BulkPlaceResponse",
        "type": "object",
        "properties": {
          "placed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many items were newly placed (status 201)."
          },
          "refused": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many were refused (4xx/5xx). Check this before assuming success."
          },
          "replayed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many were idempotent replays of an earlier call (status 200)."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkPlaceResult"
            },
            "description": "One result per item you sent, in request order. ⚠️ A 200 on this envelope means the batch was PROCESSED, never that every item was accepted — items refuse independently. Always read `refused` or walk `results`."
          }
        },
        "required": [
          "placed",
          "refused",
          "replayed",
          "results"
        ]
      },
      "BulkPlaceResult": {
        "$id": "#/components/schemas/BulkPlaceResult",
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Position in the request array."
          },
          "idempotency_key": {
            "type": "string",
            "description": "Echoed, so a client never has to trust position."
          },
          "status": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The status the SINGLE-order endpoint would have returned for this item: 201 placed, 200 idempotent replay, 4xx/5xx refused. Same vocabulary as `POST /trader/v1/orders`, so you need no second set of handling — only a loop."
          },
          "body": {
            "description": "A PlaceOrderResponse on 200/201; the standard error body otherwise."
          }
        },
        "required": [
          "index",
          "idempotency_key",
          "status",
          "body"
        ]
      },
      "CancelAllResponse": {
        "$id": "#/components/schemas/CancelAllResponse",
        "type": "object",
        "properties": {
          "requested": {
            "type": "number",
            "description": "How many working orders matched your filter."
          },
          "cancelled": {
            "type": "number",
            "description": "How many were actually cancelled. ⚠️ Compare this against `requested` — they differ when some cancels failed, and the failures are listed rather than raised."
          },
          "cancelled_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The orders that were cancelled."
          },
          "failed": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The order that could not be cancelled."
                },
                "code": {
                  "type": "string",
                  "description": "The stable refusal code for that order."
                }
              },
              "required": [
                "id",
                "code"
              ]
            },
            "description": "Orders that could NOT be cancelled, with the reason for each. Collected rather than fatal: a partial clear reported honestly is more useful than an exception that hides which orders survived. Always check it before assuming you are flat."
          },
          "filter": {
            "type": "object",
            "properties": {
              "account_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The account the cancel was scoped to, if any."
              },
              "symbol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The underlying the cancel was scoped to, if any."
              },
              "api_key_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The API key whose orders were cancelled, if scoped."
              }
            },
            "required": [
              "account_id",
              "symbol",
              "api_key_id"
            ],
            "description": "The filter that was actually applied, echoed back so you can confirm the scope you got is the scope you meant."
          }
        },
        "required": [
          "requested",
          "cancelled",
          "cancelled_ids",
          "failed",
          "filter"
        ]
      },
      "CancelOrderResponse": {
        "$id": "#/components/schemas/CancelOrderResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The order you asked to cancel."
          },
          "cancelled": {
            "type": "boolean",
            "description": "Whether it was cancelled."
          },
          "also_cancelled": {
            "type": "object",
            "properties": {
              "bracket_children": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Protective children cancelled along with the entry."
              },
              "oco_siblings": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "OCO siblings cancelled along with it."
              }
            },
            "required": [
              "bracket_children",
              "oco_siblings"
            ],
            "description": "THE ORDERS THAT DIED WITH THIS ONE. Cancelling a bracket entry also cancels its protective children and its OCO sibling — reporting only the id you named would leave you believing three working orders still exist. Always present, with empty arrays when nothing else was cancelled, so you can read it unconditionally instead of branching on absence."
          }
        },
        "required": [
          "id",
          "cancelled",
          "also_cancelled"
        ]
      },
      "ChainContract": {
        "$id": "#/components/schemas/ChainContract",
        "type": "object",
        "properties": {
          "occ": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The contract, as an OCC symbol with no padding, such as `SPY251219C00600000` — what you pass to place an order on it."
          },
          "symbol": {
            "type": "string",
            "description": "Underlying ticker."
          },
          "expiration": {
            "type": "string",
            "description": "Expiration date, `YYYY-MM-DD`."
          },
          "strike": {
            "type": "number",
            "description": "Strike price in dollars."
          },
          "right": {
            "type": "string",
            "enum": [
              "CALL",
              "PUT"
            ],
            "description": "Contract right. Uppercase here; the OCC symbol uses a single `C` or `P`."
          },
          "bid": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best bid for one contract, in dollars. Null when there is no quote."
          },
          "ask": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best ask for one contract, in dollars. Null when there is no quote."
          },
          "bid_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts available at the bid."
          },
          "ask_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts available at the ask."
          },
          "iv": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Implied volatility as a DECIMAL: `0.25` means 25%."
          },
          "delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Delta for ONE contract. Null means not yet computed, never zero-by-default."
          },
          "gamma": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Gamma for ONE contract."
          },
          "theta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Theta for ONE contract, per day."
          },
          "vega": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Vega for ONE contract, per volatility point."
          },
          "open_interest": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Open interest, as of the last official update."
          },
          "volume": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts traded so far today."
          },
          "underlying_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Spot price of the underlying at the time of this row."
          },
          "quote_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The vendor's last NBBO-CHANGE instant for this contract, as an RFC 3339 UTC timestamp — NOT when we fetched it. A contract whose NBBO has not moved keeps an old stamp legitimately. NULL is meaningful rather than merely unknown: it is what the fill path reads as infinitely stale."
          },
          "quote_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How long ago `quote_time` was, in milliseconds, floored at 0. Null exactly when `quote_time` is. ⚠️ This is THIS ROW's age. The response-level `age_ms` is symbol-wide and the two legitimately disagree in both directions — a busy strike keeps the symbol fresh while an illiquid one beside it has not moved in hours."
          },
          "stale_for_fill": {
            "type": "boolean",
            "description": "TRUE when this row is too old for the matcher to fill from directly — it will discard the row and refetch live, so the fill may land away from the bid/ask printed here. The engine gates on this same 30-second bound, so you can predict the behaviour instead of discovering it. ⚠️ NECESSARY, not sufficient: the engine also requires the underlying to agree with the authoritative spot, which you cannot tell from a row. FALSE means \"fresh enough on age\", never \"guaranteed to be your fill price\"."
          }
        },
        "required": [
          "occ",
          "symbol",
          "expiration",
          "strike",
          "right",
          "bid",
          "ask",
          "bid_size",
          "ask_size",
          "iv",
          "delta",
          "gamma",
          "theta",
          "vega",
          "open_interest",
          "volume",
          "underlying_price",
          "quote_time",
          "quote_age_ms",
          "stale_for_fill"
        ]
      },
      "ChainSliceResponse": {
        "$id": "#/components/schemas/ChainSliceResponse",
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "description": "The underlying this slice is for."
          },
          "contracts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChainContract"
            },
            "description": "The contracts in this slice, each with quote, greeks and the `occ` you need to trade it. Same identity fields as the quotes and greeks endpoints, so one contract is described the same way by all three and you can key them all on `occ`."
          },
          "source": {
            "description": "Whether these rows are live or end-of-day.",
            "$ref": "#/components/schemas/DataSource"
          },
          "age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Symbol-wide freshness in milliseconds. Best-effort and legitimately null — for a contract's own age, read `quote_age_ms` on the row."
          },
          "margin": {
            "type": "object",
            "properties": {
              "margin_tier": {
                "type": "string",
                "enum": [
                  "broad_index",
                  "broad_etf",
                  "reg_t"
                ],
                "description": "The risk tier for this ROOT. An unrecognised root falls into `reg_t`, the strictest, by construction — the strict answer is the default, deliberately."
              },
              "margin_shock_band": {
                "type": "number",
                "description": "The adverse move sized against, as a FRACTION of the underlying: 0.0250 for a broad index, 0.0350 for a broad ETF, 0.2000 under Reg T. Not a percentage."
              },
              "margin_floor_fraction": {
                "type": "number",
                "description": "The minimum reserve, as a FRACTION: 0.0175 for index and ETF tiers, 0.1000 under Reg T. Not a percentage."
              }
            },
            "required": [
              "margin_tier",
              "margin_shock_band",
              "margin_floor_fraction"
            ],
            "description": "WHAT AN UNCOVERED SHORT ON THIS ROOT COSTS IN BUYING POWER. The tiers are EIGHT TIMES apart, so sizing a short on the wrong one is not a rounding error. Response-level because the tier is a property of the ROOT — every contract in `contracts` shares it."
          },
          "underlying_price": {
            "type": "number",
            "description": "Spot price of the underlying for this slice, in dollars."
          },
          "window": {
            "description": "THE BOUNDS THAT WERE APPLIED. This is always a WINDOWED slice, never the full chain — read this before concluding a strike does not exist.",
            "$ref": "#/components/schemas/ChainWindow"
          }
        },
        "required": [
          "symbol",
          "contracts",
          "source",
          "age_ms",
          "margin",
          "underlying_price",
          "window"
        ]
      },
      "ChainWindow": {
        "$id": "#/components/schemas/ChainWindow",
        "type": "object",
        "properties": {
          "max_dte": {
            "type": "number",
            "description": "The furthest expiration included, in days to expiry."
          },
          "strike_range_pct": {
            "type": "number",
            "description": "How far from spot strikes were included, as a percentage of the underlying price."
          },
          "strike_low": {
            "type": "number",
            "description": "Lowest strike included, in dollars."
          },
          "strike_high": {
            "type": "number",
            "description": "Highest strike included, in dollars."
          },
          "contracts_before_window": {
            "type": "number",
            "description": "How many contracts existed BEFORE the window was applied — so you can tell \"windowed out\" from \"does not exist\". A contract you expected and did not get is explained by this being larger than `contracts_returned`."
          },
          "contracts_returned": {
            "type": "number",
            "description": "How many contracts this response actually carries."
          }
        },
        "required": [
          "max_dte",
          "strike_range_pct",
          "strike_low",
          "strike_high",
          "contracts_before_window",
          "contracts_returned"
        ]
      },
      "ClockResponse": {
        "$id": "#/components/schemas/ClockResponse",
        "type": "object",
        "properties": {
          "observed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Server time at the instant this response was built — measure your own clock skew against it before trusting a locally-computed countdown to any deadline below. (Named `observed_at` rather than `now` because every date-time on this API ends in `_at`; a guard enforces it, so that a client can recognise an instant by its name.)"
          },
          "timezone": {
            "type": "string",
            "const": "America/New_York",
            "description": "The venue timezone. Every instant on this response is already absolute, so you never have to apply it — it is published so you can label a countdown correctly."
          },
          "session_date": {
            "type": "string",
            "format": "date",
            "description": "The ET calendar date these windows describe."
          },
          "day_type": {
            "type": "string",
            "enum": [
              "trading",
              "weekend",
              "holiday"
            ],
            "description": "What kind of day this is in the venue calendar."
          },
          "is_early_close": {
            "type": "boolean",
            "description": "⚠️ TRUE on a 13:00 ET close. Every cutoff below shifts three hours earlier, which is the case a hard-coded client gets wrong: auto-flatten begins at 12:55, not 15:55."
          },
          "state": {
            "type": "string",
            "enum": [
              "open",
              "pre_open",
              "after_hours",
              "weekend",
              "holiday"
            ],
            "description": "Whether the platform is accepting orders right now, and if not, why not. This is the same predicate the order gate itself evaluates."
          },
          "opens_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When orders begin being accepted today. NULL on a non-trading day — not a time in the past, and not tomorrow’s open, so `now < opens_at` can never read as \"just wait\"."
          },
          "regular": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "closes_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When regular trading ends for this cohort."
                  },
                  "blocks_new_0dte_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "After this instant an OPENING order on a contract expiring TODAY is refused. Closing an existing 0DTE position is still allowed."
                  },
                  "auto_flatten_starts_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "⚠️ When the PLATFORM begins closing your expiring positions for you. This is not a deadline for placing orders — it is the moment the venue starts acting on your book without being asked. If you intend to manage an expiring position yourself, be finished before this."
                  },
                  "blocks_all_opening_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "After this instant NO opening order is accepted, on any expiration. Closes still are."
                  },
                  "trading_ends_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "After this instant nothing is accepted, including closes."
                  }
                },
                "required": [
                  "closes_at",
                  "blocks_new_0dte_at",
                  "auto_flatten_starts_at",
                  "blocks_all_opening_at",
                  "trading_ends_at"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The cutoffs for every symbol except the extended set below. NULL on a non-trading day."
          },
          "extended": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "closes_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When regular trading ends for this cohort."
                  },
                  "blocks_new_0dte_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "After this instant an OPENING order on a contract expiring TODAY is refused. Closing an existing 0DTE position is still allowed."
                  },
                  "auto_flatten_starts_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "⚠️ When the PLATFORM begins closing your expiring positions for you. This is not a deadline for placing orders — it is the moment the venue starts acting on your book without being asked. If you intend to manage an expiring position yourself, be finished before this."
                  },
                  "blocks_all_opening_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "After this instant NO opening order is accepted, on any expiration. Closes still are."
                  },
                  "trading_ends_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "After this instant nothing is accepted, including closes."
                  },
                  "symbols": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The symbols this later cohort applies to."
                  }
                },
                "required": [
                  "closes_at",
                  "blocks_new_0dte_at",
                  "auto_flatten_starts_at",
                  "blocks_all_opening_at",
                  "trading_ends_at",
                  "symbols"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "A SECOND set of cutoffs, fifteen minutes later, applying ONLY to the listed symbols. A client that applies the regular cutoffs to these leaves fifteen minutes of session unused; one that applies these to anything else is refused. NULL on a non-trading day."
          },
          "next_trading_day": {
            "type": "string",
            "format": "date",
            "description": "The next ET date the venue is open, skipping weekends and observed holidays."
          }
        },
        "required": [
          "observed_at",
          "timezone",
          "session_date",
          "day_type",
          "is_early_close",
          "state",
          "opens_at",
          "regular",
          "extended",
          "next_trading_day"
        ]
      },
      "CloseLifecycleResponse": {
        "$id": "#/components/schemas/CloseLifecycleResponse",
        "type": "object",
        "properties": {
          "lifecycle_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The structure this close was placed against."
          },
          "order_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The closing order. Populated on EVERY branch, recovery included — a recovery response is raised only when an order carrying your idempotency key was found, so its id is known. Nullable for forward compatibility, not because any branch returns null today."
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "`filled` for a market close, `pending` for a limit that is resting. ⚠️ BOTH ARE SUCCESS — a resting close is your order working, not a refusal. On a recovery response this is the recovered order’s CURRENT status, read back from the order itself, so it may also be `cancelled` or `rejected`."
          },
          "filled": {
            "type": "boolean",
            "description": "Whether the close filled. False on a resting limit — which does not mean the close failed. On a recovery response this reflects the recovered order’s real status rather than defaulting to false, so a recovered close that DID fill says so."
          },
          "recovered": {
            "type": "boolean",
            "description": "TRUE means this process never got the engine's answer — a crash, or a correlated lookup failure — and the response was rebuilt from the order we then found carrying your idempotency key. ⚠️ YOUR CLOSE DID LAND: `order_id`, `status` and `filled` above describe the real order. Do NOT resend under a fresh key — that is a SECOND close, and no idempotency key can stop it. `GET /trader/v1/orders` stays authoritative for anything not shown here."
          }
        },
        "required": [
          "lifecycle_id",
          "order_id",
          "status",
          "filled",
          "recovered"
        ]
      },
      "ClosePositionResponse": {
        "$id": "#/components/schemas/ClosePositionResponse",
        "type": "object",
        "properties": {
          "position_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The position this close was placed against."
          },
          "order_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The closing order. Populated on EVERY branch, recovery included — a recovery response is raised only when an order carrying your idempotency key was found, so its id is known. Nullable for forward compatibility, not because any branch returns null today."
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "`filled` for a market close, `pending` for a limit that is resting. ⚠️ BOTH ARE SUCCESS — a resting close is your order working, not a refusal. On a recovery response this is the recovered order’s CURRENT status, read back from the order itself, so it may also be `cancelled` or `rejected`."
          },
          "filled": {
            "type": "boolean",
            "description": "Whether the close filled. False on a resting limit — which does not mean the close failed. On a recovery response this reflects the recovered order’s real status rather than defaulting to false, so a recovered close that DID fill says so."
          },
          "recovered": {
            "type": "boolean",
            "description": "TRUE means this process never got the engine's answer — a crash, or a correlated lookup failure — and the response was rebuilt from the order we then found carrying your idempotency key. ⚠️ YOUR CLOSE DID LAND: `order_id`, `status` and `filled` above describe the real order. Do NOT resend under a fresh key — that is a SECOND close, and no idempotency key can stop it. `GET /trader/v1/orders` stays authoritative for anything not shown here."
          }
        },
        "required": [
          "position_id",
          "order_id",
          "status",
          "filled",
          "recovered"
        ]
      },
      "CopyDivergencesResponse": {
        "$id": "#/components/schemas/CopyDivergencesResponse",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "The follower account these episodes belong to."
          },
          "open_count": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many are currently open, across the whole window."
          },
          "window_days": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How far back RESOLVED episodes were included. Open ones are returned regardless of age. Published rather than applied silently, so a truncated history says it is truncated."
          },
          "truncated": {
            "type": "boolean",
            "description": "True when more episodes matched than `limit` returned."
          },
          "divergences": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The episode id."
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "follower_missing_position",
                    "follower_orphan_position"
                  ],
                  "description": "`follower_missing_position` — the leader holds it and you do not. `follower_orphan_position` — you hold it and the leader has exited."
                },
                "open": {
                  "type": "boolean",
                  "description": "True while the detector is still emitting this episode."
                },
                "option_symbol": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The contract. NULL on a `follower_missing_position` when the leader account is outside this credential’s binding — see `leader_visible`."
                },
                "side": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Direction. Withheld on the same terms as `option_symbol`."
                },
                "leader_quantity": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "What the LEADER holds. Withheld on the same terms as `option_symbol`."
                },
                "follower_quantity": {
                  "type": "number",
                  "description": "What THIS account holds. Always yours to see."
                },
                "leader_visible": {
                  "type": "boolean",
                  "description": "Whether the leader account is inside this credential’s binding. When false, the leader-derived fields above are null — the episode still appears, because “you have drifted” is your own fact, but a `follower_missing_position` describes a position the LEADER holds, refreshed every reconcile cycle, and publishing it through a key bound only to the follower would be a live read of an account the key may not address."
                },
                "first_detected_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "When the episode was first observed."
                },
                "last_seen_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "When it was last observed."
                },
                "resolved_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "⚠️ WHEN THE DETECTOR STOPPED EMITTING IT — which is NOT the same as being made whole. Read `resolution`, never this alone."
                },
                "resolution": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "repaired",
                        "no_longer_detected"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "⚠️ THE FIELD THAT MATTERS. `repaired` means a real repair — the auto-heal’s reduce-only close FILLED, or you otherwise reached parity; safe to read as no standing harm. `no_longer_detected` means the key simply stopped being emitted, and for a `follower_missing_position` that is the LEADER FLATTENING, not you being made whole — NEVER read it as an absence of harm. Null while open, or on an episode resolved before we began recording provenance (see `resolution_unknown`)."
                },
                "resolution_unknown": {
                  "type": "boolean",
                  "description": "True when the episode is resolved but carries no `resolution`: a legacy row whose provenance is genuinely unknowable. Those were deliberately NOT back-filled, because labelling them either way would be inventing provenance."
                }
              },
              "required": [
                "id",
                "kind",
                "open",
                "option_symbol",
                "side",
                "leader_quantity",
                "follower_quantity",
                "leader_visible",
                "first_detected_at",
                "last_seen_at",
                "resolved_at",
                "resolution",
                "resolution_unknown"
              ]
            },
            "description": "The episodes, open ones first and newest first within each group."
          }
        },
        "required": [
          "account_id",
          "open_count",
          "window_days",
          "truncated",
          "divergences"
        ]
      },
      "CopyFollowersResponse": {
        "$id": "#/components/schemas/CopyFollowersResponse",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The leader account."
          },
          "followers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "account_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                  "description": "The mirroring account."
                },
                "multiplier": {
                  "type": "number",
                  "description": "How that follower scales the leader's quantities."
                },
                "status": {
                  "type": "string",
                  "description": "The follower account’s own status — `active`, `failed`, `disabled`, `passed`."
                },
                "receives_mirrors": {
                  "type": "boolean",
                  "description": "⚠️ WHETHER YOUR FILLS ACTUALLY REACH THIS ACCOUNT. The fanout only mirrors into `active` followers, so a linked account that has failed, been disabled or passed still appears here and receives NOTHING. Until this field existed the list showed both alike, and a leader had no way to tell a mirroring follower from a dormant one. Derived from the fanout’s own eligibility constant, not restated, so the two cannot drift."
                }
              },
              "required": [
                "account_id",
                "multiplier",
                "status",
                "receives_mirrors"
              ]
            },
            "description": "The accounts mirroring this one, narrowed by YOUR credential's binding — a key scoped to two accounts never learns about a third. Copy trading is same-owner only, so these are always your own accounts."
          }
        },
        "required": [
          "account_id",
          "followers"
        ]
      },
      "CopyLeaderResponse": {
        "$id": "#/components/schemas/CopyLeaderResponse",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The account this state describes."
          },
          "following": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "leader_account_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "The account being mirrored."
                  },
                  "multiplier": {
                    "type": "number",
                    "description": "Scales every mirrored quantity: `0.5` halves the leader's size, `2` doubles it."
                  }
                },
                "required": [
                  "leader_account_id",
                  "multiplier"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The account this one mirrors, or NULL when it follows nothing — so \"am I following anything\" is a single null check. Nested rather than a bare id beside a separate multiplier, because the two are meaningless apart."
          },
          "followers": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many accounts mirror THIS one, narrowed to what your credential may address — the same boundary the followers listing applies, so the count and the list can never disagree. Zero on an ordinary account."
          },
          "is_leader": {
            "type": "boolean",
            "description": "Whether this account has opted IN to being followed. Following an account with `is_leader: false` is refused with `COPY_LEADER_NOT_ACCEPTING` — published so that refusal is predictable rather than a surprise. Switch it on with `PUT /trader/v1/accounts/{account_id}/copy/leader`."
          },
          "can_trade_directly": {
            "type": "boolean",
            "description": "FALSE while this account is following another one. ⚠️ This is the answer to \"why is every order I send being refused?\" — a follower cannot place, cancel or modify directly; only the leader's activity reaches it. The same value the engine gates on, so you never have to derive it from `following`."
          },
          "detached_followers": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Followers detached by switching leadership OFF. Zero on every enable, and on a disable that changed nothing."
          },
          "pending_mirrors_cancelled": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Their un-filled mirror orders, cancelled along with the detach."
          }
        },
        "required": [
          "account_id",
          "following",
          "followers",
          "is_leader",
          "can_trade_directly",
          "detached_followers",
          "pending_mirrors_cancelled"
        ]
      },
      "CopyState": {
        "$id": "#/components/schemas/CopyState",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The account this state describes."
          },
          "following": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "leader_account_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "The account being mirrored."
                  },
                  "multiplier": {
                    "type": "number",
                    "description": "Scales every mirrored quantity: `0.5` halves the leader's size, `2` doubles it."
                  }
                },
                "required": [
                  "leader_account_id",
                  "multiplier"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "The account this one mirrors, or NULL when it follows nothing — so \"am I following anything\" is a single null check. Nested rather than a bare id beside a separate multiplier, because the two are meaningless apart."
          },
          "followers": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "How many accounts mirror THIS one, narrowed to what your credential may address — the same boundary the followers listing applies, so the count and the list can never disagree. Zero on an ordinary account."
          },
          "is_leader": {
            "type": "boolean",
            "description": "Whether this account has opted IN to being followed. Following an account with `is_leader: false` is refused with `COPY_LEADER_NOT_ACCEPTING` — published so that refusal is predictable rather than a surprise. Switch it on with `PUT /trader/v1/accounts/{account_id}/copy/leader`."
          },
          "can_trade_directly": {
            "type": "boolean",
            "description": "FALSE while this account is following another one. ⚠️ This is the answer to \"why is every order I send being refused?\" — a follower cannot place, cancel or modify directly; only the leader's activity reaches it. The same value the engine gates on, so you never have to derive it from `following`."
          }
        },
        "required": [
          "account_id",
          "following",
          "followers",
          "is_leader",
          "can_trade_directly"
        ]
      },
      "CopyUnlinkResponse": {
        "$id": "#/components/schemas/CopyUnlinkResponse",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The account that stopped following."
          },
          "unlinked": {
            "type": "boolean",
            "description": "FALSE when the account already followed nothing. Unfollowing is IDEMPOTENT — it is a success, not a 404, so it is safe to call unconditionally."
          },
          "pending_mirrors_cancelled": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Mirror orders that had not filled yet, cancelled ATOMICALLY with the unlink — a mirror must never fill onto an account that no longer follows anything."
          },
          "protection_kept": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Protective exits that were KEPT, with their copy lineage severed rather than cancelled. Unlinking must not be a way to end up holding an unprotected position, so stops and targets survive it."
          }
        },
        "required": [
          "account_id",
          "unlinked",
          "pending_mirrors_cancelled",
          "protection_kept"
        ]
      },
      "CorporateActionsResponse": {
        "$id": "#/components/schemas/CorporateActionsResponse",
        "type": "object",
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermsChange"
            },
            "description": "The terms changes in the requested range. The transform is PUBLISHED, not applied — the archive stores what the vendor printed."
          },
          "elapsed_ms": {
            "type": "number",
            "description": "How long this query took server-side, in milliseconds."
          }
        },
        "required": [
          "rows",
          "elapsed_ms"
        ]
      },
      "CreateKeyResponse": {
        "$id": "#/components/schemas/CreateKeyResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The new key's id."
          },
          "name": {
            "type": "string",
            "description": "Your label for it."
          },
          "environment": {
            "type": "string",
            "enum": [
              "live",
              "sandbox"
            ],
            "description": "`live` or `sandbox`."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What this key may do."
          },
          "account_ids": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "The accounts it may reach. Null means every account you own."
          },
          "display_prefix": {
            "type": "string",
            "description": "The first few characters, safe to display later."
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it expires. Null when it does not."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was minted, as an RFC 3339 UTC timestamp."
          },
          "secret": {
            "type": "string",
            "description": "⚠️ THE FULL KEY, RETURNED EXACTLY ONCE. Store it now — it is not recoverable, and no route will return it again. If you lose it, revoke this key and mint another."
          },
          "secret_notice": {
            "type": "string",
            "description": "Human-readable reminder of the line above. Do not branch on it."
          }
        },
        "required": [
          "id",
          "name",
          "environment",
          "scopes",
          "account_ids",
          "display_prefix",
          "expires_at",
          "created_at",
          "secret",
          "secret_notice"
        ]
      },
      "CreateWebhookResponse": {
        "$id": "#/components/schemas/CreateWebhookResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Endpoint id. Use it to update, rotate or delete this endpoint."
          },
          "api_key_id": {
            "type": "string",
            "description": "The API key this endpoint belongs to. Deliveries carry only events that key can see."
          },
          "url": {
            "type": "string",
            "description": "Where deliveries are POSTed. Must be HTTPS."
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your own label for this endpoint."
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled",
              "suspended"
            ],
            "description": "`enabled` delivers. `disabled` is off because you turned it off. `suspended` is off because WE turned it off after repeated failures — see `suspended_reason` and `consecutive_failures`, and re-enable it once your receiver is healthy."
          },
          "api_version": {
            "type": "string",
            "description": "The payload version frozen at create time. Deliveries keep this shape for the life of the endpoint, so adding a field to the API never reshapes what your existing receiver is parsing."
          },
          "event_types": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Which event types this endpoint receives. Null means every type in the catalogue, including types added later."
          },
          "cursor_updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When this endpoint last advanced its delivery position, as an RFC 3339 UTC timestamp."
          },
          "consecutive_failures": {
            "type": "number",
            "description": "Failed deliveries in a row. Resets to 0 on any success. Enough of them suspend the endpoint."
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last successful delivery, as an RFC 3339 UTC timestamp."
          },
          "last_failure_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last failed delivery, as an RFC 3339 UTC timestamp."
          },
          "suspended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When we suspended this endpoint. Null unless `status` is `suspended`."
          },
          "suspended_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why we suspended it. Null unless `status` is `suspended`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the endpoint was created, as an RFC 3339 UTC timestamp."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was last changed, as an RFC 3339 UTC timestamp."
          },
          "signing_key_id": {
            "type": "string",
            "description": "Identifies the key that signs deliveries. Arrives on each delivery so you can tell which key signed it during a rotation."
          },
          "signing_secret": {
            "type": "string",
            "description": "⚠️ SHOWN EXACTLY ONCE. Store it now — no route will ever return it again. Use it to verify the signature on every delivery; a delivery you cannot verify should be discarded, not trusted."
          }
        },
        "required": [
          "id",
          "api_key_id",
          "url",
          "description",
          "status",
          "api_version",
          "event_types",
          "cursor_updated_at",
          "consecutive_failures",
          "last_success_at",
          "last_failure_at",
          "suspended_at",
          "suspended_reason",
          "created_at",
          "updated_at",
          "signing_key_id",
          "signing_secret"
        ]
      },
      "CredentialResponse": {
        "$id": "#/components/schemas/CredentialResponse",
        "type": "object",
        "properties": {
          "credential_type": {
            "type": "string",
            "enum": [
              "api_key",
              "session"
            ],
            "description": "What you authenticated with: an `api_key`, or a signed-in browser `session`."
          },
          "key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The API key id. Null for a session."
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your label for the key. Null for a session."
          },
          "display_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The key's safe-to-display prefix. Null for a session."
          },
          "environment": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "live",
                  "sandbox"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "`live` or `sandbox`. Null for a session."
          },
          "scopes": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "What this credential may do. ⚠️ NULL for a session, meaning UNSCOPED — a person's full authority. An empty array would say the opposite, so the distinction is a null rather than a `[]`."
          },
          "account_ids": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "The accounts this credential may reach. NULL means every account you own, including ones created later; a list is a hard boundary."
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it expires, as an RFC 3339 UTC timestamp. Null when it does not."
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last time it authenticated."
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it was created."
          },
          "api_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The wire version it was minted against."
          },
          "valid_scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "EVERY scope that exists on this API — so you can tell a scope you were not granted from a scope name you misspelled."
          }
        },
        "required": [
          "credential_type",
          "key_id",
          "name",
          "display_prefix",
          "environment",
          "scopes",
          "account_ids",
          "expires_at",
          "last_used_at",
          "created_at",
          "api_version",
          "valid_scopes"
        ]
      },
      "DataSource": {
        "$id": "#/components/schemas/DataSource",
        "type": "string",
        "enum": [
          "live",
          "eod",
          "none"
        ],
        "description": "Where this data came from: `live` (the streaming feed), `eod` (the last official close, served outside market hours or when the live feed is unavailable), or `none` (nothing was found). Use this for freshness decisions — it is always present, unlike `age_ms`."
      },
      "DatasetSummary": {
        "$id": "#/components/schemas/DatasetSummary",
        "type": "object",
        "properties": {
          "dataset": {
            "type": "string",
            "description": "The dataset's name."
          },
          "endpoint": {
            "type": "string",
            "description": "The route that serves it, so this catalog is navigable rather than merely descriptive."
          },
          "first_session": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Earliest session held, `YYYY-MM-DD`. NULL when nothing is held yet."
          },
          "last_session": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Latest session held, `YYYY-MM-DD`. NULL when nothing is held yet."
          },
          "sessions": {
            "type": "number",
            "description": "How many sessions are held."
          },
          "sessions_partial": {
            "type": "number",
            "description": "How many of those are held but SHORT, curated, or unverified. ⚠️ Counted APART from `sessions`, never folded in — read it before trusting that number. A dataset with 250 held days, 40 of them short, advertising \"250 days of coverage\" would be marketing rather than a catalog."
          },
          "rows": {
            "type": "number",
            "description": "Total rows held for this dataset."
          },
          "bytes": {
            "type": "number",
            "description": "On-disk size. 0 for Postgres-backed datasets, which have no meaningful file size."
          }
        },
        "required": [
          "dataset",
          "endpoint",
          "first_session",
          "last_session",
          "sessions",
          "sessions_partial",
          "rows",
          "bytes"
        ]
      },
      "DemandSubscription": {
        "$id": "#/components/schemas/DemandSubscription",
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "description": "The registered underlying."
          },
          "expirations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The expirations pinned for it, `YYYY-MM-DD`."
          }
        },
        "required": [
          "symbol",
          "expirations"
        ]
      },
      "DropCopyResponse": {
        "$id": "#/components/schemas/DropCopyResponse",
        "type": "object",
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The accounts covered by this drop copy."
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraderEvent"
            },
            "description": "One page of events across every account above."
          },
          "next_after": {
            "type": "string",
            "description": "Pass back verbatim as `after` to continue. OPAQUE — internally a MAP of per-account positions, because `sequence` is per account, so never parse it or compare it to a sequence number. ⚠️ Unlike the single-account events endpoint, this is never null; use `has_more` to decide whether to keep paging."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page is already available."
          },
          "delivery": {
            "type": "string",
            "description": "The delivery guarantee these events are served under."
          },
          "ordering": {
            "type": "string",
            "description": "How events are ordered across accounts. Ordering is guaranteed WITHIN an account by `sequence`; this says what you may assume across them."
          }
        },
        "required": [
          "accounts",
          "events",
          "next_after",
          "has_more",
          "delivery",
          "ordering"
        ]
      },
      "EventsResponse": {
        "$id": "#/components/schemas/EventsResponse",
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraderEvent"
            },
            "description": "One page of events, oldest first, in sequence order."
          },
          "next_after": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back verbatim as `after` to get the next page. Null means this was the last page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page is already available."
          },
          "current_sequence": {
            "type": "string",
            "description": "The newest sequence number that exists for this account right now — compare it against the last event you processed to measure how far behind you are."
          },
          "delivery": {
            "type": "string",
            "description": "The delivery guarantee these events are served under."
          }
        },
        "required": [
          "events",
          "next_after",
          "has_more",
          "current_sequence",
          "delivery"
        ]
      },
      "Execution": {
        "$id": "#/components/schemas/Execution",
        "type": "object",
        "properties": {
          "execution_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "This fill's id. Unique per fill, not per order."
          },
          "order_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The order that produced this fill. Null when no order row backs it — expiration and settlement fills, for instance."
          },
          "order_userref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your run label for that order, carried here so you can attribute a fill to a run without joining back to the orders table."
          },
          "execution_sequence": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Which fill of its order this row belongs to, counting from 1. Every leg row printed by the same fill carries the same number and the order's next fill is one higher, so group by (`order_id`, `execution_sequence`) to rebuild a fill. An order that printed in a single fill reads 1 on every one of its rows. It does not change with `after`, `limit`, `order_id` or `occ`. ⚠️ It IS counted over the fills this feed still serves for that order, so an account reset or a rewind excision that removes an earlier fill renumbers the ones that remain. Null exactly when `order_id` is null."
          },
          "occ": {
            "type": "string",
            "description": "The stored contract symbol, ALWAYS present — including on rows whose symbol is not a parseable OCC. Never drop a fill because its symbol looks odd; the parsed fields below are what go null there, not this one."
          },
          "symbol": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Underlying ticker, parsed from `occ`. Null when `occ` is not parseable."
          },
          "expiration": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Expiration `YYYY-MM-DD`, parsed from `occ`. Null when it is not parseable."
          },
          "strike": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Strike in dollars, parsed from `occ`. Null when it is not parseable."
          },
          "right": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "CALL",
                  "PUT"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Contract right, parsed from `occ`. Null when it is not parseable."
          },
          "side": {
            "type": "string",
            "description": "Direction of the fill: `buy` or `sell`. ⚠️ This is the ORDER vocabulary. A position's `side` is `long`/`short` — a different vocabulary for a different thing, and the two are not interchangeable."
          },
          "quantity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "CONTRACTS filled on this ONE leg, always positive; `side` carries the direction. ⚠️ A per-leg contract count, not structures: never sum it, or compare it, against an order's `filled_quantity`, which counts WHOLE STRUCTURES. A filled 10-lot vertical is two executions of 10 contracts each against a `filled_quantity` of 10; a 2x1 ratio of 2 structures is executions of 4 and 2 against a `filled_quantity` of 2."
          },
          "fill_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Premium per contract this fill printed at, in dollars, always positive. Same name and same convention as `fill_price` on a fill leg and on an order leg — one spelling for one number, wherever you read it. The order-level `avg_fill_price` is the SIGNED net across all legs and is deliberately a different name, because a leg has no debit/credit of its own."
          },
          "executed_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the fill printed, as an RFC 3339 UTC timestamp."
          },
          "closes_inventory": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether this fill actually REDUCED your position — the engine's derived answer, taken from the order legs. ⚠️ Use this, not `realized_pnl`, to decide whether a fill was a close: `realized_pnl` is null on thousands of production fills that are genuinely closes. Null here means no order row backs the fill at all."
          },
          "realized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Profit or loss booked by this fill, in dollars. Null on opens, and also null on some closes — do not read a null as \"this was an open\"."
          },
          "commission": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Commission charged on this fill, in dollars."
          }
        },
        "required": [
          "execution_id",
          "order_id",
          "order_userref",
          "execution_sequence",
          "occ",
          "symbol",
          "expiration",
          "strike",
          "right",
          "side",
          "quantity",
          "fill_price",
          "executed_at",
          "closes_inventory",
          "realized_pnl",
          "commission"
        ]
      },
      "ExpirationsResponse": {
        "$id": "#/components/schemas/ExpirationsResponse",
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "description": "The underlying you asked about."
          },
          "expirations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Available expiration dates, `YYYY-MM-DD`, ascending."
          },
          "expirations_meta": {
            "description": "Present only for MERGED display roots, where one ticker covers more than one option root — `SPX` is SPX (a.m.-settled) plus SPXW (p.m.-settled). Read it when the settlement style matters, because two entries in `expirations` can share a date and differ in how they settle.",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string",
                  "description": "The expiration date, `YYYY-MM-DD`."
                },
                "root": {
                  "type": "string",
                  "description": "The option root that actually trades this expiry — e.g. `SPX` or `SPXW`."
                },
                "settle": {
                  "type": "string",
                  "description": "Whether it settles on the opening (`AM`) or closing (`PM`) print."
                }
              },
              "required": [
                "date",
                "root",
                "settle"
              ]
            }
          }
        },
        "required": [
          "symbol",
          "expirations"
        ]
      },
      "FillLeg": {
        "$id": "#/components/schemas/FillLeg",
        "type": "object",
        "properties": {
          "occ": {
            "type": "string",
            "description": "The contract that filled, as an OCC symbol with no padding, such as `SPY251219C00600000`."
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Direction of this leg."
          },
          "quantity": {
            "type": "number",
            "description": "Contracts filled on this leg, always positive."
          },
          "fill_price": {
            "type": "number",
            "description": "Premium per contract this leg filled at, in dollars, always positive."
          },
          "cash_effect": {
            "type": "number",
            "description": "What this leg did to your cash, SIGNED: negative means cash left the account. Already includes the 100x contract multiplier, so these sum directly to the order's `net_cash_effect`."
          }
        },
        "required": [
          "occ",
          "side",
          "quantity",
          "fill_price",
          "cash_effect"
        ]
      },
      "GreeksResponse": {
        "$id": "#/components/schemas/GreeksResponse",
        "type": "object",
        "properties": {
          "greeks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketDataGreek"
            },
            "description": "One row per contract that was found."
          },
          "not_found": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Contracts you asked for that have no row. Includes any hidden by entitlement, indistinguishably — `meta.hidden_count` tells you whether that happened."
          },
          "malformed": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Strings you sent that are not parseable OCC symbols. Reported back rather than silently dropped, so a typo never looks like an empty market."
          },
          "stale": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Contracts you asked for whose SYMBOL did not meet the `freshness` bar you set, so no row is returned for them. ⚠️ DISTINCT FROM `not_found`, and the difference matters: these contracts EXIST and the platform holds a price for them — last session’s close — which you declined by asking for `freshness=live`. `meta.by_symbol` names the source and the age for each. Empty unless you set `freshness=live`. One stale symbol no longer voids the whole batch: the symbols that DID meet the bar are returned, so a basket read is not lost to a single illiquid leg. If EVERY symbol was stale the request is still refused with 409 `STALE_DATA`, because there is nothing to return and answering 200 with an empty list would read as “no such contracts”."
          },
          "meta": {
            "description": "Per-symbol freshness and entitlement information for this response.",
            "$ref": "#/components/schemas/MarketDataMeta"
          }
        },
        "required": [
          "greeks",
          "not_found",
          "malformed",
          "stale",
          "meta"
        ]
      },
      "HistoricalIndexEodResponse": {
        "$id": "#/components/schemas/HistoricalIndexEodResponse",
        "type": "object",
        "properties": {
          "truncated": {
            "type": "boolean",
            "description": "TRUE when more rows matched than were returned, so the TAIL of your range was cut. Rows are ordered ascending on the session key, so a truncated answer is the EARLIEST part of what you asked for — a year of one root can come back as its first few sessions. ⚠️ Always check this before treating the rows as the whole range: `coverage.complete` is also false when it happens, but this is the field that says why. Continue with `next_cursor`."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back verbatim as `cursor` to fetch the next page. NULL when `truncated` is false, meaning you have the whole range. Opaque — do not parse or construct one; a cursor is bound to its dataset and ordering, and one that does not match is refused with `INVALID_CURSOR` rather than silently restarting you at the beginning."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalIndexEodRow"
            },
            "description": "One daily index level per session."
          },
          "coverage": {
            "description": "What is held, what is thin, and what is missing.",
            "$ref": "#/components/schemas/HistoryCoverage"
          },
          "terms_changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermsChange"
            },
            "description": "Terms changes that SPLIT this range — an ex-date strictly inside it, so rows either side are in different conventions and a join on (root, expiration, strike) across one compares two DIFFERENT contracts. Present and EMPTY when nothing changed, never absent."
          },
          "elapsed_ms": {
            "type": "number",
            "description": "How long this query took server-side, in milliseconds."
          }
        },
        "required": [
          "truncated",
          "next_cursor",
          "rows",
          "coverage",
          "terms_changes",
          "elapsed_ms"
        ]
      },
      "HistoricalIndexEodRow": {
        "$id": "#/components/schemas/HistoricalIndexEodRow",
        "type": "object",
        "properties": {
          "session_date": {
            "type": "string",
            "format": "date",
            "description": "The trading session, `YYYY-MM-DD` Eastern."
          },
          "root": {
            "type": "string",
            "description": "The index root — `SPX`, `VIX`, `NDX`."
          },
          "open_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session open in index points × 10,000. NULL means absent."
          },
          "high_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session high in index points × 10,000. NULL means absent."
          },
          "low_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session low in index points × 10,000. NULL means absent."
          },
          "close_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session close in index points × 10,000. NULL means absent."
          },
          "volume": {
            "type": "number",
            "description": "Reported volume, where the index publishes one."
          },
          "trade_count": {
            "type": "number",
            "description": "Reported trade count, where the index publishes one."
          },
          "quote_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last quote update, in ms since Eastern midnight."
          },
          "quote_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How stale that quote was at the close."
          },
          "bid_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Closing bid in index points × 10,000. Usually NULL: most index roots are computed levels rather than quoted instruments, so they have no two-sided market."
          },
          "ask_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Closing ask in index points × 10,000. Usually NULL, for the same reason."
          }
        }
      },
      "HistoricalOpenInterestResponse": {
        "$id": "#/components/schemas/HistoricalOpenInterestResponse",
        "type": "object",
        "properties": {
          "truncated": {
            "type": "boolean",
            "description": "TRUE when more rows matched than were returned, so the TAIL of your range was cut. Rows are ordered ascending on the session key, so a truncated answer is the EARLIEST part of what you asked for — a year of one root can come back as its first few sessions. ⚠️ Always check this before treating the rows as the whole range: `coverage.complete` is also false when it happens, but this is the field that says why. Continue with `next_cursor`."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back verbatim as `cursor` to fetch the next page. NULL when `truncated` is false, meaning you have the whole range. Opaque — do not parse or construct one; a cursor is bound to its dataset and ordering, and one that does not match is refused with `INVALID_CURSOR` rather than silently restarting you at the beginning."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalOpenInterestRow"
            },
            "description": "Open interest per listed contract."
          },
          "coverage": {
            "description": "What is held, what is thin, and what is missing.",
            "$ref": "#/components/schemas/HistoryCoverage"
          },
          "terms_changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermsChange"
            },
            "description": "Terms changes that SPLIT this range — an ex-date strictly inside it, so rows either side are in different conventions and a join on (root, expiration, strike) across one compares two DIFFERENT contracts. Present and EMPTY when nothing changed, never absent."
          },
          "elapsed_ms": {
            "type": "number",
            "description": "How long this query took server-side, in milliseconds."
          }
        },
        "required": [
          "truncated",
          "next_cursor",
          "rows",
          "coverage",
          "terms_changes",
          "elapsed_ms"
        ]
      },
      "HistoricalOpenInterestRow": {
        "$id": "#/components/schemas/HistoricalOpenInterestRow",
        "type": "object",
        "properties": {
          "session_date": {
            "type": "string",
            "format": "date",
            "description": "The trading session, `YYYY-MM-DD` Eastern."
          },
          "root": {
            "type": "string",
            "description": "The OCC root as it stood on that session."
          },
          "expiration": {
            "type": "string",
            "description": "Expiration date, `YYYY-MM-DD`."
          },
          "strike_1e3": {
            "type": "number",
            "description": "Strike in dollars × 1,000, as an integer."
          },
          "right": {
            "type": "string",
            "description": "Contract right: `C` for a call, `P` for a put."
          },
          "open_interest": {
            "type": "number",
            "description": "Contracts outstanding. ⚠️ ZERO IS A REPORTED FACT, never a null: the contract is listed and nobody holds it. Around 47% of a real session's rows are exactly that, and nulling them would make \"no position exists\" indistinguishable from \"we do not know\"."
          },
          "observed_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the vendor observed this figure, in ms since Eastern midnight. NULL when no observation clock was reported."
          }
        }
      },
      "HistoricalOptionEodResponse": {
        "$id": "#/components/schemas/HistoricalOptionEodResponse",
        "type": "object",
        "properties": {
          "truncated": {
            "type": "boolean",
            "description": "TRUE when more rows matched than were returned, so the TAIL of your range was cut. Rows are ordered ascending on the session key, so a truncated answer is the EARLIEST part of what you asked for — a year of one root can come back as its first few sessions. ⚠️ Always check this before treating the rows as the whole range: `coverage.complete` is also false when it happens, but this is the field that says why. Continue with `next_cursor`."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back verbatim as `cursor` to fetch the next page. NULL when `truncated` is false, meaning you have the whole range. Opaque — do not parse or construct one; a cursor is bound to its dataset and ordering, and one that does not match is refused with `INVALID_CURSOR` rather than silently restarting you at the beginning."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalOptionEodRowWithUnderlying"
            },
            "description": "The archived session rows. The underlying-bracket columns are populated only when you asked for `with_underlying`; they are merged into one row type so you model ONE shape rather than two that differ by six fields."
          },
          "coverage": {
            "description": "WHAT THIS ANSWER IS MISSING. Read it before treating `rows` as the market — coverage is part of the answer, not metadata.",
            "$ref": "#/components/schemas/HistoryCoverage"
          },
          "terms_changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermsChange"
            },
            "description": "Terms changes that SPLIT this range — an ex-date strictly inside it, so rows either side are in different conventions and a join on (root, expiration, strike) across one compares two DIFFERENT contracts. Present and EMPTY when nothing changed, never absent, so you can tell \"nothing changed\" from \"this server does not say\". ⚠️ The transform is PUBLISHED, NOT APPLIED: the archive stores what the vendor printed, because restating prices would destroy the ability to reproduce what actually traded, and whether to back- or forward-adjust is your choice."
          },
          "elapsed_ms": {
            "type": "number",
            "description": "How long this query took server-side, in milliseconds."
          }
        },
        "required": [
          "truncated",
          "next_cursor",
          "rows",
          "coverage",
          "terms_changes",
          "elapsed_ms"
        ]
      },
      "HistoricalOptionEodRow": {
        "$id": "#/components/schemas/HistoricalOptionEodRow",
        "type": "object",
        "properties": {
          "session_date": {
            "type": "string",
            "format": "date",
            "description": "The trading session, `YYYY-MM-DD` Eastern."
          },
          "root": {
            "type": "string",
            "description": "The OCC root as it stood on that session. See `terms_changes` before joining across an ex-date."
          },
          "expiration": {
            "type": "string",
            "description": "Expiration date, `YYYY-MM-DD`."
          },
          "strike_1e3": {
            "type": "number",
            "description": "Strike in dollars × 1,000, as an integer — OCC-native, no float round-trip."
          },
          "right": {
            "type": "string",
            "description": "Contract right: `C` for a call, `P` for a put."
          },
          "traded": {
            "type": "boolean",
            "description": "Whether volume was greater than 0. ⚠️ SEPARATE from \"has a price\": a contract can trade and still carry no valid close."
          },
          "open_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session open in dollars × 10,000. NULL means ABSENT, never zero."
          },
          "high_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session high in dollars × 10,000. NULL means ABSENT, never zero."
          },
          "low_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session low in dollars × 10,000. NULL means ABSENT, never zero."
          },
          "close_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session close in dollars × 10,000. ⚠️ NULL MEANS ABSENT, NEVER ZERO. Around 80% of a session's rows are listed contracts that never printed, and a 0.00 there is a price a backtest would happily fill against."
          },
          "volume": {
            "type": "number",
            "description": "Contracts traded during the session."
          },
          "trade_count": {
            "type": "number",
            "description": "Number of trades during the session."
          },
          "quote_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last NBBO update, in ms since Eastern midnight. NULL means NEVER QUOTED — not midnight."
          },
          "quote_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How stale that quote was at the 16:00 close. ⚠️ The MEAN exceeds two hours across this archive. Filter on it before treating a closing NBBO as a tradeable price."
          },
          "bid_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Closing bid in dollars × 10,000. NULL means absent."
          },
          "ask_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Closing ask in dollars × 10,000. NULL means absent."
          },
          "bid_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts at the closing bid."
          },
          "ask_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts at the closing ask."
          },
          "bid_exchange": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Exchange code posting the closing bid."
          },
          "ask_exchange": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Exchange code posting the closing ask."
          },
          "bid_condition": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Quote condition code on the closing bid."
          },
          "ask_condition": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Quote condition code on the closing ask."
          }
        }
      },
      "HistoricalOptionEodRowWithUnderlying": {
        "$id": "#/components/schemas/HistoricalOptionEodRowWithUnderlying",
        "type": "object",
        "properties": {
          "session_date": {
            "type": "string",
            "format": "date",
            "description": "The trading session, `YYYY-MM-DD` Eastern."
          },
          "root": {
            "type": "string",
            "description": "The OCC root as it stood on that session. See `terms_changes` before joining across an ex-date."
          },
          "expiration": {
            "type": "string",
            "description": "Expiration date, `YYYY-MM-DD`."
          },
          "strike_1e3": {
            "type": "number",
            "description": "Strike in dollars × 1,000, as an integer — OCC-native, no float round-trip."
          },
          "right": {
            "type": "string",
            "description": "Contract right: `C` for a call, `P` for a put."
          },
          "traded": {
            "type": "boolean",
            "description": "Whether volume was greater than 0. ⚠️ SEPARATE from \"has a price\": a contract can trade and still carry no valid close."
          },
          "open_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session open in dollars × 10,000. NULL means ABSENT, never zero."
          },
          "high_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session high in dollars × 10,000. NULL means ABSENT, never zero."
          },
          "low_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session low in dollars × 10,000. NULL means ABSENT, never zero."
          },
          "close_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session close in dollars × 10,000. ⚠️ NULL MEANS ABSENT, NEVER ZERO. Around 80% of a session's rows are listed contracts that never printed, and a 0.00 there is a price a backtest would happily fill against."
          },
          "volume": {
            "type": "number",
            "description": "Contracts traded during the session."
          },
          "trade_count": {
            "type": "number",
            "description": "Number of trades during the session."
          },
          "quote_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last NBBO update, in ms since Eastern midnight. NULL means NEVER QUOTED — not midnight."
          },
          "quote_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How stale that quote was at the 16:00 close. ⚠️ The MEAN exceeds two hours across this archive. Filter on it before treating a closing NBBO as a tradeable price."
          },
          "bid_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Closing bid in dollars × 10,000. NULL means absent."
          },
          "ask_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Closing ask in dollars × 10,000. NULL means absent."
          },
          "bid_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts at the closing bid."
          },
          "ask_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts at the closing ask."
          },
          "bid_exchange": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Exchange code posting the closing bid."
          },
          "ask_exchange": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Exchange code posting the closing ask."
          },
          "bid_condition": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Quote condition code on the closing bid."
          },
          "ask_condition": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Quote condition code on the closing ask."
          },
          "underlying_prev_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time of the last underlying observation BEFORE this quote, in ms since Eastern midnight."
          },
          "underlying_prev_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "That underlying price, in dollars × 10,000."
          },
          "underlying_next_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time of the first underlying observation AFTER this quote, in ms since Eastern midnight."
          },
          "underlying_next_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "That underlying price, in dollars × 10,000."
          },
          "underlying_prev_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How old the previous observation was. Published for convenience — ⚠️ it is NOT an error bound. At identical 50-59s staleness the p90 underlying move was $0.20 on a quiet day and $1.90 on a volatile one, 9.5x apart. Use `underlying_bracket_1e4`, which is what the price actually did."
          },
          "underlying_bracket_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How far the underlying actually MOVED across the bracket, in dollars × 10,000. This is the real uncertainty on the spot price at this quote. All bracket fields are NULL when no same-session observation precedes the quote — deliberately, because carrying Friday's close into Monday's open would present a 65-hour-old price as spot."
          }
        }
      },
      "HistoricalRatesResponse": {
        "$id": "#/components/schemas/HistoricalRatesResponse",
        "type": "object",
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RateCurveRow"
            },
            "description": "One curve per session date, ascending."
          },
          "coverage": {
            "description": "Which dates were served, and why any are missing.",
            "$ref": "#/components/schemas/RateCoverage"
          },
          "elapsed_ms": {
            "type": "number",
            "description": "How long this query took server-side, in milliseconds."
          }
        },
        "required": [
          "rows",
          "coverage",
          "elapsed_ms"
        ]
      },
      "HistoricalTradeQuoteResponse": {
        "$id": "#/components/schemas/HistoricalTradeQuoteResponse",
        "type": "object",
        "properties": {
          "truncated": {
            "type": "boolean",
            "description": "TRUE when more rows matched than were returned, so the TAIL of your range was cut. Rows are ordered ascending on the session key, so a truncated answer is the EARLIEST part of what you asked for — a year of one root can come back as its first few sessions. ⚠️ Always check this before treating the rows as the whole range: `coverage.complete` is also false when it happens, but this is the field that says why. Continue with `next_cursor`."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back verbatim as `cursor` to fetch the next page. NULL when `truncated` is false, meaning you have the whole range. Opaque — do not parse or construct one; a cursor is bound to its dataset and ordering, and one that does not match is refused with `INVALID_CURSOR` rather than silently restarting you at the beginning."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalTradeQuoteRowWithUnderlying"
            },
            "description": "Every trade print in the range, with the NBBO that prevailed at each. The underlying-bracket columns are populated only when you asked for `with_underlying`."
          },
          "coverage": {
            "description": "WHAT THIS ANSWER IS MISSING. Read it before treating `rows` as the market.",
            "$ref": "#/components/schemas/HistoryCoverage"
          },
          "terms_changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermsChange"
            },
            "description": "Terms changes that SPLIT this range — an ex-date strictly inside it, so rows either side are in different conventions and a join on (root, expiration, strike) across one compares two DIFFERENT contracts. Present and EMPTY when nothing changed, never absent."
          },
          "elapsed_ms": {
            "type": "number",
            "description": "How long this query took server-side, in milliseconds."
          }
        },
        "required": [
          "truncated",
          "next_cursor",
          "rows",
          "coverage",
          "terms_changes",
          "elapsed_ms"
        ]
      },
      "HistoricalTradeQuoteRow": {
        "$id": "#/components/schemas/HistoricalTradeQuoteRow",
        "type": "object",
        "properties": {
          "session_date": {
            "type": "string",
            "format": "date",
            "description": "The trading session, `YYYY-MM-DD` Eastern."
          },
          "root": {
            "type": "string",
            "description": "The OCC root as it stood on that session."
          },
          "expiration": {
            "type": "string",
            "description": "Expiration date, `YYYY-MM-DD`."
          },
          "strike_1e3": {
            "type": "number",
            "description": "Strike in dollars × 1,000, as an integer."
          },
          "right": {
            "type": "string",
            "description": "Contract right: `C` for a call, `P` for a put."
          },
          "trade_ms": {
            "type": "number",
            "description": "When the trade printed, in ms since Eastern midnight."
          },
          "sequence": {
            "type": "number",
            "description": "Orders prints that share a `trade_ms`. Use it to break ties deterministically."
          },
          "price_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Trade price in dollars × 10,000. NULL when the print carried a 0.00 price — `size` still says the trade happened, so do not drop the row."
          },
          "size": {
            "type": "number",
            "description": "Contracts traded on this print."
          },
          "exchange": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Exchange code that printed the trade."
          },
          "condition": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Trade condition code. Use it to exclude prints you do not want to model."
          },
          "quote_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the prevailing NBBO was last updated, in ms since Eastern midnight. NULL means NO quote stood at the print — not midnight."
          },
          "quote_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How stale that quote was at the moment of the print. The gap between price and quote is how you tell a trade at the touch from one against a quote that had not moved in an hour."
          },
          "bid_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Prevailing bid at the print, in dollars × 10,000."
          },
          "ask_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Prevailing ask at the print, in dollars × 10,000."
          },
          "bid_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts at that bid."
          },
          "ask_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts at that ask."
          }
        }
      },
      "HistoricalTradeQuoteRowWithUnderlying": {
        "$id": "#/components/schemas/HistoricalTradeQuoteRowWithUnderlying",
        "type": "object",
        "properties": {
          "session_date": {
            "type": "string",
            "format": "date",
            "description": "The trading session, `YYYY-MM-DD` Eastern."
          },
          "root": {
            "type": "string",
            "description": "The OCC root as it stood on that session."
          },
          "expiration": {
            "type": "string",
            "description": "Expiration date, `YYYY-MM-DD`."
          },
          "strike_1e3": {
            "type": "number",
            "description": "Strike in dollars × 1,000, as an integer."
          },
          "right": {
            "type": "string",
            "description": "Contract right: `C` for a call, `P` for a put."
          },
          "trade_ms": {
            "type": "number",
            "description": "When the trade printed, in ms since Eastern midnight."
          },
          "sequence": {
            "type": "number",
            "description": "Orders prints that share a `trade_ms`. Use it to break ties deterministically."
          },
          "price_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Trade price in dollars × 10,000. NULL when the print carried a 0.00 price — `size` still says the trade happened, so do not drop the row."
          },
          "size": {
            "type": "number",
            "description": "Contracts traded on this print."
          },
          "exchange": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Exchange code that printed the trade."
          },
          "condition": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Trade condition code. Use it to exclude prints you do not want to model."
          },
          "quote_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the prevailing NBBO was last updated, in ms since Eastern midnight. NULL means NO quote stood at the print — not midnight."
          },
          "quote_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How stale that quote was at the moment of the print. The gap between price and quote is how you tell a trade at the touch from one against a quote that had not moved in an hour."
          },
          "bid_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Prevailing bid at the print, in dollars × 10,000."
          },
          "ask_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Prevailing ask at the print, in dollars × 10,000."
          },
          "bid_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts at that bid."
          },
          "ask_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts at that ask."
          },
          "underlying_prev_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time of the last underlying observation BEFORE this quote, in ms since Eastern midnight."
          },
          "underlying_prev_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "That underlying price, in dollars × 10,000."
          },
          "underlying_next_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time of the first underlying observation AFTER this quote, in ms since Eastern midnight."
          },
          "underlying_next_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "That underlying price, in dollars × 10,000."
          },
          "underlying_prev_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How old the previous observation was. Published for convenience — ⚠️ it is NOT an error bound. At identical 50-59s staleness the p90 underlying move was $0.20 on a quiet day and $1.90 on a volatile one, 9.5x apart. Use `underlying_bracket_1e4`, which is what the price actually did."
          },
          "underlying_bracket_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How far the underlying actually MOVED across the bracket, in dollars × 10,000. This is the real uncertainty on the spot price at this quote. All bracket fields are NULL when no same-session observation precedes the quote — deliberately, because carrying Friday's close into Monday's open would present a 65-hour-old price as spot."
          }
        }
      },
      "HistoryCoverage": {
        "$id": "#/components/schemas/HistoryCoverage",
        "type": "object",
        "properties": {
          "complete": {
            "type": "boolean",
            "description": "TRUE only when nothing is degraded AND nothing is absent. ⚠️ CHECK THIS BEFORE TRUSTING A BACKTEST. A thin answer reads as a quiet market rather than as missing data — this archive holds a session short by over a thousand roots that arrived HTTP 200 with a valid checksum."
          },
          "sessions_served": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The session dates fully covered by this response, `YYYY-MM-DD`."
          },
          "sessions_degraded": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "session_date": {
                  "type": "string",
                  "format": "date",
                  "description": "The affected session, `YYYY-MM-DD`."
                },
                "completeness": {
                  "type": "string",
                  "enum": [
                    "complete",
                    "partial",
                    "unknown"
                  ],
                  "description": "How much of the session we hold. `partial` means rows are missing; `unknown` means we cannot tell."
                },
                "universe_scope": {
                  "type": "string",
                  "description": "Which slice of the contract universe this session covers."
                }
              },
              "required": [
                "session_date",
                "completeness",
                "universe_scope"
              ]
            },
            "description": "Sessions we hold INCOMPLETELY. Rows for these dates are thinner than the real market."
          },
          "sessions_absent": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "session_date": {
                  "type": "string",
                  "format": "date",
                  "description": "The missing session, `YYYY-MM-DD`."
                },
                "state": {
                  "type": "string",
                  "description": "WHY we hold nothing, from the archive's own ledger. \"Nothing for this day\" has at least three distinct causes — a market holiday, a session never attempted, and one permanently lost — and a backtester must tell them apart."
                },
                "detail": {
                  "type": "string",
                  "description": "Human-readable elaboration of `state`."
                },
                "recoverable": {
                  "type": "boolean",
                  "description": "Whether a re-pull could still fix it. FALSE for a day past the vendor's retention window — that gap is permanent, so do not wait for it to fill."
                }
              },
              "required": [
                "session_date",
                "state",
                "detail",
                "recoverable"
              ]
            },
            "description": "Sessions we hold NOTHING for, each with the reason."
          },
          "files_pruned": {
            "type": "number",
            "description": "Archive files skipped because their root range could not contain any root you asked for. A performance detail, not a gap."
          }
        },
        "required": [
          "complete",
          "sessions_served",
          "sessions_degraded",
          "sessions_absent",
          "files_pruned"
        ]
      },
      "HistoryCoverageResponse": {
        "$id": "#/components/schemas/HistoryCoverageResponse",
        "type": "object",
        "properties": {
          "dataset": {
            "type": "string",
            "description": "The dataset this coverage describes."
          },
          "coverage": {
            "description": "What is held, what is thin, and what is missing.",
            "$ref": "#/components/schemas/HistoryCoverage"
          },
          "rows_available": {
            "type": "number",
            "description": "How many rows the served sessions hold, WITHOUT returning any of them — so you can size a pull before making it."
          }
        },
        "required": [
          "dataset",
          "coverage",
          "rows_available"
        ]
      },
      "HistoryDatasetsResponse": {
        "$id": "#/components/schemas/HistoryDatasetsResponse",
        "type": "object",
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DatasetSummary"
            },
            "description": "Every dataset this archive serves. One we serve but hold NOTHING for still appears, with zeros and null bounds — omitting it would make \"we do not carry this\" and \"we have not loaded it yet\" the same silence."
          },
          "elapsed_ms": {
            "type": "number",
            "description": "How long this query took server-side, in milliseconds."
          }
        },
        "required": [
          "rows",
          "elapsed_ms"
        ]
      },
      "KeysListResponse": {
        "$id": "#/components/schemas/KeysListResponse",
        "type": "object",
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraderKey"
            },
            "description": "Every API key on this account."
          },
          "valid_scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The complete set of scopes a key may be minted with, served alongside the list so you never have to hardcode them."
          }
        },
        "required": [
          "keys",
          "valid_scopes"
        ]
      },
      "KillEngageResponse": {
        "$id": "#/components/schemas/KillEngageResponse",
        "type": "object",
        "properties": {
          "switch_id": {
            "type": "string",
            "description": "The control now engaged."
          },
          "level": {
            "type": "string",
            "description": "What was halted: `account`, `key`, or `global`."
          },
          "subject_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account or key it applies to. Null on a global halt."
          },
          "blocks": {
            "type": "string",
            "description": "What it stops: `opens` or `all`."
          },
          "already_engaged": {
            "type": "boolean",
            "description": "True when an equivalent halt was already in force, so this call changed nothing. Engaging twice is safe."
          },
          "engaged": {
            "type": "boolean",
            "description": "Whether a halt is in force after this call. True on both the new and the repeat path."
          },
          "note": {
            "type": "string",
            "description": "Human-readable summary. Do not branch on it."
          }
        },
        "required": [
          "switch_id",
          "level",
          "subject_id",
          "blocks",
          "already_engaged",
          "engaged",
          "note"
        ]
      },
      "KillListResponse": {
        "$id": "#/components/schemas/KillListResponse",
        "type": "object",
        "properties": {
          "halts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "switch_id": {
                  "type": "string",
                  "description": "The engaged control. Quote it when asking for a release."
                },
                "level": {
                  "type": "string",
                  "description": "What is halted: `account`, `key`, `firm`, or `global`. ⚠️ This endpoint is the ONLY place a GLOBAL or FIRM halt is visible. Neither emits a per-account event, so a client watching the event stream alone sees its opens refused with `TRADING_HALTED` and no reason anywhere. Switch on this with a DEFAULT branch: `firm` was reaching the wire while this list said `account`, `key`, or `global`, so treat an unfamiliar level as \"halted, cause above my scope\" rather than falling through."
                },
                "subject_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "WHAT the halt applies to, and WHICH KIND of id this is depends on `level`: an account id when `account`, an API key id when `key`, a FIRM id when `firm`. Null on a global halt. ⚠️ Read `level` first. A firm id here is not an account you can look up on `/trader/v1/accounts/{account_id}` — the previous wording (\"the account or key the halt applies to\") sent clients to do exactly that."
                },
                "blocks": {
                  "type": "string",
                  "description": "What it stops: `opens` (new risk only — closes still work) or `all`."
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Why it was engaged."
                },
                "engaged_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "When it was engaged, as an RFC 3339 UTC timestamp."
                }
              },
              "required": [
                "switch_id",
                "level",
                "subject_id",
                "blocks",
                "reason",
                "engaged_at"
              ]
            },
            "description": "Every control currently halting this caller, at any level. An empty array means you are not halted — which, unlike the event stream, is a claim this endpoint can actually make."
          }
        },
        "required": [
          "halts"
        ]
      },
      "KillReleaseResponse": {
        "$id": "#/components/schemas/KillReleaseResponse",
        "type": "object",
        "properties": {
          "level": {
            "type": "string",
            "description": "What was released: `account`, `key`, or `global`."
          },
          "subject_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account or key it applied to. Null on a global release."
          },
          "released": {
            "type": "boolean",
            "description": "Whether a halt is no longer in force after this call."
          },
          "was_engaged": {
            "type": "boolean",
            "description": "Whether anything was actually engaged to release. False means the call was a no-op."
          }
        },
        "required": [
          "level",
          "subject_id",
          "released",
          "was_engaged"
        ]
      },
      "LedgerEntry": {
        "$id": "#/components/schemas/LedgerEntry",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Ledger entry id."
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the entry was booked, as an RFC 3339 UTC timestamp."
          },
          "amount": {
            "type": "number",
            "description": "The cash movement, SIGNED: negative means cash left the account. This column has always been correct — sum it when you reconcile."
          },
          "total_cash_after": {
            "type": "number",
            "description": "The account's TOTAL cash after this entry: settled PLUS unsettled. ⚠️ EXCEPT on rows where `total_cash_after_basis` is `cash_only` — read that field first. This equals `GET /trader/v1/account`'s `cash_balance + unsettled_cash`; it does NOT equal `GET /trader/v1/portfolio`'s `cash_balance`, which is the settled half alone. A reconciliation that assumes otherwise understates by exactly the unsettled amount."
          },
          "total_cash_after_basis": {
            "type": "string",
            "enum": [
              "total",
              "cash_only"
            ],
            "description": "WHETHER `total_cash_after` IS ACTUALLY THE TOTAL. `total` — settled + unsettled, as described. `cash_only` — SETTLED CASH ONLY, understated by that account's unsettled cash at the time. Some commission rows written before 2026-08-10 are stored this way and cannot be corrected: the figure needs an unsettled-cash snapshot nothing recorded, and ledger rows are immutable. Reconcile across that boundary by summing `amount`, not by reading `total_cash_after`."
          },
          "entry_type": {
            "type": "string",
            "description": "What kind of movement this is. A free string, not an enum, on purpose: new types are added over time and must not break a client that pinned the old set. Three broad classes exist — ordinary trade flow, external flow (deposits and withdrawals, also flagged by `is_external_flow`), and ledger BOOKENDS. ⚠️ Treat `reset`, `admin_rebase` and `rewind` with care: their `amount` is a balancing artifact sized to the prior ledger, not an economic flow, so summing every row blindly does not tell you what a trader earned."
          },
          "order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The order that caused this entry, when there is exactly one. ⚠️ NULL for whole classes of row, not just occasionally: the flatten, expiration and settlement paths each write ONE gross row covering many positions and carry no reference. Do not assume one entry maps to one order, or to one position."
          },
          "is_external_flow": {
            "type": "boolean",
            "description": "True for money entering or leaving the account from outside — deposits, withdrawals, payouts. Exclude these when measuring trading performance."
          },
          "external_flow_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What kind of external movement it was. Null unless `is_external_flow` is true."
          }
        },
        "required": [
          "id",
          "occurred_at",
          "amount",
          "total_cash_after",
          "total_cash_after_basis",
          "entry_type",
          "order_id",
          "is_external_flow",
          "external_flow_kind"
        ]
      },
      "LedgerResponse": {
        "$id": "#/components/schemas/LedgerResponse",
        "type": "object",
        "properties": {
          "account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account these entries belong to."
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LedgerEntry"
            },
            "description": "Ledger entries, NEWEST FIRST."
          },
          "next_after": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back verbatim as the `after` query parameter to get the next page. Null means this was the last page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists."
          }
        },
        "required": [
          "account_id",
          "entries",
          "next_after",
          "has_more"
        ]
      },
      "ListDemandResponse": {
        "$id": "#/components/schemas/ListDemandResponse",
        "type": "object",
        "properties": {
          "subscriptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DemandSubscription"
            },
            "description": "Everything currently pinned for this credential."
          },
          "max_symbols": {
            "type": "number",
            "description": "The most symbols this credential may pin at once."
          },
          "ttl_seconds": {
            "type": "number",
            "description": "How long a registration lasts before it must be renewed."
          }
        },
        "required": [
          "subscriptions",
          "max_symbols",
          "ttl_seconds"
        ]
      },
      "ListExecutionsResponse": {
        "$id": "#/components/schemas/ListExecutionsResponse",
        "type": "object",
        "properties": {
          "account_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account these fills belong to."
          },
          "executions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Execution"
            },
            "description": "One page of fills, newest first."
          },
          "next_after": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back verbatim as `after` for the next page. Null means this was the last page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists."
          }
        },
        "required": [
          "account_id",
          "executions",
          "next_after",
          "has_more"
        ]
      },
      "MarginResponse": {
        "$id": "#/components/schemas/MarginResponse",
        "type": "object",
        "properties": {
          "as_of": {
            "type": "string",
            "description": "The ET trading date the model priced against, YYMMDD. Server-chosen and NOT a parameter — a malformed date silently drops every leg and prices the account at zero, so it is not something a client is allowed to supply."
          },
          "total": {
            "type": "number",
            "description": "Total collateral required, in dollars. This is the figure behind `risk_collateral_locked` on the account."
          },
          "used_stale_spot": {
            "type": "boolean",
            "description": "⚠️ TRUE when at least one root was priced from a SESSION CLOSE rather than a live quote — a real number, computed from yesterday. The requirement is still returned because a report should tell you what it knows, but do not diff it against a live figure without accounting for this."
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "root": {
                  "type": "string",
                  "description": "The underlying root this line prices."
                },
                "right": {
                  "type": "string",
                  "enum": [
                    "C",
                    "P"
                  ],
                  "description": "Calls and puts are margined separately."
                },
                "treatment": {
                  "type": "string",
                  "enum": [
                    "spread",
                    "naked"
                  ],
                  "description": "WHICH ARM OF THE MODEL PRICED THIS LINE, and the single most useful field here: a `spread` line is capped by the distance between its strikes, a `naked` one is not. A short that you believe is covered but that appears here as `naked` is the answer to “why is my buying power X” — usually because the long does not outlive the short, which is the one condition that makes a long cover it."
                },
                "quantity": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Contracts (or spreads) this line covers."
                },
                "requirement": {
                  "type": "number",
                  "description": "Dollars of collateral this line requires."
                },
                "short_strike": {
                  "type": "number",
                  "description": "The short leg being margined."
                },
                "short_expiration": {
                  "type": "string",
                  "description": "Its expiration, YYMMDD as the model holds it."
                },
                "long_strike": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The long that covers the short, when one does. NULL on a `naked` line."
                },
                "long_expiration": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The covering long’s expiration. A long only covers a short if it OUTLIVES it, so a long expiring first leaves the line `naked` and appears here as null."
                },
                "bound": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "shock",
                        "floor",
                        "house_min"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "For a `naked` line, WHICH bound of the model won: the price shock, the percentage floor, or the house minimum per contract. Null on a spread. This is what makes the number auditable rather than merely reported."
                }
              },
              "required": [
                "root",
                "right",
                "treatment",
                "quantity",
                "requirement",
                "short_strike",
                "short_expiration",
                "long_strike",
                "long_expiration",
                "bound"
              ]
            },
            "description": "The per-line breakdown. LINES, NOT POSITIONS: the model groups by (root, right, spread-or-naked), and one `spread` line covers a short and the long that covers it — two different positions. There is deliberately no per-position margin figure, because splitting a spread’s requirement across its legs is an attribution the model does not make and we will not invent."
          }
        },
        "required": [
          "as_of",
          "total",
          "used_stale_spot",
          "lines"
        ]
      },
      "MarketDataGreek": {
        "$id": "#/components/schemas/MarketDataGreek",
        "type": "object",
        "properties": {
          "occ": {
            "type": "string",
            "description": "The contract, as an OCC symbol with no padding, such as `SPY251219C00600000` — what you pass to place an order on it."
          },
          "symbol": {
            "type": "string",
            "description": "Underlying ticker."
          },
          "expiration": {
            "type": "string",
            "description": "Expiration date, `YYYY-MM-DD`."
          },
          "strike": {
            "type": "number",
            "description": "Strike price in dollars."
          },
          "right": {
            "type": "string",
            "enum": [
              "CALL",
              "PUT"
            ],
            "description": "Contract right. Uppercase here; the OCC symbol uses a single `C` or `P`."
          },
          "iv": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Implied volatility as a DECIMAL: `0.25` means 25%."
          },
          "delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Delta for ONE contract. To weight it to a position, multiply by `quantity × 100` and negate for a short — or read the account greeks endpoint, which nets the book for you. Null means not yet computed, never zero-by-default."
          },
          "gamma": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Gamma for ONE contract."
          },
          "theta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Theta for ONE contract, per day."
          },
          "vega": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Vega for ONE contract, per volatility point."
          },
          "underlying_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Spot price of the underlying at the time of this row."
          },
          "quote_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The vendor's last NBBO-CHANGE instant for this contract, as an RFC 3339 UTC timestamp — NOT when we fetched it. A contract whose NBBO has not moved keeps an old stamp legitimately. NULL is meaningful rather than merely unknown: it is what the fill path reads as infinitely stale."
          },
          "quote_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How long ago `quote_time` was, in milliseconds, floored at 0. Null exactly when `quote_time` is. ⚠️ This is THIS ROW's age. The response-level `age_ms` is symbol-wide and the two legitimately disagree in both directions — a busy strike keeps the symbol fresh while an illiquid one beside it has not moved in hours."
          },
          "stale_for_fill": {
            "type": "boolean",
            "description": "TRUE when this row is too old for the matcher to fill from directly — it will discard the row and refetch live, so the fill may land away from the bid/ask printed here. The engine gates on this same 30-second bound, so you can predict the behaviour instead of discovering it. ⚠️ NECESSARY, not sufficient: the engine also requires the underlying to agree with the authoritative spot, which you cannot tell from a row. FALSE means \"fresh enough on age\", never \"guaranteed to be your fill price\"."
          }
        },
        "required": [
          "occ",
          "symbol",
          "expiration",
          "strike",
          "right",
          "iv",
          "delta",
          "gamma",
          "theta",
          "vega",
          "underlying_price",
          "quote_time",
          "quote_age_ms",
          "stale_for_fill"
        ]
      },
      "MarketDataMeta": {
        "$id": "#/components/schemas/MarketDataMeta",
        "type": "object",
        "properties": {
          "snapshots_are_per_symbol_and_unsynchronized": {
            "type": "boolean",
            "description": "Always true, and stated on the wire so a spread client does not assume otherwise: each symbol is snapshotted independently, so two symbols on one response are NOT as-of the same instant. There is no cross-symbol as-of in this architecture."
          },
          "by_symbol": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/MarketDataSymbolMeta"
            },
            "description": "Freshness per requested symbol, keyed by ticker."
          },
          "hidden_count": {
            "type": "number",
            "description": "How many requested symbols were withheld by entitlement. The symbols themselves are never named — only the count."
          }
        },
        "required": [
          "snapshots_are_per_symbol_and_unsynchronized",
          "by_symbol",
          "hidden_count"
        ]
      },
      "MarketDataQuote": {
        "$id": "#/components/schemas/MarketDataQuote",
        "type": "object",
        "properties": {
          "occ": {
            "type": "string",
            "description": "The contract, as an OCC symbol with no padding, such as `SPY251219C00600000` — what you pass to place an order on it."
          },
          "symbol": {
            "type": "string",
            "description": "Underlying ticker."
          },
          "expiration": {
            "type": "string",
            "description": "Expiration date, `YYYY-MM-DD`."
          },
          "strike": {
            "type": "number",
            "description": "Strike price in dollars."
          },
          "right": {
            "type": "string",
            "enum": [
              "CALL",
              "PUT"
            ],
            "description": "Contract right. Uppercase here; the OCC symbol uses a single `C` or `P`."
          },
          "bid": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best bid for one contract, in dollars. Null when there is no quote."
          },
          "ask": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best ask for one contract, in dollars. Null when there is no quote."
          },
          "bid_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts available at the bid."
          },
          "ask_size": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contracts available at the ask."
          },
          "underlying_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Spot price of the underlying at the time of this row."
          },
          "quote_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The vendor's last NBBO-CHANGE instant for this contract, as an RFC 3339 UTC timestamp — NOT when we fetched it. A contract whose NBBO has not moved keeps an old stamp legitimately. NULL is meaningful rather than merely unknown: it is what the fill path reads as infinitely stale."
          },
          "quote_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How long ago `quote_time` was, in milliseconds, floored at 0. Null exactly when `quote_time` is. ⚠️ This is THIS ROW's age. The response-level `age_ms` is symbol-wide and the two legitimately disagree in both directions — a busy strike keeps the symbol fresh while an illiquid one beside it has not moved in hours."
          },
          "stale_for_fill": {
            "type": "boolean",
            "description": "TRUE when this row is too old for the matcher to fill from directly — it will discard the row and refetch live, so the fill may land away from the bid/ask printed here. The engine gates on this same 30-second bound, so you can predict the behaviour instead of discovering it. ⚠️ NECESSARY, not sufficient: the engine also requires the underlying to agree with the authoritative spot, which you cannot tell from a row. FALSE means \"fresh enough on age\", never \"guaranteed to be your fill price\"."
          }
        },
        "required": [
          "occ",
          "symbol",
          "expiration",
          "strike",
          "right",
          "bid",
          "ask",
          "bid_size",
          "ask_size",
          "underlying_price",
          "quote_time",
          "quote_age_ms",
          "stale_for_fill"
        ]
      },
      "MarketDataSymbolMeta": {
        "$id": "#/components/schemas/MarketDataSymbolMeta",
        "type": "object",
        "properties": {
          "source": {
            "description": "Where this symbol's data came from. Always present — use it for freshness.",
            "$ref": "#/components/schemas/DataSource"
          },
          "age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time since the last write for this SYMBOL, in milliseconds. SYMBOL-WIDE: every contract in the symbol reports the same number, so it is NOT any individual contract's NBBO age — read the per-row `quote_age_ms` for that, which is also what the fill path uses. ⚠️ BEST-EFFORT and legitimately null even on a fully live response. Do not build a staleness check on this field alone; use `source`."
          }
        },
        "required": [
          "source",
          "age_ms"
        ]
      },
      "MarketDataVisibilityEnvelope": {
        "$id": "#/components/schemas/MarketDataVisibilityEnvelope",
        "type": "object",
        "properties": {
          "visibility": {
            "type": "string",
            "enum": [
              "full",
              "withheld"
            ],
            "description": "`full` — quotes on this response are complete. `withheld` — some market-data fields were removed because this credential is not entitled to them."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why data was withheld. Null when `visibility` is `full`."
          },
          "withheld": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The field names that were removed, listed explicitly so a null never has to be guessed at: a `bid` of null means \"no quote exists\" unless `bid` appears here, in which case it means \"withheld from you\"."
          }
        },
        "required": [
          "visibility",
          "reason",
          "withheld"
        ]
      },
      "ModifyOrderResponse": {
        "$id": "#/components/schemas/ModifyOrderResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The order that was modified."
          },
          "modified": {
            "type": "boolean",
            "description": "Whether the modify was applied."
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The fields this request APPLIED, named in your request's own vocabulary so you can compare them against the keys you sent. ⚠️ \"Applied\", not \"changed\" — do NOT read this as a diff. The server writes every field you supply without comparing it to what was already there, so sending a `limit_price` equal to the current one still lists it. Empty when you supplied nothing that could be written. Values a modify DERIVES but you did not supply — notably the new trigger a trailing-stop edit computes — are deliberately not listed here; read the order back for those, rather than have this array mean two things."
          },
          "also_modified": {
            "type": "object",
            "properties": {
              "bracket_children": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Protective children re-sized to match the entry."
              }
            },
            "required": [
              "bracket_children"
            ],
            "description": "Protective children re-sized by a quantity edit. A bracket entry and its stop/target must move in lockstep, so changing the entry's quantity cascades — reporting only the id you named would leave your book showing children at the OLD size. Always present, empty when nothing cascaded."
          }
        },
        "required": [
          "id",
          "modified",
          "changes",
          "also_modified"
        ]
      },
      "NetGreeksResponse": {
        "$id": "#/components/schemas/NetGreeksResponse",
        "type": "object",
        "properties": {
          "account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account this book belongs to."
          },
          "net_delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Portfolio delta, already position-weighted and sign-corrected for you: each leg is `per_contract × quantity × 100`, negated when short, then summed. This is the server-owned convention — read it here rather than re-deriving it from per-contract greeks. ⚠️ NULL means no leg could be priced. ZERO means the book is genuinely flat. Do not collapse the two."
          },
          "net_gamma": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Portfolio gamma, weighted the same way. Null when nothing could be priced."
          },
          "net_theta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Portfolio theta per day, weighted the same way. Null when nothing could be priced."
          },
          "net_vega": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Portfolio vega per volatility point, weighted the same way. Null when nothing could be priced."
          },
          "legs_total": {
            "type": "number",
            "description": "Every open leg considered."
          },
          "legs_priced": {
            "type": "number",
            "description": "How many of them carried a COMPLETE set of greeks and are therefore in the sums."
          },
          "complete": {
            "type": "boolean",
            "description": "FALSE means the totals omit at least one leg — they are not a total of the whole book. Check this before hedging on these numbers; `legs_total - legs_priced` is how many are missing."
          }
        },
        "required": [
          "account_id",
          "net_delta",
          "net_gamma",
          "net_theta",
          "net_vega",
          "legs_total",
          "legs_priced",
          "complete"
        ]
      },
      "OptionBarsResponse": {
        "$id": "#/components/schemas/OptionBarsResponse",
        "type": "object",
        "properties": {
          "occ": {
            "type": "string",
            "description": "The contract these bars are for, as an OCC symbol with no padding, such as `SPY251219C00600000`."
          },
          "interval": {
            "type": "string",
            "description": "The bar size you asked for, such as `1m` or `1d`."
          },
          "interval_s": {
            "type": "number",
            "description": "That interval in seconds, so you never have to parse the string."
          },
          "from": {
            "type": "string",
            "description": "Start of the window actually served, as an RFC 3339 UTC timestamp."
          },
          "to": {
            "type": "string",
            "description": "End of the window actually served, as an RFC 3339 UTC timestamp."
          },
          "bars": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Bar"
            },
            "description": "The bars, oldest first."
          },
          "coverage_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The earliest bar that exists for THIS series, or null when it has none. ⚠️ The archive is built from this platform's own polling, so it begins when polling began — not when the market did. An empty result before this instant is expected, not a gap in the market."
          },
          "truncated": {
            "type": "boolean",
            "description": "TRUE when the window you asked for started BEFORE the archive does, so you got less history than you requested. Check it before concluding a series has no data."
          }
        },
        "required": [
          "occ",
          "interval",
          "interval_s",
          "from",
          "to",
          "bars",
          "coverage_from",
          "truncated"
        ]
      },
      "Order": {
        "$id": "#/components/schemas/Order",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Server-assigned order id. Quote this to support, and use it on cancel and modify."
          },
          "client_order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "YOUR id for this order, if you supplied one at placement. UNIQUE PER USER, so it names exactly one order for ever: it is the anchor an idempotent replay resolves against, and `GET /trader/v1/orders?client_order_id=...` returns that one order. Null when you did not supply one — including on every order the browser UI, copy trading, or the engine's own exit and flatten paths placed for you."
          },
          "order_userref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "YOUR correlation label — \"these forty orders are one algorithm run\". ⚠️ NOT `client_order_id`, and the two are next to each other because they are otherwise conflated. `client_order_id` is unique and names ONE order; this one is deliberately NOT unique, and many orders sharing a value is the point, so looking it up returns a SET. Build a recovery path on `client_order_id`, never on this — a client that does gets an arbitrary member of a run and believes it found \"the\" order. It is echoed back verbatim and nothing validates it beyond a 128-character bound, so it is your label, not attribution we vouch for. Null means no label was given, never \"not part of a run\"."
          },
          "status": {
            "type": "string",
            "description": "Lifecycle state. `pending` is working or waiting on a trigger (see `underlying_trigger_price` — those two are not the same thing); `filled`, `cancelled` and `rejected` are terminal and never change again. ⚠️ A `day` order that reached the close without filling reads `cancelled` here, with `cancellation_reason: \"end_of_day_day_order\"`; the event stream reports that same order as `order.expired`, because nobody intervened and the clock simply ran out. Read the reason, not just the status, if that distinction matters to your strategy. — KNOWN VALUES: pending, filled, cancelled, rejected. This list GROWS: it is published as an open string on purpose, so a value added later cannot break a generated client. Branch on the values you know and keep a default arm."
          },
          "order_type": {
            "type": "string",
            "enum": [
              "market",
              "limit",
              "stop",
              "stop_limit",
              "trailing_stop",
              "bracket_stop",
              "bracket_target"
            ],
            "description": "How this order prices and triggers. Beyond the types you can place, you will also read back `bracket_stop` and `bracket_target` — the children a bracket created for you, which you never place directly but do see here."
          },
          "time_in_force": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "day",
                  "gtc"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "`day` expires at the close if it has not filled; `gtc` rests until it fills or you cancel it. Bracket children are exempt from the day sweep — see `bracket_role`."
          },
          "limit_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your limit, as a SIGNED net price per structure: negative = debit (you pay), positive = credit (you receive). Null on orders that have no limit. Compare it directly against `avg_fill_price`, which uses the same convention, to read slippage without a sign table."
          },
          "stop_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The stop trigger level. ⚠️ Read `stop_price_basis` before using this number — it is quoted either as an option premium or as an underlying spot level, and the two are not comparable. Null when the order has no stop."
          },
          "stop_price_basis": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "option",
                  "underlying"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "WHICH INSTRUMENT `stop_price` is quoted in. `option` means a premium per contract. `underlying` means an underlying SPOT level — a SPY stop at spot 585 publishes `stop_price: 585.00` next to a mark near 3.20. Without this field those two are indistinguishable on the wire. Null only when the order has no stop trigger at all."
          },
          "stop_underlying_direction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Which way the underlying must cross `stop_price` to trigger, when `stop_price_basis` is `underlying`. Null otherwise."
          },
          "structure_units": {
            "type": "number",
            "description": "How many whole STRUCTURES this order is for — spreads, not contracts. A 10-lot vertical is 10 units and 20 contracts. Every price on this order is quoted per structure, so this is the multiplier that takes you from price to total."
          },
          "underlying_trigger_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "ARMED vs WORKING — and `status` alone cannot tell you which. While this is non-null the order is DORMANT: the matcher will not consider it at any price until the underlying crosses this level, yet it still reads `status: \"pending\"`, byte-identical to an order one tick from filling. Count a dormant order as live protection and you are unprotected; wait on it for a fill and you wait on an order nothing is looking at. Null means the order is genuinely working."
          },
          "underlying_trigger_direction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Which way the underlying must cross `underlying_trigger_price` to arm this order. Null when the order is not trigger-armed."
          },
          "trail_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Trailing distance in DOLLARS. Set on a trailing stop that trails by a fixed amount; null when it trails by percent or is not a trailing stop."
          },
          "trail_percent": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Trailing distance as a FRACTION of the anchor price: `0.03` means 3%. ⚠️ Not the same scale as `unrealized_pnl_pct` on a position, which is a whole-number percent (`12.5` = 12.5%). The two are stated explicitly because they sit one call apart and differ by 100x. Null when the stop trails by a dollar amount, or is not a trailing stop."
          },
          "trail_anchor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the stop trails: the OPTION premium or the UNDERLYING price. This changes what `trail_amount` and `trail_percent` mean, so read it before acting on either. Without it a trailing stop reads as a plain stop with a moving, unexplained trigger."
          },
          "parent_order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The entry order this one protects, when this order is a bracket child. Null on entries and on standalone orders. Group by this to reassemble which child protects which entry."
          },
          "bracket_role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "This order's role in a bracket — the stop leg, the target leg, or the entry. Also why some `day` orders survive the close: bracket children are exempt from the end-of-day sweep, because cancelling them would strip protection off a position you still hold."
          },
          "oco_group_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The one-cancels-other group. When any member of this group fills or is cancelled, its siblings are cancelled too. A client that cannot see the grouping cannot predict that cascade — so it is published."
          },
          "cancellation_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "WHY it was cancelled — whether it was your own cancel, a bracket cascade, an OCO sibling filling, a risk action, or the end-of-day sweep (`end_of_day_day_order`, which is how an expired `day` order presents). Always written in the same transaction that flips `status`, so a cancelled order never lacks a reason. Null unless `status` is `cancelled`.\n\n⚠️ THE VALUE IS A TOKEN, NOT PROSE — switch on it. The set is OPEN: new reasons are added over time, so treat an unfamiliar one as “the platform cancelled it” rather than rejecting the response.\n\n`user_cancelled` — You cancelled it. No action needed.\n`oco_sibling_user_cancelled` — You cancelled the other half of this one-cancels-other pair, so this side went with it.\n`parent_order_cancelled` — Its parent order was cancelled, so this protective child went with it. Read the parent’s own reason to learn why — this one only says it was a cascade.\n`oco_sibling_filled` — The other half of the one-cancels-other pair FILLED, so this side was cancelled. This is the ordinary end of a bracket, not a problem.\n`bracket_dedup_merge` — Folded into an identical protective order that already existed. You are still protected — by the surviving order, whose id is on the response that created this one. Acting on this id would be acting on a cancelled order.\n`exit_order_voided_by_position_close` — ⚠️ The position this protected was closed, so the order had nothing left to protect. Expected after you flatten; unexpected if you still believe you hold the position.\n`exit_order_uncomputable_threshold_on_prune` — ⚠️ ACT ON THIS. Part of the structure closed and the surviving leg’s stop could not be re-based safely, so the protection was cancelled rather than left silently wrong. You are holding an UNPROTECTED position — re-place protection.\n`underlying_position_gone` — ⚠️ The inventory this order was written against is no longer held.\n`copy_leader_cancelled` — The leader you follow cancelled the order this mirrors, so your mirror — and any protective children it had — was cancelled too. You did not do this.\n`copy_close_cancels_pending_open` — The leader closed the position while your mirror of their OPEN was still resting, so the resting open was cancelled rather than filled into a position they no longer hold.\n`copy_unfollowed` — You stopped following this leader, so their resting mirrors were cancelled.\n`copy_detached` — This account was detached from its leader, so resting mirrors were cancelled.\n`end_of_day_day_order` — A `day` order that did not fill by the close. Nobody intervened; the clock ran out. Resend tomorrow, or use `gtc` if you meant it to survive the session.\n`contract_expired` — The contract expired, so the order can no longer be worked.\n`contract_ceased` — The contract stopped trading intra-day (a halt, delisting or corporate action), so the order was cancelled rather than left resting against something untradeable.\n`awaiting_settlement` — The contract ceased and is locked until its settlement value books, so no order against it can fill.\n`account_flattened` — ⚠️ A prop-rule action flattened the account — a drawdown breach or a daily-loss stop. Every resting order was cancelled, protective ones included. Read the account before sending anything else.\n`account_disabled_eod` — The account was disabled at end of day, cancelling its resting orders.\n`admin_disable_account` — An administrator disabled the account, cancelling its resting orders.\n`account_reset` — The account was reset, which clears its orders and positions.\n`workflow_trading_disabled` — Trading is disabled for this account under its firm’s programme.\n`fill_time_account_disabled` — The order reached a fill and the account was disabled at that moment, so the fill was refused and the order cancelled.\n`fill_time_closing_only` — The order reached a fill while the account was in closing-only, and it would have OPENED risk. Closing orders still work.\n`fill_time_workflow_disabled` — Trading was disabled for the account at the moment of fill.\n`fill_time_contract_ceased` — The contract had ceased trading by the time the order came to fill.\n`fill_time_ticker_delisted` — The underlying had been delisted by the time the order came to fill.\n`fill_time_awaiting_settlement` — The contract was locked awaiting its settlement value at the moment of fill.\n`insufficient_bp_at_fill` — ⚠️ There was not enough buying power when the order came to fill — not when you placed it. Read `available_bp`, which is the number the gate enforces and CAN BE NEGATIVE.\n`insufficient_funds_at_fill` — There was not enough settled cash when the order came to fill.\n`reduce_only_no_position` — A reduce-only order came to fill with no position left to reduce, so filling it would have OPENED the opposite side. Cancelled rather than inverted.\n`closes_inventory_position_gone` — A closing order came to fill against inventory that was already gone.\n`closes_inventory_partial` — A closing order came to fill against less inventory than it named, so it was cancelled rather than partially opening the other way.\n`over_close` — The order would have closed more contracts than the account holds.\n`matcher_self_cancel` — The matcher cancelled the order rather than fill it against a quote it judged unusable.\n`operator_remediation` — A support action reversed or unwound this order, usually as part of a remediation. The details are not machine-readable and are not published here; contact support quoting the order id if you need them."
          },
          "reduce_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "The reduce-only intent you DECLARED at placement, stored as sent. Distinct from what actually happened: for that, read `closes_inventory` on each execution, which the engine DERIVES per leg at fill time. The two can disagree, and the execution is the one that moved your position."
          },
          "legs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLeg"
            },
            "description": "The contracts this order trades. One entry for a single-leg order; one per leg for a spread, in the order you sent them."
          },
          "filled_quantity": {
            "type": "number",
            "description": "WHOLE STRUCTURES filled so far, in the same unit as `structure_units` and NEVER a contract count: a filled 10-lot vertical reports 10 here while each of its two legs traded 10 contracts. Derived from `status`, so it is 0 until the order fills and the order's whole size in structures once it has. ⚠️ Do not sum `quantity` from /executions to reproduce this number: an execution counts CONTRACTS on one leg."
          },
          "remaining_quantity": {
            "type": "number",
            "description": "What is still WORKING, in WHOLE STRUCTURES (the unit of `structure_units`). Zero for every terminal status, not just `filled`: a cancelled or rejected order has nothing left to fill and reports 0 here. `filled_quantity + remaining_quantity` equals `structure_units` while the order is pending or filled and is 0 on a cancelled or rejected one, so do not use it as a size on a terminal order."
          },
          "avg_fill_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The SIGNED net price per structure this order actually filled at: negative = debit (you paid), positive = credit (you received). Same convention as `limit_price`, so subtract the two to get slippage. Null until the order fills."
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the order was accepted, as an RFC 3339 UTC timestamp."
          },
          "filled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the order completed filling, as an RFC 3339 UTC timestamp. Null until it fills."
          }
        },
        "required": [
          "id",
          "client_order_id",
          "order_userref",
          "status",
          "order_type",
          "time_in_force",
          "limit_price",
          "stop_price",
          "stop_price_basis",
          "stop_underlying_direction",
          "structure_units",
          "underlying_trigger_price",
          "underlying_trigger_direction",
          "trail_amount",
          "trail_percent",
          "trail_anchor",
          "parent_order_id",
          "bracket_role",
          "oco_group_id",
          "cancellation_reason",
          "reduce_only",
          "legs",
          "filled_quantity",
          "remaining_quantity",
          "avg_fill_price",
          "created_at",
          "filled_at"
        ]
      },
      "OrderLeg": {
        "$id": "#/components/schemas/OrderLeg",
        "type": "object",
        "properties": {
          "leg_number": {
            "type": "number",
            "description": "Position of this leg within the order, starting at 1. Stable for the life of the order, so it is safe to key on when matching a leg you sent to the leg you read back."
          },
          "occ": {
            "type": "string",
            "description": "The contract, as an OCC symbol with NO padding: the root, then the expiration as YYMMDD, then `C` or `P`, then the strike in thousandths of a dollar zero-padded to 8 digits. `SPY251219C00600000` is the SPY 19 Dec 2025 600 call and `SPXW261218C05000000` the SPXW 18 Dec 2026 5000 call."
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Direction of THIS LEG: `buy` opens or closes long, `sell` opens or closes short. It says nothing about whether the leg opens or closes a position — read `closes_inventory` on the matching execution for that."
          },
          "quantity": {
            "type": "number",
            "description": "CONTRACTS on this leg, always positive. For a ratio structure this differs between legs; divide by `structure_units` on the order to recover the per-structure ratio."
          },
          "fill_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Premium per contract this leg filled at, in dollars, always positive. Null until the leg fills. Same name and same convention as `fill_price` on a fill leg and on an execution. The order-level `avg_fill_price` is the SIGNED net across all legs — these two use different conventions on purpose, because a leg has no debit/credit of its own."
          }
        },
        "required": [
          "leg_number",
          "occ",
          "side",
          "quantity",
          "fill_price"
        ]
      },
      "OrdersResponse": {
        "$id": "#/components/schemas/OrdersResponse",
        "type": "object",
        "properties": {
          "orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Order"
            },
            "description": "One page of orders, newest first."
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back verbatim as `cursor` to get the next page. Opaque — do not parse it. Null means this was the last page."
          }
        },
        "required": [
          "orders",
          "next_cursor"
        ]
      },
      "PlaceBracketResponse": {
        "$id": "#/components/schemas/PlaceBracketResponse",
        "type": "object",
        "properties": {
          "entry_order_id": {
            "type": "string",
            "description": "The entry order this bracket created."
          },
          "client_order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your unique handle for the entry, echoed back."
          },
          "order_userref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your run label, echoed back. It DESCRIBES THE ENTRY: this is an echo of your request, not a read-back of the book, and a bracket also mints protective children — whether those carry the label is a property of those orders. Read them back rather than assuming."
          },
          "entry_status": {
            "type": "string",
            "enum": [
              "filled",
              "pending"
            ],
            "description": "Whether the entry filled immediately or is resting."
          },
          "intent": {
            "type": "string",
            "const": "open",
            "description": "Always `open` — a bracket opens a position."
          },
          "protection": {
            "type": "object",
            "properties": {
              "stop_order_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The stop order actually protecting you. Track and cancel THIS one."
              },
              "target_order_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The target order actually working. Track and cancel THIS one."
              },
              "created_stop_order_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The stop id this call minted. What the audit trail references."
              },
              "created_target_order_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The target id this call minted. What the audit trail references."
              },
              "merged_into_existing": {
                "type": "boolean",
                "description": "True when a child this call created was folded into an identical pre-existing order — the created row was cancelled and its quantity added to the survivor. This is when the working ids and the created ids differ."
              }
            },
            "required": [
              "stop_order_id",
              "target_order_id",
              "created_stop_order_id",
              "created_target_order_id",
              "merged_into_existing"
            ],
            "description": "WHICH ORDERS ARE ACTUALLY PROTECTING THE POSITION. The `stop_order_id`/`target_order_id` pair is what is WORKING — track, modify and cancel those. The `created_*` pair is what this call minted. They are usually identical and differ only when a just-created child is deduped into an existing order. Both are published because acting on a created-but-cancelled id would leave you believing you were protected. ⚠️ ON A MULTI-LEVEL BRACKET THIS BLOCK DESCRIBES LEVEL 0 ONLY. Read `bracket_levels` instead whenever you sent `bracket_levels` — a client reading only this block would see one pair and conclude that was all its protection."
          },
          "bracket_levels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "oco_group_id": {
                  "type": "string",
                  "description": "The OCO group for this level — its stop and target cancel each other."
                },
                "stop_order_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The working stop at this level."
                },
                "target_order_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The working target at this level."
                },
                "quantity": {
                  "type": "number",
                  "description": "What this level protects, in SPREAD UNITS as you sent it: contracts on a single-leg entry, spreads on a multi-leg one (a level of 1 on a 2/4/2 butterfly is one 1/2/1 pair). This is the request’s unit, not the child order’s `quantity` column, which is the first leg’s contracts."
                }
              },
              "required": [
                "oco_group_id",
                "stop_order_id",
                "target_order_id",
                "quantity"
              ]
            },
            "description": "One entry per OCO pair on a multi-level bracket, and the COMPLETE picture of your protection. Empty on a single-level bracket. Entry 0 is reconciled with `protection`."
          },
          "fill": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "net_price": {
                    "type": "number",
                    "description": "SIGNED net price per structure: negative = debit, positive = credit."
                  },
                  "net_cash_effect": {
                    "type": "number",
                    "description": "Total cash movement in dollars, SIGNED."
                  },
                  "legs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "occ": {
                          "type": "string",
                          "description": "The contract, as an OCC symbol with no padding, such as `SPY251219C00600000`."
                        },
                        "side": {
                          "type": "string",
                          "enum": [
                            "buy",
                            "sell"
                          ],
                          "description": "Direction of this leg."
                        },
                        "quantity": {
                          "type": "number",
                          "description": "Contracts filled on this leg."
                        }
                      },
                      "required": [
                        "occ",
                        "side",
                        "quantity"
                      ]
                    },
                    "description": "What each leg of the entry filled."
                  }
                },
                "required": [
                  "net_price",
                  "net_cash_effect",
                  "legs"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "What the ENTRY filled, when it filled immediately (a market or marketable-limit entry). Null while the entry rests."
          },
          "recovered": {
            "description": "Present and true ONLY on a crash-recovery replay: your call landed and the bracket exists, but the process died before recording what it produced, so the ids above are null rather than omitted. It is a signal to read `GET /trader/v1/orders` for the details, not an error. Absent on every ordinary response.",
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "entry_order_id",
          "client_order_id",
          "order_userref",
          "entry_status",
          "intent",
          "protection",
          "bracket_levels",
          "fill"
        ]
      },
      "PlaceOrderResponse": {
        "$id": "#/components/schemas/PlaceOrderResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The new order's id. Use it to cancel, modify, or look the order up."
          },
          "client_order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your unique handle, echoed back. Store it — resending the same handle after a timeout returns this same order instead of placing a second one."
          },
          "order_userref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your run label, echoed back. ⚠️ NOT `client_order_id` above: that one is unique and names THIS order, this one is shared by many orders on purpose. They are returned side by side so you store both and never substitute one for the other when you later need to find an order again. Echoed from your request rather than read back from the stored row, so it is present on the idempotent-replay path too."
          },
          "status": {
            "type": "string",
            "description": "The order's state as of this response. — KNOWN VALUES: pending, filled, cancelled, rejected. This list GROWS: it is published as an open string on purpose, so a value added later cannot break a generated client. Branch on the values you know and keep a default arm."
          },
          "intent": {
            "type": "string",
            "enum": [
              "open",
              "close",
              "reduce_only"
            ],
            "description": "The intent the engine RESOLVED for this order, which is not necessarily the one you declared. One of THREE values, `open`, `close` or `reduce_only`: the vocabulary of an order's stored intent. The request vocabulary is a different set of three: a request declares `open`, `close` or `roll`, and a `roll` is reported here as `open`, because any leg that opens makes the order an open. An order placed through this endpoint is reported as `open` or `close`; `reduce_only` classifies the engine's own protective and system exits and is part of the type so a decoder never meets a value outside it."
          },
          "filled_quantity": {
            "type": "number",
            "description": "WHOLE STRUCTURES filled by this placement, the same unit as `structure_units` on GET /orders and NEVER a contract count. The order's size in structures when `status` is `filled`, otherwise 0."
          },
          "remaining_quantity": {
            "type": "number",
            "description": "WHOLE STRUCTURES still working, the same unit as `filled_quantity`: the order's size in structures unless `status` is `filled`, in which case 0. ⚠️ A recovered or replayed response whose `status` is neither `filled` nor `pending` still reports the placed size here; read GET /orders/{id} for what is working now."
          },
          "fill": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "net_price": {
                    "type": "number",
                    "description": "SIGNED net price per structure: negative = debit (you paid), positive = credit (you received)."
                  },
                  "net_cash_effect": {
                    "type": "number",
                    "description": "Total cash movement in dollars, SIGNED, across every leg — the sum of the legs' `cash_effect`."
                  },
                  "legs": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FillLeg"
                    },
                    "description": "What each leg filled at."
                  }
                },
                "required": [
                  "net_price",
                  "net_cash_effect",
                  "legs"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "What the order filled, or null while it is still resting. Present the moment it fills, so a marketable order tells you its fill without a second call."
          }
        },
        "required": [
          "id",
          "client_order_id",
          "order_userref",
          "status",
          "intent",
          "filled_quantity",
          "remaining_quantity",
          "fill"
        ]
      },
      "PnlCalendarDay": {
        "$id": "#/components/schemas/PnlCalendarDay",
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "The trading day in Eastern Time, `YYYY-MM-DD`."
          },
          "realized_pnl": {
            "type": "number",
            "description": "Profit or loss booked by CLOSING trades that day, GROSS of commissions."
          },
          "commissions": {
            "type": "number",
            "description": "ALL commissions charged that day — including the fees on trades that OPENED, whose P&L is not in `realized_pnl`. So `net_pnl` is not a like-for-like subtraction on a day you opened positions you did not close."
          },
          "net_pnl": {
            "type": "number",
            "description": "`realized_pnl` minus `commissions` for the day."
          },
          "closing_trades": {
            "type": "number",
            "description": "How many closing trades were booked that day."
          }
        },
        "required": [
          "date",
          "realized_pnl",
          "commissions",
          "net_pnl",
          "closing_trades"
        ]
      },
      "PnlCalendarResponse": {
        "$id": "#/components/schemas/PnlCalendarResponse",
        "type": "object",
        "properties": {
          "account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account this calendar covers."
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PnlCalendarDay"
            },
            "description": "One entry per trading day with activity, ascending."
          },
          "timezone": {
            "type": "string",
            "description": "The timezone the day boundaries are drawn in — Eastern, matching the trading session, not UTC and not your local time."
          }
        },
        "required": [
          "account_id",
          "days",
          "timezone"
        ]
      },
      "PolicyResponse": {
        "$id": "#/components/schemas/PolicyResponse",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "The account these rules apply to."
          },
          "api_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The credential this answer is FOR. Policy binds to (account, credential), so a firm may limit one key and not another and the same account can answer differently depending on which key asks. NULL on a browser session, which no key-bound rule applies to."
          },
          "any_in_force": {
            "type": "boolean",
            "description": "TRUE when at least one rule binds. Lets you answer “am I under any policy at all” without scanning the array."
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PolicyRule"
            },
            "description": "Every rule kind this server implements, each marked in force or not. Sized to the server’s capability rather than to your firm’s configuration, so you can render the full set of controls without hard-coding the list of kinds."
          }
        },
        "required": [
          "account_id",
          "api_key_id",
          "any_in_force",
          "rules"
        ]
      },
      "PolicyRule": {
        "$id": "#/components/schemas/PolicyRule",
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "description": "The rule kind, e.g. `order_rate`, `min_hold_time`, `notional`. This is the same value POLICY_REFUSED reports as `rule` when one of them refuses an order, so a refusal can be joined straight back to the entry here that caused it."
          },
          "in_force": {
            "type": "boolean",
            "description": "TRUE when this rule binds your credential on this account. FALSE means there is no limit of this kind — not that the kind is unsupported."
          },
          "params": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ],
            "description": "The rule’s parameters, exactly as the engine evaluates them — e.g. `{ max_orders, window_seconds }` for `order_rate`, `{ seconds }` for `min_hold_time`. NULL when `in_force` is false. Read the numbers here rather than hard-coding them: they are your firm’s settings and can change without a release."
          }
        },
        "required": [
          "kind",
          "in_force",
          "params"
        ]
      },
      "PortfolioResponse": {
        "$id": "#/components/schemas/PortfolioResponse",
        "type": "object",
        "properties": {
          "cash_balance": {
            "type": "number",
            "description": "SETTLED cash only, in dollars. Note this is the settled half alone — the ledger's `total_cash_after` is settled PLUS `unsettled_cash`, so the two do not match by design."
          },
          "positions_value": {
            "type": "number",
            "description": "Market value of all open positions, in dollars."
          },
          "portfolio_value": {
            "type": "number",
            "description": "Total account equity: cash plus positions value."
          },
          "unrealized_pnl": {
            "type": "number",
            "description": "Open profit and loss across all positions, before closing costs."
          },
          "realized_pnl": {
            "type": "number",
            "description": "GROSS closed profit and loss — the industry-standard headline, before fees. `net_realized_pnl` is what the account actually keeps."
          },
          "available_bp": {
            "type": "number",
            "description": "THE NUMBER THE ORDER GATE ENFORCES — size against this one. ⚠️ CAN BE NEGATIVE, and the sign is the important part. Zero means you have no room to open anything; a NEGATIVE means the account is in DEFICIT and every open is refused until you free that much — by closing positions or cancelling working orders. Treat `available_bp <= 0` as \"do not send\", and the magnitude of a negative as how far you have to dig out. Do not clamp it to zero in your own code: that discards the one number that tells you a refusal is structural rather than a matter of sizing down. You cannot re-derive it: the gate also subtracts buying power reserved by pending orders, which is on no other field of this API. Do not try. A client-side mirror of this number once read $71,655 while the gate was enforcing $1,878, because the mirror could not see a server-side flag. Without this field the only way to learn your buying power was to be refused — which costs an order-entry token and answers only when the answer is no."
          },
          "unsettled_cash": {
            "type": "number",
            "description": "Close proceeds awaiting T+1 settlement. Counts toward EQUITY but NOT toward buying power. Add it to `cash_balance` to reconcile against the ledger's `total_cash_after`."
          },
          "locked_buying_power": {
            "type": "number",
            "description": "Buying power held by open positions and working orders — one of the two subtrahends behind `available_bp`, published so you can see WHY it is what it is."
          },
          "risk_collateral_locked": {
            "type": "number",
            "description": "Collateral held against defined-risk and short positions — the other subtrahend behind `available_bp`. ⚠️ These two do NOT account for the whole difference: the gate also subtracts buying power reserved by pending orders, which this API does not publish, so `cash_balance - locked_buying_power - risk_collateral_locked` will read HIGHER than `available_bp` whenever you have working orders. That is the gap, not an error — `available_bp` is authoritative."
          },
          "total_fees": {
            "type": "number",
            "description": "Commissions and fees charged to date, in dollars."
          },
          "net_realized_pnl": {
            "type": "number",
            "description": "Closed P&L after fees — what the account actually keeps."
          },
          "net_unrealized_pnl": {
            "type": "number",
            "description": "Open P&L after the estimated cost of closing every position."
          },
          "liquidation_value": {
            "type": "number",
            "description": "What closing every position at market would leave the account with — the number to compare against the drawdown floor on `GET /trader/v1/account`."
          },
          "day_pnl": {
            "type": "number",
            "description": "Today's profit and loss against yesterday's close, in dollars. Not derivable from anything else on this response."
          }
        },
        "required": [
          "cash_balance",
          "positions_value",
          "portfolio_value",
          "unrealized_pnl",
          "realized_pnl",
          "available_bp",
          "unsettled_cash",
          "locked_buying_power",
          "risk_collateral_locked",
          "total_fees",
          "net_realized_pnl",
          "net_unrealized_pnl",
          "liquidation_value",
          "day_pnl"
        ]
      },
      "Position": {
        "$id": "#/components/schemas/Position",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Server-assigned position id."
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account holding this position."
          },
          "occ": {
            "type": "string",
            "description": "The contract, as an OCC symbol with no padding, such as `SPY251219C00600000`. `expiration`, `strike` and `right` on this row are the same terms already parsed out for you."
          },
          "underlying": {
            "type": "string",
            "description": "Underlying ticker — `SPY`, `SPX`, `AAPL`."
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "`long` if you own the contracts, `short` if you are the writer. ⚠️ This vocabulary is `long`/`short`; order and execution legs use `buy`/`sell`. They describe different things — a holding versus a direction of trade — so they are not interchangeable and are deliberately not spelled the same."
          },
          "quantity": {
            "type": "number",
            "description": "Contracts held, always positive; `side` carries the direction. For the netted per-structure figure, see `inventory_quantity`."
          },
          "avg_cost": {
            "type": "number",
            "description": "Average premium paid or received per contract, in dollars."
          },
          "mark": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The price this position is currently valued at — the LIQUIDATION touch, not the mid: the BID for a long and the ASK for a short, because that is the side you would actually cross to get out. Every money field on this row derives from it, and it is the same number the breach engine uses, so your P&L and your risk always agree. Both `bid` and `ask` are also published, so you can compute the mid yourself if you want it."
          },
          "unrealized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Open profit or loss in dollars, before the cost of closing. `market_value - cost_basis`, both of which are on this row."
          },
          "opened_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the position was opened, as an RFC 3339 UTC timestamp."
          },
          "group_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The OPENING-ORDER id that created this leg. Null for a single-leg position. ⚠️ This is NOT a lifecycle id — see `lifecycle_ids`, and do not pass this where a lifecycle is wanted."
          },
          "lifecycle_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every OPEN structure holding this contract — the id by which a STRUCTURE is addressed when you close or protect one. ⚠️ NOT `group_id`: that is the opening-order id and is null on a single-leg position, while these are ids of their own and always present. Passing a `group_id` where a lifecycle is expected is a real and silent mistake. Usually one entry. TWO OR MORE MEANS THIS LEG IS SHARED between structures — picking one arbitrarily picks which structure you protect or close, so the ambiguity is published rather than hidden behind a single value."
          },
          "bid": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best bid for one contract. Null when no quote is available, or when market data is withheld — the response envelope says which."
          },
          "ask": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best ask for one contract. Null when no quote is available, or when market data is withheld — the response envelope says which."
          },
          "cost_basis": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the position cost, in dollars: `avg_cost × quantity × 100`."
          },
          "market_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "What it is worth now, in dollars: `mark × quantity × 100`."
          },
          "unrealized_pnl_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Open P&L as a WHOLE-NUMBER percent of cost basis: `12.5` means 12.5%, not 0.125. ⚠️ Not the same scale as an order's `trail_percent`, which is a fraction (`0.03` = 3%). The two differ by 100x and are stated explicitly for that reason."
          },
          "net_unrealized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Open P&L after the estimated commission to close — what the position is actually worth to EXIT. `unrealized_pnl - est_close_commission`."
          },
          "liquidation_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Equal to `market_value` on every row, by construction, because `mark` is already the liquidation touch rather than a mid. Kept as its own field for existing consumers. Do not read it as a mid-based valuation net of crossing the spread — this platform does not value positions that way, and the difference here is always exactly $0.00."
          },
          "liquidation_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Equal to `net_unrealized_pnl` by construction, for the same reason: both are `unrealized_pnl - est_close_commission`."
          },
          "est_close_commission": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Estimated commission to close this position — a real deduction, and the only thing separating `unrealized_pnl` from `net_unrealized_pnl`."
          },
          "expiration": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Expiration date, `YYYY-MM-DD`. Parsed from `occ` for you."
          },
          "strike": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Strike price in dollars. Parsed from `occ` for you."
          },
          "right": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "CALL",
                  "PUT"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Contract right. Parsed from `occ` for you. Uppercase here; the OCC symbol itself uses a single `C` or `P`."
          },
          "iv": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Implied volatility for one contract, as a decimal: `0.25` means 25%."
          },
          "delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "PER-CONTRACT delta. For the position-weighted figure multiply by `quantity × 100` and negate for a short — or just read `GET /trader/v1/accounts/{account_id}/greeks`, which publishes the netted book so you never have to apply that convention yourself. Null means greeks are not yet computed — never 0, because a zero delta is a claim rather than an absence."
          },
          "gamma": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "PER-CONTRACT gamma. Weighted the same way as `delta`."
          },
          "theta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "PER-CONTRACT theta, per day. Weighted the same way as `delta`."
          },
          "vega": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "PER-CONTRACT vega, per volatility point. Weighted the same way as `delta`."
          },
          "protection": {
            "type": "object",
            "properties": {
              "stop_quantity": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Contracts on this leg already committed to exiting via a resting STOP-triggered order (stop, stop-limit, trailing stop, bracket stop)."
              },
              "target_quantity": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Contracts already committed via a resting TARGET-triggered order. ⚠️ A plain closing-direction `limit` counts — a scale-out you left resting occupies target capacity whether or not you think of it as a take-profit."
              },
              "stop_capacity_remaining": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "⚠️ THE NUMBER TO PASS AS `quantity` WHEN ADDING A STOP. POST /positions/{id}/protect refuses PROTECT_STOP_OVER_CAPACITY if you ask for more than this, and omitting `quantity` asks for the FULL position — which is why a second protect on a partly-protected leg used to be refused with no way to discover the right figure."
              },
              "target_capacity_remaining": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "The same, for a target. ⚠️ SEPARATE FROM THE STOP FIGURE ON PURPOSE, and they routinely differ: a 35-lot carrying a 20-lot resting scale-out has 35 free for a stop and 15 for a target. A single “unprotected” number could not say both, and attaching a stop and a target in one call is bounded by the SMALLER of the two."
              }
            },
            "required": [
              "stop_quantity",
              "target_quantity",
              "stop_capacity_remaining",
              "target_capacity_remaining"
            ],
            "description": "What is already protecting this leg, from the engine’s own capacity function — the same numbers POST /positions/{id}/protect enforces, not a second computation. Counted per CONTRACT and account-wide, so a leg held across two structures shows the exits of both."
          },
          "inventory_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The netted OPEN quantity for this leg's structure. Use this, not `quantity`, when deciding how much protection a structure needs — dividing account-wide pending exits by the wrong one has reported a spread fully protected when it had no stops at all. This endpoint is netted one row per (contract, side), so here it always equals `quantity`; it stays nullable so a future per-structure view can carry a different figure without a breaking change."
          },
          "settlement_status": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "active",
                  "awaiting_settlement"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "`awaiting_settlement` means this index position has ceased trading and is waiting on its official settlement price. It is LOCKED: every close will be refused until settlement lands. Without reading this the refusals look inexplicable."
          },
          "is_read_only": {
            "type": "boolean",
            "description": "True when the position cannot be acted on — currently, while it awaits index settlement."
          },
          "frozen_mark": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The price this row is pinned at while it is not being live-quoted, such as an index position awaiting settlement. Null on normally quoted positions."
          },
          "settle_kind": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "AM",
                  "PM"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether this index contract settles on the opening (`AM`) or closing (`PM`) print. Null for equity options."
          },
          "quote_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the quote behind this row's money last moved, as an RFC 3339 UTC timestamp. `bid`, `ask`, `mark`, `market_value`, `unrealized_pnl` and `liquidation_value` all derive from that one quote."
          },
          "quote_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How old that quote is, in milliseconds. The same age `/quotes`, `/greeks` and `/chain` publish for the same rows."
          },
          "stale_for_fill": {
            "type": "boolean",
            "description": "True when the quote on this row is older than the matcher's 30-second bound, so closing this position will refetch a live quote rather than fill against the `bid`/`ask` printed here. NECESSARY but not sufficient: the engine also requires the underlying to agree with the authoritative spot, which you cannot tell from this row. Treat a false as \"no refetch expected\", not as a guarantee of the printed price."
          }
        },
        "required": [
          "id",
          "account_id",
          "occ",
          "underlying",
          "side",
          "quantity",
          "avg_cost",
          "mark",
          "unrealized_pnl",
          "opened_at",
          "group_id",
          "lifecycle_ids",
          "bid",
          "ask",
          "cost_basis",
          "market_value",
          "unrealized_pnl_pct",
          "net_unrealized_pnl",
          "liquidation_value",
          "liquidation_pnl",
          "est_close_commission",
          "expiration",
          "strike",
          "right",
          "iv",
          "delta",
          "gamma",
          "theta",
          "vega",
          "protection",
          "inventory_quantity",
          "settlement_status",
          "is_read_only",
          "frozen_mark",
          "settle_kind",
          "quote_time",
          "quote_age_ms",
          "stale_for_fill"
        ]
      },
      "PositionHistoryEntry": {
        "$id": "#/components/schemas/PositionHistoryEntry",
        "type": "object",
        "properties": {
          "lifecycle_id": {
            "type": "string",
            "description": "The structure this entry describes."
          },
          "symbol": {
            "type": "string",
            "description": "Underlying ticker."
          },
          "status": {
            "type": "string",
            "enum": [
              "closed",
              "partially_closed"
            ],
            "description": "`closed` is a finished round trip. `partially_closed` has NOT decided: money is booked but contracts are still held. ⚠️ Exclude `partially_closed` from win-rate and round-trip statistics — counting a half-finished trade as a win or a loss is the commonest way these numbers go wrong."
          },
          "group_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set on MULTI-LEG lifecycles. Single-leg ones carry `single_occ` and `single_side` instead — exactly one of the two shapes is populated."
          },
          "single_occ": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The contract, on a SINGLE-LEG lifecycle. Null on multi-leg ones."
          },
          "single_side": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "`long` or `short`, on a SINGLE-LEG lifecycle. Null on multi-leg ones."
          },
          "opened_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the structure was first opened, as an RFC 3339 UTC timestamp."
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it fully closed. Null while it is only partially closed."
          },
          "last_activity_at": {
            "type": "string",
            "format": "date-time",
            "description": "THE PAGINATION SORT KEY: `closed_at` when closed, `opened_at` otherwise. Sort on this, not on `closed_at`, or partially-closed entries will order unpredictably."
          },
          "close_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the structure was closed — your own exit, a stop or target, expiration, or a risk action. Null while it is still open."
          },
          "realized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Profit or loss realized, GROSS of commissions. Use `net_pnl` for the figure after fees."
          },
          "commissions": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Commissions charged across this lifecycle, in dollars."
          },
          "net_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "`realized_pnl` minus `commissions` — what the account actually kept."
          },
          "max_open_contracts": {
            "type": "number",
            "description": "The largest position held at any point in this lifecycle, in contracts."
          },
          "n_opens": {
            "type": "number",
            "description": "How many separate opening fills built this position."
          },
          "n_partial_closes": {
            "type": "number",
            "description": "How many partial closes (scale-outs) it has had."
          },
          "legs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PositionHistoryLeg"
            },
            "description": "Per-leg detail for this structure."
          }
        },
        "required": [
          "lifecycle_id",
          "symbol",
          "status",
          "group_id",
          "single_occ",
          "single_side",
          "opened_at",
          "closed_at",
          "last_activity_at",
          "close_reason",
          "realized_pnl",
          "commissions",
          "net_pnl",
          "max_open_contracts",
          "n_opens",
          "n_partial_closes",
          "legs"
        ]
      },
      "PositionHistoryLeg": {
        "$id": "#/components/schemas/PositionHistoryLeg",
        "type": "object",
        "properties": {
          "occ": {
            "type": "string",
            "description": "The contract, as an OCC symbol with no padding, such as `SPY251219C00600000`."
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "Whether this leg was held long or short."
          },
          "opened_qty": {
            "type": "number",
            "description": "Contracts opened on this leg over the lifecycle."
          },
          "closed_qty": {
            "type": "number",
            "description": "Contracts closed on this leg. Less than `opened_qty` while the leg is still held."
          },
          "total_buy_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Everything paid to buy this leg, in dollars."
          },
          "total_sell_proceeds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Everything received selling this leg, in dollars."
          },
          "realized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Profit or loss realized on this leg, GROSS of commissions."
          },
          "commission": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Commissions charged on this leg, in dollars."
          },
          "first_fill_at": {
            "type": "string",
            "format": "date-time",
            "description": "First fill on this leg, as an RFC 3339 UTC timestamp."
          },
          "last_fill_at": {
            "type": "string",
            "format": "date-time",
            "description": "Most recent fill on this leg, as an RFC 3339 UTC timestamp."
          }
        },
        "required": [
          "occ",
          "side",
          "opened_qty",
          "closed_qty",
          "total_buy_cost",
          "total_sell_proceeds",
          "realized_pnl",
          "commission",
          "first_fill_at",
          "last_fill_at"
        ]
      },
      "PositionHistoryResponse": {
        "$id": "#/components/schemas/PositionHistoryResponse",
        "type": "object",
        "properties": {
          "account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account this history belongs to."
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PositionHistoryEntry"
            },
            "description": "One page of lifecycles, most recent activity first."
          },
          "next_after": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass back verbatim as `after` for the next page. Null exactly when there is no next page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists."
          },
          "as_of": {
            "type": "string",
            "description": "The instant this pagination run reads as of, shared by every page of the run — so a trade closing mid-pagination cannot shift rows between your pages."
          }
        },
        "required": [
          "account_id",
          "history",
          "next_after",
          "has_more",
          "as_of"
        ]
      },
      "PositionsResponse": {
        "$id": "#/components/schemas/PositionsResponse",
        "type": "object",
        "properties": {
          "positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Position"
            },
            "description": "Every open position on the account."
          },
          "market_data": {
            "description": "Whether the quotes above are complete, and which fields were withheld if not.",
            "$ref": "#/components/schemas/MarketDataVisibilityEnvelope"
          }
        },
        "required": [
          "positions",
          "market_data"
        ]
      },
      "ProtectResponse": {
        "$id": "#/components/schemas/ProtectResponse",
        "type": "object",
        "properties": {
          "position_id": {
            "type": "string",
            "description": "The position now protected."
          },
          "lifecycle_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The structure this protection is attributed to. Null for a standalone leg."
          },
          "oco_group_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The one-cancels-other group joining the stop and the target. Null when you requested only one side — a lone order has nothing to be one-cancels-other with."
          },
          "quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How much was protected, counted in the unit `quantity_unit` names. Null ONLY on a crash-recovery replay, which never reached the engine and so has no executed quantity to report — inventing one would be wrong outright when the unit is `spread`. Read `GET /trader/v1/orders` on that branch."
          },
          "quantity_unit": {
            "type": "string",
            "enum": [
              "contract",
              "spread"
            ],
            "description": "WHAT `quantity` COUNTS. `spread` on a multi-leg structure, where one unit closes a whole spread and therefore a different number of contracts on each leg; `contract` otherwise. Always read this before acting on `quantity` — a bare number that silently means two different things is what this field exists to prevent."
          },
          "protection": {
            "type": "object",
            "properties": {
              "stop_order_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The stop order actually protecting you. Track and cancel THIS one."
              },
              "target_order_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The target order actually working. Track and cancel THIS one."
              },
              "created_stop_order_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The stop id this call minted."
              },
              "created_target_order_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The target id this call minted."
              },
              "merged_into_existing": {
                "type": "boolean",
                "description": "True when a child this call created was folded into an identical pre-existing order — the created row was then CANCELLED. Expect this often on this route."
              }
            },
            "required": [
              "stop_order_id",
              "target_order_id",
              "created_stop_order_id",
              "created_target_order_id",
              "merged_into_existing"
            ],
            "description": "The WORKING ids versus the ids this call minted. Track `stop_order_id`/`target_order_id`. ⚠️ On this route a merge is NOT an edge case: you are protecting a position that already exists, so an identical protective order very often already does too, and the dedup runs unconditionally. Acting on a `created_*` id can mean acting on a cancelled order and believing you are protected."
          },
          "recovered": {
            "description": "Present and true ONLY on a crash-recovery replay: your call landed, but the process died before recording what it produced, so the ids above are null rather than omitted. A signal to read `GET /trader/v1/orders`, not an error. Absent on every ordinary response.",
            "type": "boolean",
            "const": true
          },
          "order_id": {
            "description": "RECOVERY ONLY, alongside `recovered`. Names the order this call created — the one thing you cannot get any other way on that branch, since the child ids are null. Absent on the ordinary response, where `protection` already carries the ids.",
            "type": "string"
          },
          "status": {
            "description": "RECOVERY ONLY. The recovered order's current status.",
            "type": "string",
            "enum": [
              "pending",
              "filled",
              "cancelled",
              "rejected"
            ]
          }
        },
        "required": [
          "position_id",
          "lifecycle_id",
          "oco_group_id",
          "quantity",
          "quantity_unit",
          "protection"
        ]
      },
      "QuotesResponse": {
        "$id": "#/components/schemas/QuotesResponse",
        "type": "object",
        "properties": {
          "quotes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketDataQuote"
            },
            "description": "One row per contract that was found."
          },
          "not_found": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Contracts you asked for that have no row. Includes any hidden by entitlement, indistinguishably — `meta.hidden_count` tells you whether that happened."
          },
          "malformed": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Strings you sent that are not parseable OCC symbols. Reported back rather than silently dropped, so a typo never looks like an empty market."
          },
          "stale": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Contracts you asked for whose SYMBOL did not meet the `freshness` bar you set, so no row is returned for them. ⚠️ DISTINCT FROM `not_found`, and the difference matters: these contracts EXIST and the platform holds a price for them — last session’s close — which you declined by asking for `freshness=live`. `meta.by_symbol` names the source and the age for each. Empty unless you set `freshness=live`. One stale symbol no longer voids the whole batch: the symbols that DID meet the bar are returned, so a basket read is not lost to a single illiquid leg. If EVERY symbol was stale the request is still refused with 409 `STALE_DATA`, because there is nothing to return and answering 200 with an empty list would read as “no such contracts”."
          },
          "meta": {
            "description": "Per-symbol freshness and entitlement information for this response.",
            "$ref": "#/components/schemas/MarketDataMeta"
          }
        },
        "required": [
          "quotes",
          "not_found",
          "malformed",
          "stale",
          "meta"
        ]
      },
      "RateCoverage": {
        "$id": "#/components/schemas/RateCoverage",
        "type": "object",
        "properties": {
          "complete": {
            "type": "boolean",
            "description": "True only when every date in the range was served."
          },
          "dates_served": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The curve dates actually returned, `YYYY-MM-DD`."
          },
          "dates_not_published": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "session_date": {
                  "type": "string",
                  "format": "date",
                  "description": "The date with no curve, `YYYY-MM-DD`."
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "weekend",
                    "bond_market_closed"
                  ],
                  "description": "Why Treasury published nothing. ⚠️ `bond_market_closed` is named for the BOND market and says NOTHING about whether options traded — the SIFMA calendar is not the equity calendar. Treasury has skipped Columbus Day and Veterans Day while the NYSE was open on both, so this archive holds option sessions for days with no rate curve. That is not a contradiction."
                }
              },
              "required": [
                "session_date",
                "reason"
              ]
            },
            "description": "Days Treasury did not publish a curve. These are FACTS, not gaps in our data."
          },
          "dates_not_fetched": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "session_date": {
                  "type": "string",
                  "format": "date",
                  "description": "The date we are missing, `YYYY-MM-DD`."
                },
                "year": {
                  "type": "number",
                  "description": "The year its source file covers."
                },
                "reason": {
                  "type": "string",
                  "description": "Why we do not hold it."
                }
              },
              "required": [
                "session_date",
                "year",
                "reason"
              ]
            },
            "description": "Days Treasury DID publish but we have not ingested. Unlike `dates_not_published`, these are genuine gaps on our side."
          }
        },
        "required": [
          "complete",
          "dates_served",
          "dates_not_published",
          "dates_not_fetched"
        ]
      },
      "RateCurveRow": {
        "$id": "#/components/schemas/RateCurveRow",
        "type": "object",
        "properties": {
          "session_date": {
            "type": "string",
            "format": "date",
            "description": "The curve date, `YYYY-MM-DD`."
          },
          "tenors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RateTenor"
            },
            "description": "The full published curve for that date, shortest tenor first."
          },
          "tenor_years": {
            "description": "The tenor you asked to be interpolated at. Present only when you supplied one.",
            "type": "number"
          },
          "rate_used_1e6": {
            "description": "The rate OUR greeks used at that tenor × 1,000,000, from the SAME interpolation the pricing engine runs — so you can reproduce our numbers exactly rather than approximating them. ⚠️ This is the PAR figure, because that is what the live engine currently feeds into Black-Scholes. `rate_used_cont_1e6` is the correctly-compounded equivalent.",
            "type": "number"
          },
          "rate_used_cont_1e6": {
            "description": "The same rate continuously compounded × 1,000,000 — what a textbook Black-Scholes wants.",
            "type": "number"
          }
        },
        "required": [
          "session_date",
          "tenors"
        ]
      },
      "RateTenor": {
        "$id": "#/components/schemas/RateTenor",
        "type": "object",
        "properties": {
          "years": {
            "type": "number",
            "description": "Tenor in years. `0.0833…` is the 1-month point, `30` the long bond."
          },
          "par_1e6": {
            "type": "number",
            "description": "Treasury's published PAR yield × 1,000,000."
          },
          "cont_1e6": {
            "type": "number",
            "description": "The same rate on a CONTINUOUSLY-COMPOUNDED basis × 1,000,000. Use this one for Black-Scholes — feeding a par yield in as `r` is a real and easy mistake."
          }
        },
        "required": [
          "years",
          "par_1e6",
          "cont_1e6"
        ]
      },
      "ReconcilePosition": {
        "$id": "#/components/schemas/ReconcilePosition",
        "type": "object",
        "properties": {
          "occ": {
            "type": "string",
            "description": "The contract, as an OCC symbol with no padding, such as `SPY251219C00600000`."
          },
          "underlying": {
            "type": "string",
            "description": "Underlying ticker."
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "`long` if you own the contracts, `short` if you wrote them."
          },
          "quantity": {
            "type": "number",
            "description": "Contracts held, always positive. `side` carries the direction."
          },
          "avg_cost": {
            "type": "number",
            "description": "Average premium paid or received per contract, in dollars."
          },
          "mark": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Current valuation price per contract — the liquidation touch, in dollars."
          },
          "unrealized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Open profit or loss on this position, in dollars."
          },
          "group_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The opening-order id that created this leg. Null for a single-leg position."
          }
        },
        "required": [
          "occ",
          "underlying",
          "side",
          "quantity",
          "avg_cost",
          "mark",
          "unrealized_pnl",
          "group_id"
        ]
      },
      "ReconcileResponse": {
        "$id": "#/components/schemas/ReconcileResponse",
        "type": "object",
        "properties": {
          "as_of_sequence": {
            "type": "string",
            "description": "The account sequence this snapshot is as of. For logging and for eyeballing a gap — do NOT feed it to the stream; use `resume_cursor`."
          },
          "resume_cursor": {
            "type": "string",
            "description": "THE CURSOR TO HAND THE SOCKET. Pass this verbatim as the stream's `resume` parameter. ⚠️ Do not pass `as_of_sequence` instead: it is a scalar, the stream expects an encoded per-account map, and a scalar decodes to empty — which means REPLAY ALL HISTORY while still reporting itself as resumed."
          },
          "account_id": {
            "type": "string",
            "description": "The account this snapshot describes."
          },
          "balances": {
            "description": "The account's money as of `as_of_sequence`.",
            "$ref": "#/components/schemas/PortfolioResponse"
          },
          "positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReconcilePosition"
            },
            "description": "Every open position as of `as_of_sequence`. Leaner than `GET /trader/v1/positions`: no row id, no per-row account id, no open timestamp."
          },
          "orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Order"
            },
            "description": "Every WORKING order as of `as_of_sequence` — everything still pending, protective stops and targets included. Terminal orders are NOT here; read `GET /trader/v1/orders` for history. ⚠️ WITHOUT THIS YOU CANNOT BUILD AN ORDER BOOK. The event stream announces an order with `order.accepted` only on the paths that place one through this API — an order you placed in the browser, or one the platform created for you (a bracket child, a copy mirror), reaches you first as the `execution.filled` or `order.cancelled` that ENDS it, naming an id you have never seen. This snapshot is where those ids come from. IDENTICAL in shape to `GET /trader/v1/orders`, field for field, so one parser handles both."
          },
          "resume": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "description": "Where the stream will resume from."
              },
              "instruction": {
                "type": "string",
                "description": "Human-readable guidance on resuming. Do not branch on it."
              }
            },
            "required": [
              "from",
              "instruction"
            ],
            "description": "How to resume the event stream from this snapshot without a gap."
          }
        },
        "required": [
          "as_of_sequence",
          "resume_cursor",
          "account_id",
          "balances",
          "positions",
          "orders",
          "resume"
        ]
      },
      "Refusal": {
        "$id": "#/components/schemas/Refusal",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Opaque, monotonic, and the cursor for `after`. A STRING because it is an int8 — a JSON number silently truncates past 2^53."
          },
          "control": {
            "type": "string",
            "description": "Which control refused. Free-form by design so a new control is reviewable without a migration — read it, do not branch on an exhaustive list of it."
          },
          "sink": {
            "type": "string",
            "enum": [
              "placement",
              "matcher"
            ],
            "description": "WHERE it was refused. `placement` — as you sent it. `matcher` — while the order was already resting."
          },
          "client_visible": {
            "type": "boolean",
            "description": "⚠️ READ THIS FIRST. FALSE means NO response ever carried this refusal: it happened to an order already working, where there was no request in flight to answer, so this is the only place it is reported. A stop that never triggered can look exactly like a stop that was never hit; this is how you tell the difference."
          },
          "order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The order refused, when there was one. NULL where the control fired before an order existed — a halt at placement has nothing to point at yet."
          },
          "api_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The credential that provoked it. Published because \"my other bot tripped this\" and \"my firm halted me\" are different problems and the account sees both."
          },
          "refused_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the control fired."
          },
          "detail": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Control-specific context — the limit, the observed value, the switch. Shape varies by `control`, so branch on that rather than on the shape here."
          }
        },
        "required": [
          "id",
          "control",
          "sink",
          "client_visible",
          "order_id",
          "api_key_id",
          "refused_at",
          "detail"
        ]
      },
      "RefusalsResponse": {
        "$id": "#/components/schemas/RefusalsResponse",
        "type": "object",
        "properties": {
          "refusals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Refusal"
            },
            "description": "Newest first."
          },
          "next_after": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass as `after` for the next (older) page. NULL when the history is exhausted."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists. Authoritative — a full page does not imply more, and a short page does not imply the end."
          }
        },
        "required": [
          "refusals",
          "next_after",
          "has_more"
        ]
      },
      "RegisterDemandResponse": {
        "$id": "#/components/schemas/RegisterDemandResponse",
        "type": "object",
        "properties": {
          "registered": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DemandSubscription"
            },
            "description": "The symbols now pinned, and the expirations pinned for each."
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Symbols that were NOT registered — either no expiration calendar exists for them, or they are not visible to this credential. Reported rather than silently dropped."
          },
          "expirations_per_symbol": {
            "type": "number",
            "description": "How many expirations are pinned per symbol."
          },
          "ttl_seconds": {
            "type": "number",
            "description": "⚠️ Registration EXPIRES after this many seconds. Re-register before it lapses to keep a symbol pinned — quotes go stale silently otherwise."
          },
          "note": {
            "type": "string",
            "description": "Human-readable summary. Do not branch on it."
          }
        },
        "required": [
          "registered",
          "skipped",
          "expirations_per_symbol",
          "ttl_seconds",
          "note"
        ]
      },
      "RevokeKeyResponse": {
        "$id": "#/components/schemas/RevokeKeyResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The key that was revoked."
          },
          "revoked": {
            "type": "boolean",
            "description": "Whether the key is now revoked. Revoking is IDEMPOTENT — revoking an already-revoked key is a success, not an error."
          }
        },
        "required": [
          "id",
          "revoked"
        ]
      },
      "RotateWebhookKeyResponse": {
        "$id": "#/components/schemas/RotateWebhookKeyResponse",
        "type": "object",
        "properties": {
          "endpoint_id": {
            "type": "string",
            "description": "The endpoint whose signing key was rotated."
          },
          "signing_key_id": {
            "type": "string",
            "description": "The NEW key id. Deliveries from now on carry this."
          },
          "signing_secret": {
            "type": "string",
            "description": "⚠️ The new secret, shown exactly once. Store it now."
          },
          "previous_key_valid_until": {
            "type": "string",
            "description": "The old key keeps verifying until this instant, as an RFC 3339 UTC timestamp, so you can deploy the new secret without rejecting deliveries signed in the gap. Accept either key until then."
          }
        },
        "required": [
          "endpoint_id",
          "signing_key_id",
          "signing_secret",
          "previous_key_valid_until"
        ]
      },
      "SandboxAccountResponse": {
        "$id": "#/components/schemas/SandboxAccountResponse",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "The sandbox account. Use it as `{account_id}` on account-scoped paths."
          },
          "environment": {
            "type": "string",
            "const": "sandbox",
            "description": "Always `sandbox`."
          },
          "starting_balance": {
            "type": "number",
            "description": "What the sandbox account was funded with, in dollars."
          },
          "created": {
            "type": "boolean",
            "description": "True on the call that created the account, false on every repeat. The call is safe to repeat."
          },
          "market_data_requires_attestation": {
            "type": "boolean",
            "description": "Provisioning a sandbox account does NOT grant market data — quotes still require attestation. Stated here because it is the natural assumption and it is wrong."
          },
          "note": {
            "type": "string",
            "description": "Human-readable summary. Do not branch on it."
          }
        },
        "required": [
          "account_id",
          "environment",
          "starting_balance",
          "created",
          "market_data_requires_attestation",
          "note"
        ]
      },
      "SubmissionResponse": {
        "$id": "#/components/schemas/SubmissionResponse",
        "type": "object",
        "properties": {
          "idempotency_key": {
            "type": "string",
            "description": "The key you asked about, echoed back."
          },
          "found": {
            "type": "boolean",
            "description": "Whether a submission with this key exists. False means we never saw it — your request never landed, and resending is safe."
          },
          "outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "What happened to the submission. Null when `found` is false."
          },
          "order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The order the submission produced, if it produced one. Use it to read the order back. Null when the submission was refused or was never found."
          },
          "reject_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The stable error code the submission was refused with. Null when it was not refused."
          },
          "retry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether resending the identical request could ever succeed: `backoff` means the refusal was transient, `never` means something must change first. Null when the submission was not refused."
          },
          "decided_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the outcome was decided, as an RFC 3339 UTC timestamp. Null when `found` is false."
          }
        },
        "required": [
          "idempotency_key",
          "found",
          "outcome",
          "order_id",
          "reject_code",
          "retry",
          "decided_at"
        ]
      },
      "SymbolUniverseEntry": {
        "$id": "#/components/schemas/SymbolUniverseEntry",
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "description": "The underlying ticker."
          },
          "tradable": {
            "type": "boolean",
            "description": "Whether an order that OPENS or ADDS risk may be placed on this root. CLOSES are never gated by this — you can always exit what you hold."
          },
          "large_chain": {
            "type": "boolean",
            "description": "This root serves a TIGHTER strike and expiry window, because its full chain is very large. Expect fewer contracts back than for an ordinary root."
          },
          "index_etf": {
            "type": "boolean",
            "description": "This root serves the WIDEST strike window — SPY, QQQ, IWM, DIA."
          }
        },
        "required": [
          "symbol",
          "tradable",
          "large_chain",
          "index_etf"
        ]
      },
      "SymbolUniverseResponse": {
        "$id": "#/components/schemas/SymbolUniverseResponse",
        "type": "object",
        "properties": {
          "symbols": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SymbolUniverseEntry"
            },
            "description": "The roots this credential may search and trade."
          },
          "count": {
            "type": "number",
            "description": "How many entries are in `symbols`."
          },
          "source": {
            "type": "string",
            "enum": [
              "db",
              "baseline"
            ],
            "description": "`db` is the real universe. ⚠️ `baseline` is the COMPILED-IN FLOOR, served when the registry is unavailable — it is not the real universe and is much smaller. Do not cache a `baseline` list, and do not conclude from one that a symbol is unsupported."
          },
          "registry_degraded": {
            "type": "boolean",
            "description": "True when the symbol registry could not be read and a fallback was served."
          },
          "holdings_degraded": {
            "type": "boolean",
            "description": "True when roots you HOLD may be missing from this listing — so an absence here does not mean you have no position in it."
          }
        },
        "required": [
          "symbols",
          "count",
          "source",
          "registry_degraded",
          "holdings_degraded"
        ]
      },
      "TermsChange": {
        "$id": "#/components/schemas/TermsChange",
        "type": "object",
        "properties": {
          "underlying": {
            "type": "string",
            "description": "The PRE-action OCC root."
          },
          "ex_date": {
            "type": "string",
            "format": "date",
            "description": "The Eastern date the terms change AT THE OPEN, `YYYY-MM-DD`. Rows on or after it are in the NEW terms; rows before it are in the old ones."
          },
          "action_kind": {
            "type": "string",
            "enum": [
              "forward_split",
              "reverse_split",
              "stock_dividend",
              "special_cash_dividend",
              "spinoff",
              "merger_cash",
              "merger_stock",
              "symbol_change",
              "other"
            ],
            "description": "What happened to the underlying."
          },
          "strike_transform_kind": {
            "type": "string",
            "enum": [
              "identity",
              "ratio",
              "delta"
            ],
            "description": "How to transform a strike across this action: `identity` (unchanged), `ratio` (multiply by `strike_num/strike_den`), or `delta` (subtract `strike_delta_milli`)."
          },
          "strike_num": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Numerator of the strike ratio. Kept RATIONAL rather than given as a decimal factor: a 1:3 reverse split on a $27.50 strike is $9.1666…, which is not representable in cents at all, and a rounded 0.3333 would push the rounding decision onto you with less information than we have. Null unless `strike_transform_kind` is `ratio`."
          },
          "strike_den": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Denominator of the strike ratio. Null unless the transform is `ratio`."
          },
          "strike_delta_milli": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Amount to subtract from the strike, in OCC-native thousandths of a dollar, as an integer. Null unless the transform is `delta`."
          },
          "qty_num": {
            "type": "number",
            "description": "Numerator of the contract-quantity adjustment."
          },
          "qty_den": {
            "type": "number",
            "description": "Denominator of the contract-quantity adjustment."
          },
          "deliverable_shares_num": {
            "type": "number",
            "description": "Numerator of the shares each contract delivers after the action."
          },
          "deliverable_shares_den": {
            "type": "number",
            "description": "Denominator of the shares each contract delivers after the action."
          },
          "deliverable_cash_cents": {
            "type": "number",
            "description": "Cash each contract delivers after the action, in cents."
          },
          "deliverable_other_count": {
            "type": "number",
            "description": "Greater than 0 means the contract delivers something we CANNOT VALUE — a spinoff stub, for instance. Treat those contracts as unpriceable rather than assuming cash and shares are the whole story."
          },
          "multiplier": {
            "type": "number",
            "description": "The contract multiplier after the action. Usually 100."
          },
          "new_root": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The adjusted OCC root, such as `MNST1`. NULL when the root is unchanged."
          },
          "terms_trust_ceiling": {
            "type": "string",
            "enum": [
              "trusted",
              "unknown",
              "suspect"
            ],
            "description": "How far OUR OWN terms can be trusted. An unsupported deliverable is structurally incapable of being marked `trusted`, so anything below it is us saying we do not fully know the terms — which you should be able to READ rather than infer from silence."
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "vendor",
              "detector_confirmed"
            ],
            "description": "Where these terms came from."
          },
          "version": {
            "type": "number",
            "description": "Bumped by corrections. Corrections are UPDATEs, never DELETEs, so the record stays auditable — re-read a range if you cached terms at an older version."
          }
        },
        "required": [
          "underlying",
          "ex_date",
          "action_kind",
          "strike_transform_kind",
          "strike_num",
          "strike_den",
          "strike_delta_milli",
          "qty_num",
          "qty_den",
          "deliverable_shares_num",
          "deliverable_shares_den",
          "deliverable_cash_cents",
          "deliverable_other_count",
          "multiplier",
          "new_root",
          "terms_trust_ceiling",
          "source",
          "version"
        ]
      },
      "TraderAccount": {
        "$id": "#/components/schemas/TraderAccount",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Use this as `{account_id}` on every account-scoped path."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled",
              "failed",
              "passed"
            ],
            "description": "The account's lifecycle state. Note `active` does not by itself mean opens are accepted — read `closing_only` on `GET /trader/v1/account` as well."
          },
          "account_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Trading permissions — notably `cash` versus `margin`."
          },
          "environment": {
            "type": "string",
            "enum": [
              "live",
              "sandbox"
            ],
            "description": "`live` or `sandbox`. A credential only ever sees accounts matching its own environment, so this list can never mix the two."
          },
          "archived": {
            "type": "boolean",
            "description": "True for a retired account. It stays readable but cannot be traded."
          },
          "is_leader": {
            "type": "boolean",
            "description": "Whether this account has opted IN to being followed. Copy trading is same-owner only, so the accounts you may point a follower at are exactly YOUR accounts with this true — which makes this listing the answer to \"which of my accounts can lead\", in one call. Following a `false` one is refused with `COPY_LEADER_NOT_ACCEPTING`; switch it on with `PUT /trader/v1/accounts/{account_id}/copy/leader`."
          },
          "following_account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account this one MIRRORS, or null. ⚠️ NON-NULL MEANS IT CANNOT BE TRADED DIRECTLY: every placement, cancel and modify on it is refused with `COPY_FOLLOWER_CANNOT_PLACE` / `_CANCEL` / `_MODIFY`. Published here so you learn it from a listing rather than from a refusal."
          }
        },
        "required": [
          "account_id",
          "status",
          "account_type",
          "environment",
          "archived",
          "is_leader",
          "following_account_id"
        ]
      },
      "TraderEvent": {
        "$id": "#/components/schemas/TraderEvent",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Event id, unique across the platform."
          },
          "sequence": {
            "type": "string",
            "description": "Per-ACCOUNT sequence number, gap-free — so a gap means you missed an event, not that one was skipped. Resume from the last one you processed. A STRING because it is a 64-bit integer and would lose precision as a JSON number; compare numerically, not lexically."
          },
          "type": {
            "type": "string",
            "description": "What happened. This is the DISCRIMINATOR for `data` — switch on it to know which payload shape you have. — KNOWN VALUES: order.accepted, order.rejected, order.cancelled, order.expired, execution.filled, order.modified_by_system, account.adjusted, controls.halt_engaged, controls.halt_released. This list GROWS: it is published as an open string on purpose, so a value added later cannot break a generated client. Branch on the values you know and keep a default arm."
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the event happened, as an RFC 3339 UTC timestamp."
          },
          "account_id": {
            "type": "string",
            "description": "The account this event is about."
          },
          "order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The order this event is about. Null on events that are not about an order."
          },
          "client_order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your unique handle for that order, carried on the event so you can attribute it WITHOUT joining back to the orders table — on the streaming transports there is no table to join to. Null when you did not supply one."
          },
          "order_userref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your run label for that order. THIS is the field that makes a run readable as a run: grouping a session's events by `order_userref` gives you every fill, cancel and rejection belonging to one algorithm run in a single pass. ⚠️ `client_order_id` cannot do that — being unique per user, it buckets events one order at a time. Null on every event raised by the UI, by copy trading, or by the engine itself, and null on events with no order at all."
          },
          "data": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "ord_status": {
                    "type": "string",
                    "description": "The order's status at acceptance."
                  },
                  "order_type": {
                    "type": "string",
                    "description": "How the accepted order prices and triggers."
                  },
                  "intent": {
                    "type": "string",
                    "description": "`open` or `close` — what the engine RESOLVED this order to, which is not necessarily what you declared."
                  },
                  "source": {
                    "type": "string",
                    "description": "What placed the order — the trader API, the browser, copy trading, or the engine itself. Switch on it with a default: new sources are added over time."
                  },
                  "limit_price": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "SIGNED net for the structure: negative = debit, positive = credit. Null on a market order."
                  },
                  "legs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "occ": {
                          "type": "string",
                          "description": "The contract, as a 21-character OCC symbol."
                        },
                        "side": {
                          "type": "string",
                          "description": "`buy` or `sell` for this leg."
                        },
                        "quantity": {
                          "type": "number",
                          "description": "Contracts on this leg, always positive."
                        }
                      },
                      "required": [
                        "occ",
                        "side",
                        "quantity"
                      ]
                    },
                    "description": "The contracts the order will trade."
                  },
                  "bracket_role": {
                    "description": "`stop` or `target` on a PROTECTIVE child. Absent on an ordinary order. A child is created by the platform when you attach protection — you did not send it, so this event is how you learn it exists and belongs in your book.",
                    "type": "string"
                  },
                  "parent_order_id": {
                    "description": "The entry this protective child guards. Absent on an ordinary order. ⚠️ When the parent dies the child dies with it, carrying `reason: parent_order_cancelled` — so pair them on this id rather than reading the child’s cancellation as something that happened on its own account.",
                    "type": "string"
                  },
                  "stop_price": {
                    "description": "The stop level a PROTECTIVE STOP child is watching, a positive premium. Present on every protective child and NULL on a target — both keys are always sent so one parse handles either role. Also null on a stop that triggers on an underlying level rather than a premium; read the order back for that case. Absent entirely on an ordinary order, which has no `bracket_role`.",
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "target_price": {
                    "description": "The take-profit level a PROTECTIVE TARGET child is watching, a positive premium. Present on every protective child and NULL on a stop, for the same reason as `stop_price` above. Absent entirely on an ordinary order.",
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "ord_status",
                  "order_type",
                  "intent",
                  "source",
                  "limit_price",
                  "legs"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "ord_status": {
                    "type": "string",
                    "description": "The order's status after refusal."
                  },
                  "code": {
                    "type": "string",
                    "description": "The SAME stable refusal code the REST call would have returned. Branch on this."
                  },
                  "retry": {
                    "type": "string",
                    "description": "The retry class for `code`: `never`, `backoff`, or `immediate`. Says whether resending the identical request could ever succeed."
                  },
                  "idempotency_key": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The key this submission carried. Null when the refusal was raised before a key was ever read."
                  },
                  "detail": {
                    "description": "Structured context for this refusal, on the codes that carry it. The shape varies by `code`, so it is published as an open object rather than a shape that could not be kept honest."
                  }
                },
                "required": [
                  "ord_status",
                  "code",
                  "retry",
                  "idempotency_key"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "ord_status": {
                    "type": "string",
                    "description": "The order's status after cancellation."
                  },
                  "source": {
                    "type": "string",
                    "description": "What cancelled it — you, the browser, or the engine."
                  },
                  "reason": {
                    "description": "Why the engine cancelled it. Present only on the engine-initiated path; a cancel you requested carries none. ⚠️ A TOKEN, NOT PROSE — switch on it. The set is OPEN: treat an unfamiliar value as “the platform cancelled it” rather than rejecting the event.\n\n`user_cancelled` — You cancelled it. No action needed.\n`oco_sibling_user_cancelled` — You cancelled the other half of this one-cancels-other pair, so this side went with it.\n`parent_order_cancelled` — Its parent order was cancelled, so this protective child went with it. Read the parent’s own reason to learn why — this one only says it was a cascade.\n`oco_sibling_filled` — The other half of the one-cancels-other pair FILLED, so this side was cancelled. This is the ordinary end of a bracket, not a problem.\n`bracket_dedup_merge` — Folded into an identical protective order that already existed. You are still protected — by the surviving order, whose id is on the response that created this one. Acting on this id would be acting on a cancelled order.\n`exit_order_voided_by_position_close` — ⚠️ The position this protected was closed, so the order had nothing left to protect. Expected after you flatten; unexpected if you still believe you hold the position.\n`exit_order_uncomputable_threshold_on_prune` — ⚠️ ACT ON THIS. Part of the structure closed and the surviving leg’s stop could not be re-based safely, so the protection was cancelled rather than left silently wrong. You are holding an UNPROTECTED position — re-place protection.\n`underlying_position_gone` — ⚠️ The inventory this order was written against is no longer held.\n`copy_leader_cancelled` — The leader you follow cancelled the order this mirrors, so your mirror — and any protective children it had — was cancelled too. You did not do this.\n`copy_close_cancels_pending_open` — The leader closed the position while your mirror of their OPEN was still resting, so the resting open was cancelled rather than filled into a position they no longer hold.\n`copy_unfollowed` — You stopped following this leader, so their resting mirrors were cancelled.\n`copy_detached` — This account was detached from its leader, so resting mirrors were cancelled.\n`end_of_day_day_order` — A `day` order that did not fill by the close. Nobody intervened; the clock ran out. Resend tomorrow, or use `gtc` if you meant it to survive the session.\n`contract_expired` — The contract expired, so the order can no longer be worked.\n`contract_ceased` — The contract stopped trading intra-day (a halt, delisting or corporate action), so the order was cancelled rather than left resting against something untradeable.\n`awaiting_settlement` — The contract ceased and is locked until its settlement value books, so no order against it can fill.\n`account_flattened` — ⚠️ A prop-rule action flattened the account — a drawdown breach or a daily-loss stop. Every resting order was cancelled, protective ones included. Read the account before sending anything else.\n`account_disabled_eod` — The account was disabled at end of day, cancelling its resting orders.\n`admin_disable_account` — An administrator disabled the account, cancelling its resting orders.\n`account_reset` — The account was reset, which clears its orders and positions.\n`workflow_trading_disabled` — Trading is disabled for this account under its firm’s programme.\n`fill_time_account_disabled` — The order reached a fill and the account was disabled at that moment, so the fill was refused and the order cancelled.\n`fill_time_closing_only` — The order reached a fill while the account was in closing-only, and it would have OPENED risk. Closing orders still work.\n`fill_time_workflow_disabled` — Trading was disabled for the account at the moment of fill.\n`fill_time_contract_ceased` — The contract had ceased trading by the time the order came to fill.\n`fill_time_ticker_delisted` — The underlying had been delisted by the time the order came to fill.\n`fill_time_awaiting_settlement` — The contract was locked awaiting its settlement value at the moment of fill.\n`insufficient_bp_at_fill` — ⚠️ There was not enough buying power when the order came to fill — not when you placed it. Read `available_bp`, which is the number the gate enforces and CAN BE NEGATIVE.\n`insufficient_funds_at_fill` — There was not enough settled cash when the order came to fill.\n`reduce_only_no_position` — A reduce-only order came to fill with no position left to reduce, so filling it would have OPENED the opposite side. Cancelled rather than inverted.\n`closes_inventory_position_gone` — A closing order came to fill against inventory that was already gone.\n`closes_inventory_partial` — A closing order came to fill against less inventory than it named, so it was cancelled rather than partially opening the other way.\n`over_close` — The order would have closed more contracts than the account holds.\n`matcher_self_cancel` — The matcher cancelled the order rather than fill it against a quote it judged unusable.\n`operator_remediation` — A support action reversed or unwound this order, usually as part of a remediation. The details are not machine-readable and are not published here; contact support quoting the order id if you need them.",
                    "type": "string"
                  },
                  "cascade": {
                    "description": "True when this order died because its PARENT did, not on its own account. ⚠️ Without this you cannot tell \"your stop was hit\" from \"your entry was voided and its stop went with it\" — and those call for opposite responses.",
                    "type": "boolean"
                  },
                  "cascaded_from": {
                    "description": "The parent order whose cancellation took this one with it. Cascaded rows only.",
                    "type": "string"
                  },
                  "root_reason": {
                    "description": "The reason the PARENT was killed for. Cascaded rows only, where `reason` is the generic `parent_order_cancelled` and this is the fact you actually want.",
                    "type": "string"
                  }
                },
                "required": [
                  "ord_status",
                  "source"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "ord_status": {
                    "type": "string",
                    "description": "Reported as `expired` here — note the order itself reads `cancelled`."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why it expired — `end_of_day_day_order` for a day order that reached the close."
                  },
                  "scope": {
                    "type": "string",
                    "description": "WHAT expired: `order`. Said explicitly because an ORDER expiring is not the same event as a CONTRACT expiring, and a client holding both must be able to tell them apart."
                  },
                  "time_in_force": {
                    "type": "string",
                    "enum": [
                      "day",
                      "gtc"
                    ],
                    "description": "The time-in-force that ran out."
                  }
                },
                "required": [
                  "ord_status",
                  "reason",
                  "scope",
                  "time_in_force"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "ord_status": {
                    "type": "string",
                    "description": "The order's status after this fill."
                  },
                  "source": {
                    "type": "string",
                    "description": "What produced the fill — the matcher, an exit path, expiration, or settlement."
                  },
                  "net_price": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "SIGNED net for the structure: negative = debit, positive = credit. Null when the path does not compute one."
                  },
                  "legs": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "occ": {
                          "type": "string",
                          "description": "The contract, as a 21-character OCC symbol."
                        },
                        "side": {
                          "type": "string",
                          "description": "`buy` or `sell` for this leg."
                        },
                        "quantity": {
                          "type": "number",
                          "description": "Contracts filled on this leg, always positive."
                        },
                        "fill_price": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Premium per contract this leg printed at, in dollars, always positive. Null when the path does not resolve a per-leg price."
                        }
                      },
                      "required": [
                        "occ",
                        "side",
                        "quantity",
                        "fill_price"
                      ]
                    },
                    "description": "What each leg printed at."
                  },
                  "order_type": {
                    "description": "The order type that filled. ABSENT on the settlement path, and explicitly NULL where the fill cannot resolve one — absent and null are different claims here, so handle both.",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "commission": {
                    "type": "number",
                    "description": "Commission charged on this fill, in dollars. Always present: cash settlement books 0 rather than omitting it."
                  },
                  "bracket_role": {
                    "description": "Which protective leg filled — `stop` or `target`. Bracket children only.",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "ord_status",
                  "source",
                  "net_price",
                  "legs",
                  "commission"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "field": {
                    "type": "string",
                    "description": "WHICH field the platform changed: `quantity` or `structure_units`."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why the platform changed it."
                  },
                  "prior_reserved_bp": {
                    "type": "number",
                    "description": "Buying power reserved by this order before the change, in dollars."
                  },
                  "new_reserved_bp": {
                    "type": "number",
                    "description": "Buying power reserved after the change, in dollars."
                  },
                  "released_bp": {
                    "type": "number",
                    "description": "Buying power handed back to the account by the change, in dollars."
                  },
                  "prior_quantity": {
                    "description": "Contracts before the change. Per-leg shrink path only.",
                    "type": "number"
                  },
                  "new_quantity": {
                    "description": "Contracts after the change. Per-leg shrink path only.",
                    "type": "number"
                  },
                  "prior_units": {
                    "description": "Spread units before the change. Structure path only.",
                    "type": "number"
                  },
                  "new_units": {
                    "description": "Spread units after the change. Structure path only.",
                    "type": "number"
                  },
                  "legs": {
                    "description": "The resulting legs. Structure path only.",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "occ": {
                          "type": "string",
                          "description": "The contract, as a 21-character OCC symbol."
                        },
                        "side": {
                          "type": "string",
                          "description": "`buy` or `sell` for this leg."
                        },
                        "quantity": {
                          "type": "number",
                          "description": "Contracts on this leg, always positive."
                        }
                      },
                      "required": [
                        "occ",
                        "side",
                        "quantity"
                      ]
                    }
                  }
                },
                "required": [
                  "field",
                  "reason",
                  "prior_reserved_bp",
                  "new_reserved_bp",
                  "released_bp"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "WHY the platform moved cash with no order behind it."
                  },
                  "entry_type": {
                    "type": "string",
                    "description": "The ledger entry type this adjustment was booked under."
                  },
                  "ledger_amount": {
                    "type": "number",
                    "description": "The adjustment, SIGNED: negative means cash left the account."
                  },
                  "balance_before": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Total cash before the adjustment. NULL on the FIRST adjustment an account ever sees — there is no prior entry to measure from, and a fabricated zero would be a lie. Handle the null."
                  },
                  "balance_after": {
                    "type": "number",
                    "description": "Total cash after the adjustment: settled PLUS unsettled."
                  },
                  "balance_delta": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The change in total cash. NULL on the first adjustment, for the same reason as `balance_before`."
                  },
                  "cash_after": {
                    "type": "number",
                    "description": "The SETTLED half of `balance_after`."
                  },
                  "unsettled_after": {
                    "type": "number",
                    "description": "The UNSETTLED half of `balance_after`."
                  },
                  "starting_after": {
                    "type": "number",
                    "description": "The account's starting balance after the adjustment."
                  },
                  "is_external_flow": {
                    "type": "boolean",
                    "description": "True when real money entered or left, as opposed to an internal rebooking. Exclude these when measuring trading performance."
                  },
                  "external_flow_kind": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "What kind of external movement it was. Null unless `is_external_flow` is true."
                  }
                },
                "required": [
                  "reason",
                  "entry_type",
                  "ledger_amount",
                  "balance_before",
                  "balance_after",
                  "balance_delta",
                  "cash_after",
                  "unsettled_after",
                  "starting_after",
                  "is_external_flow",
                  "external_flow_kind"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "switch_id": {
                    "type": "string",
                    "description": "The risk control that was engaged. Quote it when asking for a release."
                  },
                  "level": {
                    "type": "string",
                    "description": "WHAT WAS HALTED: `account` (this account only) or `key` (every account that API key reaches). ⚠️ `global` NEVER appears here — a global halt emits no event at all and is visible only on `GET /trader/v1/controls/kill`. Treating \"no halt event\" as \"not halted\" is wrong for exactly that case."
                  },
                  "subject_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The account id, or the key id on a key-level halt."
                  },
                  "blocks": {
                    "type": "string",
                    "description": "What the halt stops: `opens` (new risk only — you can still close) or `all`."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why the control was engaged."
                  }
                },
                "required": [
                  "switch_id",
                  "level",
                  "subject_id",
                  "blocks",
                  "reason"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "switch_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The control that was released."
                  },
                  "level": {
                    "type": "string",
                    "description": "What was released: `account` or `key`. See the note on `controls.halt_engaged`."
                  },
                  "subject_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "The account id, or the key id on a key-level release."
                  },
                  "blocks": {
                    "type": "string",
                    "description": "What the released control had been stopping."
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Why it was released. Often null — a release takes an optional reason. The event matters even without one: a release is SESSION-ONLY, and this is the only way a program learns it may trade again without discovering it by being admitted."
                  }
                },
                "required": [
                  "switch_id",
                  "level",
                  "subject_id",
                  "blocks",
                  "reason"
                ]
              }
            ],
            "description": "The payload, whose shape depends on `type` — switch on `type` to select the branch. The branches are OPEN: an event enriched with a new key stays valid, so do not reject unknown fields here."
          }
        },
        "required": [
          "id",
          "sequence",
          "type",
          "occurred_at",
          "account_id",
          "order_id",
          "client_order_id",
          "order_userref",
          "data"
        ]
      },
      "TraderKey": {
        "$id": "#/components/schemas/TraderKey",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Key id. Use it to revoke, upgrade or inspect the key."
          },
          "name": {
            "type": "string",
            "description": "Your label for this key."
          },
          "display_prefix": {
            "type": "string",
            "description": "The first few characters of the key, safe to display. The full secret is shown only once, at creation."
          },
          "environment": {
            "type": "string",
            "enum": [
              "live",
              "sandbox"
            ],
            "description": "`live` trades funded accounts; `sandbox` trades simulated ones. A key works in one environment only."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What this key may do. A call outside these scopes is refused — notably, a read-only key cannot write. The full set a key may be minted with is on `valid_scopes` when you list keys."
          },
          "account_ids": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "The accounts this key may reach. NULL means every account you own, including ones created later. A non-null list is a hard boundary: naming an account outside it is refused, not silently ignored."
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the key expires, as an RFC 3339 UTC timestamp. Null when it does not expire."
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the key was revoked. Null while it is live."
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last time this key authenticated. Null if it never has."
          },
          "last_used_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Source address of that last use."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the key was minted, as an RFC 3339 UTC timestamp."
          },
          "api_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The wire version this key was minted against. When a version is retired, every key below it is refused with 410 — upgrade the key rather than waiting to find out."
          },
          "ip_allowlist": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Source addresses this key may be used from. Null means unrestricted."
          },
          "active": {
            "type": "boolean",
            "description": "Whether the key can authenticate right now — false once it is revoked or expired."
          }
        },
        "required": [
          "id",
          "name",
          "display_prefix",
          "environment",
          "scopes",
          "account_ids",
          "expires_at",
          "revoked_at",
          "last_used_at",
          "last_used_ip",
          "created_at",
          "api_version",
          "ip_allowlist",
          "active"
        ]
      },
      "UnderlyingBarsResponse": {
        "$id": "#/components/schemas/UnderlyingBarsResponse",
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "description": "The underlying ticker these bars are for."
          },
          "interval": {
            "type": "string",
            "description": "The bar size you asked for, such as `1m` or `1d`."
          },
          "interval_s": {
            "type": "number",
            "description": "That interval in seconds, so you never have to parse the string."
          },
          "from": {
            "type": "string",
            "description": "Start of the window actually served, as an RFC 3339 UTC timestamp."
          },
          "to": {
            "type": "string",
            "description": "End of the window actually served, as an RFC 3339 UTC timestamp."
          },
          "bars": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Bar"
            },
            "description": "The bars, oldest first."
          },
          "coverage_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The earliest bar that exists for THIS series, or null when it has none. ⚠️ The archive is built from this platform's own polling, so it begins when polling began — not when the market did. An empty result before this instant is expected, not a gap in the market."
          },
          "truncated": {
            "type": "boolean",
            "description": "TRUE when the window you asked for started BEFORE the archive does, so you got less history than you requested. Check it before concluding a series has no data."
          }
        },
        "required": [
          "symbol",
          "interval",
          "interval_s",
          "from",
          "to",
          "bars",
          "coverage_from",
          "truncated"
        ]
      },
      "UnderlyingBracket": {
        "$id": "#/components/schemas/UnderlyingBracket",
        "type": "object",
        "properties": {
          "underlying_prev_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time of the last underlying observation BEFORE this quote, in ms since Eastern midnight."
          },
          "underlying_prev_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "That underlying price, in dollars × 10,000."
          },
          "underlying_next_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time of the first underlying observation AFTER this quote, in ms since Eastern midnight."
          },
          "underlying_next_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "That underlying price, in dollars × 10,000."
          },
          "underlying_prev_age_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How old the previous observation was. Published for convenience — ⚠️ it is NOT an error bound. At identical 50-59s staleness the p90 underlying move was $0.20 on a quiet day and $1.90 on a volatile one, 9.5x apart. Use `underlying_bracket_1e4`, which is what the price actually did."
          },
          "underlying_bracket_1e4": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How far the underlying actually MOVED across the bracket, in dollars × 10,000. This is the real uncertainty on the spot price at this quote. All bracket fields are NULL when no same-session observation precedes the quote — deliberately, because carrying Friday's close into Monday's open would present a 65-hour-old price as spot."
          }
        }
      },
      "UpgradeKeyResponse": {
        "$id": "#/components/schemas/UpgradeKeyResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The key that was upgraded."
          },
          "api_version": {
            "type": "string",
            "description": "The wire version it now targets."
          }
        },
        "required": [
          "id",
          "api_version"
        ]
      },
      "WebhookAttempt": {
        "$id": "#/components/schemas/WebhookAttempt",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Opaque, monotonic, and the cursor for `after`. A STRING: it is an int8."
          },
          "requested_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the delivery was attempted."
          },
          "status_code": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "The HTTP status your endpoint returned. NULL when the request never got one — a timeout, a DNS failure, a refused connection. Read `error_kind` for which."
          },
          "error_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why it failed, when it did: the transport-level reason rather than your response body. NULL on success."
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "How long your endpoint took. A climbing figure is the usual warning before timeouts start."
          },
          "event_count": {
            "type": "number",
            "description": "How many events were in this batch."
          },
          "delivered": {
            "type": "boolean",
            "description": "TRUE for a 2xx. Anything else — including a timeout — is false."
          }
        },
        "required": [
          "id",
          "requested_at",
          "status_code",
          "error_kind",
          "duration_ms",
          "event_count",
          "delivered"
        ]
      },
      "WebhookDelivery": {
        "$id": "#/components/schemas/WebhookDelivery",
        "type": "object",
        "properties": {
          "api_version": {
            "type": "string",
            "description": "The payload version this endpoint was created with. Frozen for the life of the endpoint, so your handler keeps parsing the same shape."
          },
          "batch_id": {
            "type": "string",
            "description": "Identifies this delivery ATTEMPT. ⚠️ NOT an idempotency key — a retry mints a FRESH batch_id, so a receiver deduping on it would re-execute every event in the batch. Dedupe on `events[].id`."
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraderEvent"
            },
            "description": "The events in this batch, oldest first."
          }
        },
        "required": [
          "api_version",
          "batch_id",
          "events"
        ]
      },
      "WebhookEndpoint": {
        "$id": "#/components/schemas/WebhookEndpoint",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Endpoint id. Use it to update, rotate or delete this endpoint."
          },
          "api_key_id": {
            "type": "string",
            "description": "The API key this endpoint belongs to. Deliveries carry only events that key can see."
          },
          "url": {
            "type": "string",
            "description": "Where deliveries are POSTed. Must be HTTPS."
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your own label for this endpoint."
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled",
              "suspended"
            ],
            "description": "`enabled` delivers. `disabled` is off because you turned it off. `suspended` is off because WE turned it off after repeated failures — see `suspended_reason` and `consecutive_failures`, and re-enable it once your receiver is healthy."
          },
          "api_version": {
            "type": "string",
            "description": "The payload version frozen at create time. Deliveries keep this shape for the life of the endpoint, so adding a field to the API never reshapes what your existing receiver is parsing."
          },
          "event_types": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Which event types this endpoint receives. Null means every type in the catalogue, including types added later."
          },
          "cursor_updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When this endpoint last advanced its delivery position, as an RFC 3339 UTC timestamp."
          },
          "consecutive_failures": {
            "type": "number",
            "description": "Failed deliveries in a row. Resets to 0 on any success. Enough of them suspend the endpoint."
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last successful delivery, as an RFC 3339 UTC timestamp."
          },
          "last_failure_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last failed delivery, as an RFC 3339 UTC timestamp."
          },
          "suspended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When we suspended this endpoint. Null unless `status` is `suspended`."
          },
          "suspended_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why we suspended it. Null unless `status` is `suspended`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the endpoint was created, as an RFC 3339 UTC timestamp."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was last changed, as an RFC 3339 UTC timestamp."
          }
        },
        "required": [
          "id",
          "api_key_id",
          "url",
          "description",
          "status",
          "api_version",
          "event_types",
          "cursor_updated_at",
          "consecutive_failures",
          "last_success_at",
          "last_failure_at",
          "suspended_at",
          "suspended_reason",
          "created_at",
          "updated_at"
        ]
      },
      "WebhookHealthResponse": {
        "$id": "#/components/schemas/WebhookHealthResponse",
        "type": "object",
        "properties": {
          "endpoint_id": {
            "type": "string",
            "description": "The endpoint this history belongs to."
          },
          "delivering": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "The one-line answer: TRUE when the MOST RECENT attempt delivered. NULL when the endpoint has never been tried — which is not the same as failing."
          },
          "last_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When delivery was last attempted at all."
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When it last succeeded. Compare with `last_attempt_at`: equal means healthy, far apart means it has been failing since then."
          },
          "consecutive_failures": {
            "type": "number",
            "description": "Failures in a row since the last success; 0 while healthy. Computed over the WHOLE history, not the page you asked for — the number describes the endpoint, not the request. This is the figure to alert on: one failure is a blip, forty is an endpoint that is down."
          },
          "attempts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookAttempt"
            },
            "description": "Newest first."
          },
          "next_after": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pass as `after` for the next (older) page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists."
          }
        },
        "required": [
          "endpoint_id",
          "delivering",
          "last_attempt_at",
          "last_success_at",
          "consecutive_failures",
          "attempts",
          "next_after",
          "has_more"
        ]
      },
      "WebhookListResponse": {
        "$id": "#/components/schemas/WebhookListResponse",
        "type": "object",
        "properties": {
          "endpoints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpoint"
            },
            "description": "Every webhook endpoint on this API key."
          }
        },
        "required": [
          "endpoints"
        ]
      },
      "PlaceOrderRequest": {
        "type": "object",
        "properties": {
          "order_type": {
            "type": "string",
            "enum": [
              "market",
              "limit",
              "stop",
              "stop_limit",
              "trailing_stop"
            ],
            "description": "How this order prices and triggers. `limit` and `stop_limit` require `limit_price`; `stop` and `stop_limit` require `stop_price`; `trailing_stop` requires one of `trail_amount` or `trail_percent`."
          },
          "legs": {
            "minItems": 1,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "sell"
                  ],
                  "description": "Direction of this leg: `buy` or `sell`. This says which way you trade, NOT whether the leg opens or closes — use `position_intent` for that."
                },
                "occ": {
                  "type": "string",
                  "minLength": 6,
                  "maxLength": 32,
                  "description": "The contract, as an OCC symbol with NO padding: the root, then the expiration as YYMMDD, then `C` or `P`, then the strike in thousandths of a dollar zero-padded to 8 digits. `SPY251219C00600000` is the SPY 19 Dec 2025 600 call and `SPXW261218C05000000` the SPXW 18 Dec 2026 5000 call. Send it exactly so. A symbol not written this way is refused `ORDER_INSTRUMENT_MALFORMED`, whose `detail.canonical_form` gives the spelling to send when one can be derived, and a spelling given there is always one this API accepts. A symbol on an adjusted or non-standard root (the shape a corporate action leaves behind) is refused `ORDER_INSTRUMENT_NOT_PLACEABLE` instead, whether or not it was spelled correctly: no respelling makes such a contract orderable here."
                },
                "quantity": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 10000,
                  "description": "Contracts on this leg. A positive whole number — `side` carries the direction, so never send a negative quantity to mean a sell."
                },
                "position_intent": {
                  "description": "Whether THIS leg opens or closes, declared per leg because a roll is per-leg by nature. ⚠️ ALL LEGS OR NONE: declare it on every leg or on none. Declaring it on some legs only is refused — a partly-declared order is the worst of both, because you believe you asserted something about the whole structure while only some legs were checked. Omit it entirely and the engine classifies the order itself, as it always has.",
                  "type": "string",
                  "enum": [
                    "buy_to_open",
                    "buy_to_close",
                    "sell_to_open",
                    "sell_to_close"
                  ]
                }
              },
              "required": [
                "side",
                "occ",
                "quantity"
              ],
              "additionalProperties": false
            },
            "description": "The contracts to trade — 1 leg for a single option, up to 4 for a spread. All legs fill together or not at all."
          },
          "time_in_force": {
            "default": "day",
            "description": "`day` (the default) is cancelled at the close if it has not filled; `gtc` rests until it fills or you cancel it. ⚠️ Defaults to `day` when omitted — an order you meant to rest overnight will be cancelled at the close unless you say `gtc`.",
            "type": "string",
            "enum": [
              "day",
              "gtc"
            ]
          },
          "limit_price": {
            "description": "Your limit as a SIGNED NET price for the whole structure: negative = debit (you pay), positive = credit (you receive). The fill rule is `net_price >= limit_price` on that signed value. ⚠️ Zero is refused, not read as \"any price\". On a sell, `0` would fill at any price the book offers; on a buy it could never fill and would hold buying power forever. Required for `limit` and `stop_limit`.",
            "type": "number"
          },
          "stop_price": {
            "description": "The stop trigger, as a premium per contract. Must be a real price — zero and sub-tick values are refused, because a stop the matcher can never trigger reads as protection while providing none. Required for `stop` and `stop_limit`.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "trail_amount": {
            "description": "Trail by a fixed DOLLAR distance. Give this or `trail_percent` on a `trailing_stop`, never both.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "trail_percent": {
            "description": "Trail by a FRACTION of the anchor price: `0.03` means 3%. Maximum 1 (100%). ⚠️ A fraction, not a whole-number percent — sending `3` here is refused rather than read as 3%. Give this or `trail_amount`, never both.",
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1
          },
          "trail_anchor": {
            "description": "What the stop trails: the OPTION premium (the default) or the UNDERLYING price. Changes what `trail_amount` and `trail_percent` are measured against.",
            "type": "string",
            "enum": [
              "option",
              "underlying"
            ]
          },
          "trail_amount_underlying": {
            "description": "Trail by a fixed dollar distance on the UNDERLYING, for a stop anchored to it.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "underlying_trigger_price": {
            "description": "Hold this order DORMANT until the underlying reaches this level. ⚠️ While armed, the order cannot fill at any price and the matcher does not consider it — yet it reads `status: \"pending\"`, identical to a working order. Do not count an armed order as live protection.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "underlying_trigger_direction": {
            "description": "Which way the underlying must cross `underlying_trigger_price` to arm this order. REQUIRED whenever that price is set. `above` arms when the underlying rises THROUGH the level; `below` when it falls through it. This is not derivable from the price alone — the same level is a breakout for one strategy and a breakdown for another — so the API will not guess.",
            "type": "string",
            "enum": [
              "above",
              "below"
            ]
          },
          "intent": {
            "type": "string",
            "enum": [
              "open",
              "close",
              "roll"
            ],
            "description": "DECLARED, not inferred: whether this order opens exposure, closes it, or ROLLS — closing one contract and opening another in a SINGLE ticket, priced as one net debit or credit. Required on every placement.\n\n⚠️ A `roll` MUST NAME ITS LEGS. At least one leg needs a closing `position_intent` (`buy_to_close` / `sell_to_close`) and at least one an opening one, or the order is refused ORDER_NOT_A_ROLL — otherwise `roll` would just be a second spelling of `open`, and the per-leg declarations are what let the engine VERIFY the roll against your real inventory instead of taking your word for it.\n\nLegging a roll as two orders instead costs you the price movement between them, loses the net-debit pricing that is the entire reason a roll is one ticket, books a spurious realized round trip, and reaches your copy followers as two unrelated orders.\n\nThe response reports the engine's RESOLVED intent, which is `open` for a roll (any leg that opens or adds makes the order an open), and which adds a value (`reduce_only`) for protective and system exits. A key holding only `write:orders:close_only` may NOT roll: a roll opens exposure."
          },
          "client_order_id": {
            "description": "YOUR handle for this order. UNIQUE PER USER — which is what makes it a safe retry anchor: resend the same handle after a timeout and you get your ORIGINAL order back instead of a second fill. Strongly recommended on every placement.",
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "preferred_lifecycle_id": {
            "description": "WHICH STRUCTURE a closing leg draws from, when the contract you are closing is held by more than one — a leg held standalone AND as part of a combo, or two combos sharing a wing. Take the id from `lifecycle_ids` on the position. Omitting it keeps the default behaviour, in which the engine allocates against the oldest matching structure — which has attributed a spread's stop to an unrelated condor that merely shared a wing. Naming a lifecycle that holds no leg this order closes is REFUSED rather than ignored: a hint quietly dropped is worse than no hint, because you believe you chose.",
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "order_userref": {
            "description": "YOUR run label — \"these forty orders are one algorithm run\". ⚠️ NOT `client_order_id`. That one is UNIQUE and is your retry anchor; this one is deliberately SHARED by many orders, which is what makes a run addressable as a run via `GET /trader/v1/orders?order_userref=`. Send your run tag as a dedupe key and your second order is refused as a replay of your first. Recorded and echoed back, never trusted and never authoritative — it is your label, not attribution we vouch for. Order-level, not per-leg, max 128 characters. It rides into the idempotency fingerprint, so the same key resent under a different label is a different instruction and is refused as a reuse.",
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "idempotency_key": {
            "description": "Your idempotency key, as an alternative to the `Idempotency-Key` header — send exactly one of the two. Required on every placement: omitting both is refused with `IDEMPOTENCY_KEY_REQUIRED`. Resending the identical body under the same key returns the original response instead of placing a second order; resending a DIFFERENT body under the same key is refused as a reuse.",
            "type": "string",
            "pattern": "^[A-Za-z0-9._:-]{8,128}$"
          }
        },
        "required": [
          "order_type",
          "legs",
          "intent"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "order_type": "limit",
            "time_in_force": "day",
            "intent": "open",
            "limit_price": -1.25,
            "legs": [
              {
                "side": "buy",
                "occ": "SPY261218C00700000",
                "quantity": 1,
                "position_intent": "buy_to_open"
              }
            ]
          },
          {
            "order_type": "limit",
            "time_in_force": "day",
            "intent": "open",
            "limit_price": 0.85,
            "client_order_id": "my-strategy-0001",
            "order_userref": "morning-run-2026-09-03",
            "legs": [
              {
                "side": "sell",
                "occ": "SPY261218P00600000",
                "quantity": 1,
                "position_intent": "sell_to_open"
              },
              {
                "side": "buy",
                "occ": "SPY261218P00590000",
                "quantity": 1,
                "position_intent": "buy_to_open"
              }
            ]
          }
        ]
      },
      "FollowLeaderRequest": {
        "type": "object",
        "properties": {
          "leader_account_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The account whose fills are mirrored onto this one. Must have the SAME OWNER and must have opted in — see `is_leader` on the accounts listing, which is how you find the eligible ones in a single call."
          },
          "multiplier": {
            "default": 1,
            "description": "Scales every mirrored quantity: `0.5` halves the leader's size, `2` doubles it. Greater than 0 and at most 100. Defaults to 1 (match the leader exactly).",
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 100
          }
        },
        "required": [
          "leader_account_id"
        ],
        "additionalProperties": false
      },
      "ResizeCopyLinkRequest": {
        "type": "object",
        "properties": {
          "multiplier": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 100,
            "description": "The new size factor for FUTURE mirrors. Bounds are the engine’s own (greater than 0, at most 100), matching the database CHECK, so a value this accepts is never one the engine refuses."
          }
        },
        "required": [
          "multiplier"
        ],
        "additionalProperties": false
      },
      "SetCopyLeaderRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "TRUE — this account may be followed. Refused with `COPY_CANNOT_LEAD` while it is itself following, archived, or failed. FALSE — stop leading. ⚠️ This DETACHES every follower and cancels their pending mirrors, and setting it back to true does NOT reverse that — the followers are gone and must re-follow. A required boolean rather than a toggle, so a retry after a timeout lands on the state you asked for instead of the opposite one."
          }
        },
        "required": [
          "enabled"
        ],
        "additionalProperties": false
      },
      "ModifyOrderRequest": {
        "type": "object",
        "properties": {
          "limit_price": {
            "description": "New SIGNED net limit for the structure: negative = debit, positive = credit. Zero is refused.",
            "type": "number"
          },
          "stop_price": {
            "description": "New stop price, as a premium per contract. Zero is refused.",
            "type": "number"
          },
          "trail_amount": {
            "description": "New trailing distance in DOLLARS.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "trail_percent": {
            "description": "New trailing distance as a FRACTION: `0.03` means 3%. Maximum 1. Not a whole-number percent.",
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1
          },
          "trail_amount_underlying": {
            "description": "New trailing distance in dollars on the UNDERLYING.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "quantity": {
            "description": "New contract quantity. On a bracket entry this CASCADES to the protective children so they stay in lockstep — the response lists them under `also_modified`.",
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 10000
          },
          "underlying_trigger_price": {
            "description": "Arm, re-arm, or clear an underlying trigger. A number arms the order at that spot level and makes it DORMANT until the underlying crosses; explicit `null` CLEARS an existing trigger and returns the order to working. Omit the field to leave the trigger as it is — null and absent mean different things here.",
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "underlying_trigger_direction": {
            "description": "Which way the underlying must cross `underlying_trigger_price`. REQUIRED whenever that price is a number. Omit it when clearing the trigger with `null`, and omit it when leaving the trigger alone — a direction with no price has nothing to point at and is refused.",
            "type": "string",
            "enum": [
              "above",
              "below"
            ]
          }
        },
        "additionalProperties": false,
        "examples": [
          {
            "limit_price": -1.1
          },
          {
            "quantity": 2,
            "limit_price": -1.05
          }
        ]
      },
      "PlaceBracketRequest": {
        "type": "object",
        "properties": {
          "legs": {
            "minItems": 1,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "sell"
                  ],
                  "description": "Direction of this leg of the ENTRY."
                },
                "occ": {
                  "type": "string",
                  "minLength": 6,
                  "maxLength": 32,
                  "description": "The contract, as an OCC symbol with no padding, such as `SPY251219C00600000`. A symbol not written that way is refused exactly as on POST /orders."
                },
                "quantity": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 10000,
                  "description": "Contracts on this leg, a positive whole number."
                }
              },
              "required": [
                "side",
                "occ",
                "quantity"
              ],
              "additionalProperties": false
            },
            "description": "The contracts the ENTRY trades — 1 leg for a single option, up to 4 for a spread."
          },
          "order_type": {
            "type": "string",
            "enum": [
              "market",
              "limit"
            ],
            "description": "How the ENTRY prices: `market` or `limit`. Narrower than a plain placement on purpose — a bracket entry cannot itself be a stop. `limit` requires `limit_price`."
          },
          "limit_price": {
            "description": "The ENTRY's limit, as a SIGNED net price: negative = debit, positive = credit. Zero is refused. Required when `order_type` is `limit`.",
            "type": "number"
          },
          "stop_price": {
            "description": "Where the protective STOP sits. Give at least one of `stop_price` or `target_price` — a bracket with neither protects nothing. Zero and sub-tick values are refused: a stop the matcher can never trigger reads as protection while providing none.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "target_price": {
            "description": "Where the profit TARGET sits. Give at least one of `stop_price` or `target_price`. Zero and sub-tick values are refused.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "bracket_levels": {
            "description": "Scale out in stages: one stop/target pair per level, each covering part of the position. Up to 8 levels. Level quantities are SPREAD UNITS and must sum to the entry’s spread count (one contract per unit on a single-leg entry). Levels are accepted on single-leg entries and, where the platform has enabled multi-leg levels, on spreads too — each level then closes the whole structure at its share, so a 2-lot butterfly with levels 1 + 1 gets two 1/2/1 pairs. Where multi-leg levels are not yet enabled, a spread with `bracket_levels` is refused with `Multi-level brackets are single-leg only.`; send one `stop_price`/`target_price` pair instead. Levels cannot be combined with underlying-spot triggers. ⚠️ When you send this, read `bracket_levels` on the response, NOT `protection` — that block describes level 0 only, and reading it alone would show one pair and look like all your protection.",
            "minItems": 1,
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "quantity": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 10000,
                  "description": "How much of the position THIS level protects, in SPREAD UNITS. On a single-leg entry a spread unit is one contract, so this is a contract count. On a multi-leg entry it is one spread: the greatest common divisor of the leg quantities, so a butterfly sent as 2/4/2 has a spread count of 2 and its levels are sized 1 and 1, never 4 and 4. Levels together must equal the entry’s spread count exactly."
                },
                "stop_price": {
                  "description": "The stop for this level, as a POSITIVE premium. Each level needs a stop, a target, or both.",
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "target_price": {
                  "description": "The target for this level, as a POSITIVE premium. Within a level the two must differ.",
                  "type": "number",
                  "exclusiveMinimum": 0
                }
              },
              "required": [
                "quantity"
              ],
              "additionalProperties": false
            }
          },
          "intent": {
            "type": "string",
            "const": "open",
            "description": "Always `open` — a bracket opens a position. Declared rather than inferred, so sending `close` gets you a precise `ORDER_INTENT_MISMATCH` instead of a confusing refusal from a guard you did not know about."
          },
          "client_order_id": {
            "description": "YOUR handle, recorded on the ENTRY order. Unique per user, which is what makes it a safe retry anchor. It is NOT copied onto the protective children — it could not be, since uniqueness would refuse the copy and fail the whole placement. Reach the children through `parent_order_id` instead.",
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "order_userref": {
            "description": "YOUR run label, recorded on the ENTRY order. ⚠️ NOT `client_order_id`: that one is unique and is your retry anchor, this one is deliberately shared across a run. What this route guarantees is the ENTRY; read the children back rather than assuming they carry it. Either way the whole bracket is reachable — the children hang off the entry by `parent_order_id`, and the run filter finds the entry.",
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "idempotency_key": {
            "description": "Your idempotency key, as an alternative to the `Idempotency-Key` header — send exactly one of the two. Required: omitting both is refused with `IDEMPOTENCY_KEY_REQUIRED`.",
            "type": "string",
            "pattern": "^[A-Za-z0-9._:-]{8,128}$"
          }
        },
        "required": [
          "legs",
          "order_type",
          "intent"
        ],
        "additionalProperties": false
      },
      "ProtectRequest": {
        "type": "object",
        "properties": {
          "quantity": {
            "description": "How much to protect: SPREAD UNITS when `lifecycle_id` names a multi-leg structure, CONTRACTS otherwise. The response's `quantity_unit` says which was used, so you never have to guess. Whole numbers only. ⚠️ OMITTING IT IS NOT THE SAFE DEFAULT. The engine then protects the FULL position, so on a leg that is already partly protected a second call is refused with `PROTECT_STOP_OVER_CAPACITY` rather than protecting whatever is left. State the quantity when adding to existing protection.",
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 10000
          },
          "stop_price": {
            "description": "Where the STOP sits. Give at least one of `stop_price` or `target_price`. By default this is an option premium per contract — set `stop_underlying` to quote it against the underlying instead. Zero and sub-tick values are refused.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "target_price": {
            "description": "Where the TARGET sits. Give at least one of `stop_price` or `target_price`, and the two must differ. Zero and sub-tick values are refused.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "stop_underlying": {
            "description": "Treat `stop_price` as an UNDERLYING spot level rather than an option premium. Requires `stop_price`.",
            "type": "boolean"
          },
          "target_underlying": {
            "description": "Treat `target_price` as an UNDERLYING spot level rather than an option premium. Requires `target_price`.",
            "type": "boolean"
          },
          "lifecycle_id": {
            "description": "Protect the whole STRUCTURE this leg belongs to, as one OCO bracket. Take the id from `lifecycle_ids` on the position. ⚠️ NOT `group_id` — that is the opening-order id, and the two never match.",
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "idempotency_key": {
            "description": "Your idempotency key, as an alternative to the `Idempotency-Key` header — send exactly one of the two.",
            "type": "string",
            "pattern": "^[A-Za-z0-9._:-]{8,128}$"
          }
        },
        "additionalProperties": false
      },
      "ClosePositionRequest": {
        "type": "object",
        "properties": {
          "order_type": {
            "type": "string",
            "enum": [
              "market",
              "limit"
            ],
            "description": "How this close is priced. REQUIRED, with NO DEFAULT, deliberately: a default of `market` would make the dangerous choice the silent one. This platform has filled protective legs at $0.0000 against a live ask on a one-sided book, so a program closing at 03:00 either states what it will accept or states that it will accept anything — but it states it."
          },
          "limit_price": {
            "description": "NET price for the whole close, SIGNED exactly as on a placement: negative = debit (you pay to close a short), positive = credit (you receive). REQUIRED for `limit`, and REFUSED for `market` — a price on a market order means the caller believes something untrue about what they sent.",
            "type": "number"
          },
          "idempotency_key": {
            "description": "Your idempotency key, as an alternative to the `Idempotency-Key` header — send exactly one of the two. Resending the identical body under the same key returns the original close rather than placing a second one.",
            "type": "string",
            "pattern": "^[A-Za-z0-9._:-]{8,128}$"
          },
          "quantity": {
            "description": "How many contracts to close. Omitting it closes the WHOLE position — or, when `lifecycle_id` names a structure, that lifecycle's own remaining quantity rather than the netted inventory total, which may include contracts belonging to OTHER open structures sharing the same contract.",
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 10000
          },
          "lifecycle_id": {
            "description": "WHICH structure this close draws from, when the contract is held by more than one. Take the id from `lifecycle_ids` on the position. It also caps the quantity — see `quantity`.",
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "allow_partial_structure": {
            "description": "Set true to close ONE LEG of a multi-leg structure on purpose. Without it that close is refused with `CLOSE_LEG_OF_STRUCTURE`, because removing one leg of a spread can leave another leg a naked short and causes the structure’s protective orders to be pruned or cancelled. Legging out is a legitimate trade — it just has to be said, the same way `order_type` has no default here. To close the whole structure instead, use `POST /trader/v1/lifecycles/{lifecycle_id}/close`.",
            "type": "boolean"
          }
        },
        "required": [
          "order_type"
        ],
        "additionalProperties": false
      },
      "CloseLifecycleRequest": {
        "type": "object",
        "properties": {
          "order_type": {
            "type": "string",
            "enum": [
              "market",
              "limit"
            ],
            "description": "How this close is priced. REQUIRED, with NO DEFAULT, deliberately: a default of `market` would make the dangerous choice the silent one. This platform has filled protective legs at $0.0000 against a live ask on a one-sided book, so a program closing at 03:00 either states what it will accept or states that it will accept anything — but it states it."
          },
          "limit_price": {
            "description": "NET price for the whole close, SIGNED exactly as on a placement: negative = debit (you pay to close a short), positive = credit (you receive). REQUIRED for `limit`, and REFUSED for `market` — a price on a market order means the caller believes something untrue about what they sent.",
            "type": "number"
          },
          "idempotency_key": {
            "description": "Your idempotency key, as an alternative to the `Idempotency-Key` header — send exactly one of the two. Resending the identical body under the same key returns the original close rather than placing a second one.",
            "type": "string",
            "pattern": "^[A-Za-z0-9._:-]{8,128}$"
          }
        },
        "required": [
          "order_type"
        ],
        "additionalProperties": false
      },
      "CreateKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Your label for the key. Shown in listings."
          },
          "environment": {
            "default": "sandbox",
            "description": "Which environment the key trades. Defaults to `sandbox` — you must ask for `live` explicitly, so a key never becomes live by omission.",
            "type": "string",
            "enum": [
              "live",
              "sandbox"
            ]
          },
          "scopes": {
            "default": [],
            "description": "What this key may do. Defaults to EMPTY, which grants nothing — name the scopes you need. The full set is on `valid_scopes` when you list keys.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "account_ids": {
            "description": "Bind the key to specific accounts. Omit or leave empty for every account you own, including ones created later. A binding can be narrowed afterwards but never widened.",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "expires_at": {
            "description": "When the key should stop working, as an RFC 3339 UTC timestamp. Recommended but not required — a key with no expiry is a key forever.",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "ip_allowlist": {
            "description": "Source addresses this key may be used from. Omit for unrestricted. Each entry is an address or a CIDR block, so an egress RANGE is expressible rather than only fixed hosts.",
            "minItems": 1,
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 64
            }
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "PatchKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "description": "A new label for the key.",
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "scopes": {
            "description": "Narrow what this key may do. It may grant no authority the key does not already hold — a live key can never gain authority, so widening is refused rather than applied. Narrowing is measured in authority, not in strings: a key holding `write:orders` may be demoted to `write:orders:close_only`, while the reverse is refused and `write:orders:close_only` cannot be added to a key holding no write grant.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "account_ids": {
            "description": "Narrow which accounts this key may reach. May only NARROW: adding an account, or unbinding entirely, is refused. Mint a new key if you need broader reach.",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "expires_at": {
            "description": "Bring the expiry FORWARD, as an RFC 3339 UTC timestamp. It can never be extended, and never set on an already-expired key — expiry is one-way.",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "ip_allowlist": {
            "description": "Add or narrow the source addresses this key works from. May only be ADDED or NARROWED — removing the list, or adding an address to an existing one, widens where a live secret works and is refused, the same rule as scopes and account bindings.",
            "minItems": 1,
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 64
            }
          }
        },
        "additionalProperties": false
      },
      "BulkPlaceOrdersRequest": {
        "type": "object",
        "required": [
          "orders"
        ],
        "additionalProperties": false,
        "properties": {
          "orders": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "description": "Each entry is a PlaceOrderRequest plus its own required idempotency_key.",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/PlaceOrderRequest"
                },
                {
                  "type": "object",
                  "required": [
                    "idempotency_key"
                  ],
                  "properties": {
                    "idempotency_key": {
                      "type": "string",
                      "minLength": 8,
                      "maxLength": 128,
                      "description": "REQUIRED on every batch item, and unique per item. A batch has no `Idempotency-Key` header to fall back on — the header addresses one request, and a batch is many orders — so the key lives on the item. Replaying the batch replays each item under its own key, so a partially applied batch converges instead of double-placing the entries that did land."
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "CreateSubscriptionRequest": {
        "type": "object",
        "properties": {
          "symbols": {
            "minItems": 1,
            "maxItems": 25,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 12
            },
            "description": "The underlying tickers to pin, 1 to 25 of them. Each is 1–12 characters. The cap counts what you ALREADY hold, so going over is refused with `DEMAND_LIMIT_EXCEEDED` rather than truncated."
          }
        },
        "required": [
          "symbols"
        ],
        "additionalProperties": false
      },
      "CreateWebhookRequest": {
        "type": "object",
        "properties": {
          "api_key_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
            "description": "The API key this endpoint belongs to. It will receive only the events that key can see."
          },
          "url": {
            "type": "string",
            "description": "Where to POST deliveries. Must be HTTPS."
          },
          "description": {
            "description": "Your own label for this endpoint.",
            "type": "string",
            "maxLength": 500
          },
          "event_types": {
            "description": "Which event types to deliver. NULL means EVERY type in the catalogue, including types added later. A list must name at least one, and every member must be a published type — a misspelled type is refused rather than silently never matching.",
            "anyOf": [
              {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "api_key_id",
          "url"
        ],
        "additionalProperties": false
      },
      "PatchWebhookRequest": {
        "type": "object",
        "properties": {
          "url": {
            "description": "A new delivery URL. Must be HTTPS.",
            "type": "string"
          },
          "description": {
            "description": "A new label, or explicit null to clear it.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "event_types": {
            "description": "Which event types to deliver. NULL means EVERY type in the catalogue, including types added later. A list must name at least one, and every member must be a published type — a misspelled type is refused rather than silently never matching.",
            "anyOf": [
              {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "description": "Turn delivery on or off. Note you cannot set `suspended` — that is ours, applied after repeated failures; setting `enabled` is how you resume once your receiver is healthy.",
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          }
        },
        "additionalProperties": false
      },
      "EngageHaltRequest": {
        "type": "object",
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "account",
              "key"
            ],
            "description": "What to halt: `account` stops one account, `key` stops every account that API key reaches."
          },
          "subject_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The account or key to halt. Ownership is verified server-side — you cannot halt something you do not own by naming it here."
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Why you are halting. REQUIRED: a halt with no reason is one nobody can safely release later."
          }
        },
        "required": [
          "level",
          "subject_id",
          "reason"
        ],
        "additionalProperties": false
      },
      "ReleaseHaltRequest": {
        "type": "object",
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "account",
              "key"
            ],
            "description": "Which kind of halt to release: `account` or `key`."
          },
          "subject_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "The account or key to release."
          },
          "reason": {
            "description": "Why you are releasing it. Optional.",
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "level",
          "subject_id"
        ],
        "additionalProperties": false
      },
      "CancelAllRequest": {
        "type": "object",
        "properties": {
          "account_id": {
            "description": "Restrict the cancel to ONE account. Omit to cover every account this credential reaches.",
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "symbol": {
            "description": "Restrict the cancel to one underlying. Omit to cover every symbol.",
            "type": "string",
            "minLength": 1,
            "maxLength": 16
          },
          "api_key_id": {
            "description": "Restrict the cancel to orders placed by ONE credential — the \"stop just this strategy, leave the others working\" case.",
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "x-scopes": [
    "read:account",
    "read:positions",
    "read:orders",
    "read:marketdata",
    "write:orders",
    "write:orders:close_only",
    "subscribe:events",
    "subscribe:marketdata",
    "write:copy"
  ],
  "x-error-catalogue": [
    {
      "code": "NOT_AUTHENTICATED",
      "retry": "never",
      "http_status": 401
    },
    {
      "code": "INVALID_API_KEY",
      "retry": "never",
      "http_status": 401
    },
    {
      "code": "MISSING_SCOPE",
      "retry": "never",
      "http_status": 403
    },
    {
      "code": "KEY_NOT_PERMITTED",
      "retry": "never",
      "http_status": 403
    },
    {
      "code": "ROUTE_NOT_DECLARED",
      "retry": "never"
    },
    {
      "code": "ACCOUNT_NOT_FOUND",
      "retry": "never",
      "http_status": 404,
      "example_message": "This account could not be found, so nothing was placed or filled. Reload the page and pick the account again; if it keeps happening, contact support."
    },
    {
      "code": "KEY_NOT_FOUND",
      "retry": "never",
      "http_status": 404
    },
    {
      "code": "INVALID_REQUEST",
      "retry": "never",
      "http_status": 400
    },
    {
      "code": "UNSUPPORTED_MEDIA_TYPE",
      "retry": "never"
    },
    {
      "code": "PAYLOAD_TOO_LARGE",
      "retry": "never"
    },
    {
      "code": "PROTOCOL",
      "retry": "never"
    },
    {
      "code": "INVALID_SCOPE",
      "retry": "never",
      "http_statuses": [
        400,
        403
      ]
    },
    {
      "code": "IDEMPOTENCY_KEY_REQUIRED",
      "retry": "never"
    },
    {
      "code": "IDEMPOTENCY_KEY_INVALID",
      "retry": "never"
    },
    {
      "code": "IDEMPOTENCY_KEY_REUSED",
      "retry": "never",
      "http_status": 422
    },
    {
      "code": "IDEMPOTENCY_IN_FLIGHT",
      "retry": "backoff",
      "http_status": 409
    },
    {
      "code": "IDEMPOTENT_REPLAY_OF_REFUSAL",
      "retry": "never",
      "http_status": 409
    },
    {
      "code": "RATE_LIMITED",
      "retry": "backoff"
    },
    {
      "code": "IDEMPOTENCY_KEY_EXPIRED",
      "retry": "never"
    },
    {
      "code": "TRADER_API_DISABLED",
      "retry": "backoff",
      "http_status": 503
    },
    {
      "code": "STALE_DATA",
      "retry": "backoff"
    },
    {
      "code": "SYMBOL_NOT_FOUND",
      "retry": "never",
      "http_status": 404
    },
    {
      "code": "BATCH_TOO_LARGE",
      "retry": "never",
      "http_status": 400
    },
    {
      "code": "UNDERLYING_UNAVAILABLE",
      "retry": "backoff",
      "http_status": 503
    },
    {
      "code": "DEMAND_REGISTRATION_DISABLED",
      "retry": "backoff",
      "http_status": 503
    },
    {
      "code": "DEMAND_LIMIT_EXCEEDED",
      "retry": "never",
      "http_status": 400
    },
    {
      "code": "MARKETDATA_DISABLED",
      "retry": "backoff",
      "http_status": 503
    },
    {
      "code": "MARKETDATA_NOT_ENTITLED",
      "retry": "never",
      "http_status": 402
    },
    {
      "code": "MARGIN_UNAVAILABLE",
      "retry": "backoff",
      "http_status": 503
    },
    {
      "code": "ORDER_NOT_A_ROLL",
      "retry": "never"
    },
    {
      "code": "HISTORY_COVERAGE_INCOMPLETE",
      "retry": "never",
      "http_status": 409
    },
    {
      "code": "HISTORY_BUSY",
      "retry": "backoff",
      "http_status": 503
    },
    {
      "code": "INVALID_CURSOR",
      "retry": "never",
      "http_status": 400
    },
    {
      "code": "ACCOUNT_ADDRESS_CONFLICT",
      "retry": "never",
      "http_status": 400
    },
    {
      "code": "UNSUPPORTED_API_VERSION",
      "retry": "never",
      "http_status": 410
    },
    {
      "code": "IP_NOT_ALLOWED",
      "retry": "never",
      "http_status": 403
    },
    {
      "code": "ORDER_MARKET_CLOSED",
      "retry": "backoff",
      "http_status": 400,
      "example_message": "The market is closed for the day. Orders will be accepted again from 9:30 AM Eastern.",
      "detail_keys": [
        "reason",
        "session",
        "symbol"
      ]
    },
    {
      "code": "ORDER_NO_QUOTES",
      "retry": "backoff",
      "http_status": 400,
      "example_message": "No live market data is available for this contract. It may be expired, delisted, or the chain has not loaded yet. Try again in a moment.",
      "detail_keys": [
        "option_symbol"
      ]
    },
    {
      "code": "ORDER_INSUFFICIENT_FUNDS",
      "retry": "backoff",
      "http_status": 400,
      "example_message": "This order needs more buying power than the account has available. Reduce the size, or close a position or cancel a working order to free some up.",
      "detail_keys": [
        "available",
        "commission",
        "required"
      ]
    },
    {
      "code": "ORDER_DUPLICATE_LEG",
      "retry": "never",
      "http_status": 400,
      "example_message": "Two of the legs on this order are the same contract. Each leg must be a different contract. Combine them into one leg, or change one strike or expiration.",
      "detail_keys": [
        "option_symbol"
      ]
    },
    {
      "code": "ORDER_CLIENT_ORDER_ID_IN_USE",
      "retry": "never",
      "http_status": 409,
      "example_message": "That client_order_id is already used by one of your orders. It must be unique across every order on your account. Use a new one, or look the existing order up with GET /trader/v1/accounts/{account_id}/orders?client_order_id=... if you meant to find it again.",
      "detail_keys": [
        "client_order_id"
      ]
    },
    {
      "code": "ORDER_LEG_COUNT",
      "retry": "never",
      "http_status": 400,
      "example_message": "Orders must have between 1 and 4 legs."
    },
    {
      "code": "ORDER_INVALID_QUANTITY",
      "retry": "never",
      "http_status": 400,
      "example_message": "Quantity has to be a whole number of contracts, at least 1.",
      "detail_keys": [
        "unit"
      ]
    },
    {
      "code": "ORDER_OVER_CLOSE",
      "retry": "never",
      "http_status": 400,
      "example_message": "You are trying to close more contracts than you hold in this contract (have 0, requested 0). Close only what you have, then place a separate opening order for the rest.",
      "detail_keys": [
        "have",
        "option_symbol",
        "requested"
      ]
    },
    {
      "code": "ORDER_NOT_FOUND",
      "retry": "never",
      "http_status": 404,
      "example_message": "That order is no longer working. It has most likely just filled or been cancelled. Refresh to see its final state."
    },
    {
      "code": "ORDER_NOT_PENDING",
      "retry": "never",
      "http_status": 409,
      "example_message": "This order is in a non-pending state and can no longer be cancelled or modified.",
      "detail_keys": [
        "status"
      ]
    },
    {
      "code": "ORDER_WOULD_CLOSE_EXISTING",
      "retry": "never",
      "http_status": 400,
      "example_message": "This would close multiple existing positions. Use the Close button on each position card.",
      "detail_keys": [
        "legs"
      ]
    },
    {
      "code": "ORDER_STO_DELTA_FLOOR",
      "retry": "backoff",
      "http_status": 400,
      "example_message": "Sell to open needs n/a delta or more. This contract is n/a.",
      "detail_keys": [
        "absDelta",
        "floor",
        "option_symbol"
      ]
    },
    {
      "code": "ORDER_LEG_INTENT_MISMATCH",
      "retry": "never",
      "http_status": 422,
      "example_message": "Leg ?: you declared it as '?', but against your current inventory this leg is '?'. A leg you call a close while holding nothing to close OPENS a position, and on a sell that is a naked short. Re-read your positions for that contract and resubmit, or omit position_intent and let the engine classify the leg.",
      "detail_keys": [
        "declared",
        "derived",
        "occ"
      ]
    },
    {
      "code": "ORDER_MARGIN_INCREASE_EXCEEDS_BP",
      "retry": "backoff",
      "http_status": 400,
      "example_message": "This order would leave a short position uncovered. That raises the margin requirement from n/a to n/a, which is n/a more than this account can carry. Nothing was closed. Close or reduce the short leg first, or close the whole position together.",
      "detail_keys": [
        "cause",
        "currentRequirement",
        "orderCash",
        "projectedRequirement",
        "remedies",
        "shortfall",
        "sink"
      ]
    },
    {
      "code": "ORDER_CANCEL_FAILED",
      "retry": "backoff",
      "http_status": 422,
      "example_message": "This order could not be cancelled. It may have filled or been cancelled already; re-read your working orders and retry the ones still open."
    },
    {
      "code": "ACCOUNT_FAILED",
      "retry": "never",
      "http_status": 403,
      "example_message": "This account has been failed and cannot open new positions. If you believe this is wrong, contact your prop firm and quote this account.",
      "detail_keys": [
        "reason"
      ]
    },
    {
      "code": "ACCOUNT_DISABLED",
      "retry": "never",
      "http_status": 403,
      "example_message": "This account is disabled for the rest of the trading day, and reopens at the next session open. It has not failed. No further orders can be placed today, and any open positions are closed automatically at the end of the session.",
      "detail_keys": [
        "reason",
        "status"
      ]
    },
    {
      "code": "ACCOUNT_CLOSING_ONLY",
      "retry": "never",
      "http_status": 403,
      "example_message": "This account is in closing-only mode: a rule breach is pending settlement of a held index position, so you can only reduce or close positions (no new opening orders) until it settles."
    },
    {
      "code": "TRADING_HALTED",
      "retry": "backoff",
      "http_status": 503,
      "example_message": "Trading is halted for this caller. A platform, account, or API-key level halt is currently engaged; existing positions and resting orders are untouched and closes may still be permitted. Retry with backoff -- halts are released, not permanent."
    },
    {
      "code": "POLICY_REFUSED",
      "retry": "backoff",
      "http_status": 422,
      "example_message": "A trading policy rule refused this order.",
      "detail_keys": [
        "reason"
      ]
    },
    {
      "code": "ORDER_INTENT_MISMATCH",
      "retry": "never",
      "http_status": 422,
      "example_message": "Declared intent '?' does not match this order's actual effect on your positions, which is '?'. Re-read your positions and resubmit with the correct intent. (A close-only credential cannot open a position it does not hold.)",
      "detail_keys": [
        "declared",
        "derived"
      ]
    },
    {
      "code": "ORDER_MAX_POSITIONS",
      "retry": "backoff",
      "http_status": 409,
      "example_message": "This account is at its open-position cap (? of ?), and this order would open ? more. A concurrent order took the last slot after this one was accepted. Close a position or retry later.",
      "detail_keys": [
        "cap",
        "current",
        "would_open"
      ]
    },
    {
      "code": "TRADING_OPEN_HALTED",
      "retry": "backoff",
      "http_status": 503,
      "example_message": "New positions are paused right now because our upstream market-data provider is having issues and quotes are not updating reliably. We have stopped opening trades rather than fill you at a stale price. You can still close or reduce anything you already hold. Trading will reopen automatically as soon as the provider is fixed."
    },
    {
      "code": "NOT_FOUND",
      "retry": "never",
      "http_status": 404
    },
    {
      "code": "INTERNAL",
      "retry": "backoff",
      "http_statuses": [
        500,
        503
      ]
    },
    {
      "code": "KEY_CANNOT_MANAGE_KEYS",
      "retry": "never",
      "http_status": 403
    },
    {
      "code": "BAD_JSON",
      "retry": "never"
    },
    {
      "code": "UNKNOWN_ACTION",
      "retry": "never"
    },
    {
      "code": "ORDER_0DTE_CUTOFF",
      "retry": "never",
      "http_status": 400,
      "example_message": "You cannot open new same-day-expiration positions in this ticker after 3:54:30 PM Eastern. Existing positions expiring today will be auto-closed starting at 3:55 PM.",
      "detail_keys": [
        "symbol"
      ]
    },
    {
      "code": "ORDER_STO_DELTA_UNKNOWN",
      "retry": "backoff",
      "http_status": 400,
      "example_message": "We cannot read a delta for this contract right now, and sell to open needs n/a delta or more. Nothing was filled. You can still buy, close, or reduce any position.",
      "detail_keys": [
        "floor",
        "option_symbol"
      ]
    },
    {
      "code": "ORDER_STO_MIN_CREDIT",
      "retry": "backoff",
      "http_status": 400,
      "example_message": "Sell to open needs at least n/a of credit per contract. This contract is n/a.",
      "detail_keys": [
        "credit",
        "minCredit",
        "option_symbol"
      ]
    },
    {
      "code": "CLOSE_EXCEEDS_LIFECYCLE",
      "retry": "never",
      "http_status": 400,
      "example_message": "That structure holds no contracts to close, and this asks for no contracts. The rest belongs to other positions on the same contract. Close what this structure holds, or omit the structure to close the whole holding.",
      "detail_keys": [
        "lifecycle_open",
        "requested"
      ]
    },
    {
      "code": "CLOSE_LEG_OF_STRUCTURE",
      "retry": "never",
      "http_status": 400,
      "example_message": "This position is one leg of a multi-leg structure. Closing it alone can leave the other legs unhedged and removes their protection. Close the whole structure instead, or resend with the partial-structure option if legging out is what you mean to do."
    },
    {
      "code": "ORDER_FIELD_NOT_APPLICABLE",
      "retry": "never",
      "http_status": 400,
      "example_message": "That setting does not apply to this kind of order. Cancel this order and place the kind you want instead.",
      "detail_keys": [
        "order_type"
      ]
    },
    {
      "code": "ORDER_TRAIL_UNIT_MISMATCH",
      "retry": "never",
      "http_status": 400,
      "example_message": "This trailing stop measures its distance in a different form from the one sent. Send the distance in that form instead.",
      "detail_keys": [
        "trail_measured_in"
      ]
    },
    {
      "code": "ORDER_TRAIL_EXCEEDS_EXTREME",
      "retry": "never",
      "http_status": 400,
      "example_message": "That trailing distance is not smaller than the level this order is trailing from, so the stop it would set could never be reached. Choose a smaller distance."
    },
    {
      "code": "ORDER_TRAIL_EXTREME_MISSING",
      "retry": "never",
      "http_status": 409,
      "example_message": "This trailing stop has no reference level recorded, so its distance cannot be recalculated. The stop it already holds is unchanged. Contact support with this order id rather than cancelling protection you may still need."
    },
    {
      "code": "RULE_MAX_DRAWDOWN",
      "retry": "never",
      "http_status": 403,
      "example_message": "This account has hit its maximum drawdown. It is down n/a from the starting balance against a n/a limit, so no new orders can be opened. Open positions may be closed out automatically.",
      "detail_keys": [
        "drawdown",
        "limit"
      ]
    },
    {
      "code": "RULE_TRAILING_DRAWDOWN",
      "retry": "never",
      "http_status": 403,
      "example_message": "This account has hit its trailing drawdown. Equity is n/a against a floor of n/a. No new orders can be opened. Open positions may be closed out automatically.",
      "detail_keys": [
        "equity",
        "floor",
        "peak"
      ]
    },
    {
      "code": "RULE_ZERO_EQUITY_FLOOR",
      "retry": "never",
      "http_status": 403,
      "example_message": "This account's equity is at or below zero. No drawdown floor above zero applies to this account, so no new positions can be opened. Closing orders are still accepted, and open positions may be closed out automatically.",
      "detail_keys": [
        "ddBasisEquity",
        "equity",
        "floor"
      ]
    },
    {
      "code": "RULE_DAILY_LOSS",
      "retry": "never",
      "http_status": 403,
      "example_message": "You have reached today's loss limit: down n/a against a n/a daily limit. This account is disabled for the rest of the session and reopens at the next session open. It has not failed.",
      "detail_keys": [
        "limit",
        "loss"
      ]
    },
    {
      "code": "RULE_MAX_OPEN_POSITIONS",
      "retry": "never",
      "http_status": 400,
      "example_message": "You already hold the maximum of your allowed open positions, and this order would open more new ones. Close a position first, or add to one you already hold (adding does not count as a new position).",
      "detail_keys": [
        "current",
        "limit",
        "opening"
      ]
    },
    {
      "code": "RULE_TRADING_HOURS",
      "retry": "backoff",
      "http_status": 403,
      "example_message": "Your firm allows trading between the configured hours and  ET, and it is now outside that window ET. Orders will be accepted again at the start of the window ET.",
      "detail_keys": [
        "end",
        "now",
        "start"
      ]
    },
    {
      "code": "PROTECT_BAD_UNDERLYING_STOP",
      "retry": "never",
      "http_status": 400,
      "example_message": "This is a bearish position, so a stop tied to the underlying has to sit ABOVE its current price of n/a, and this one is n/a. A long put or short call loses when the underlying RISES.",
      "detail_keys": [
        "bias",
        "entry_trigger",
        "reference",
        "spot",
        "stop"
      ]
    },
    {
      "code": "PROTECT_BAD_UNDERLYING_TARGET",
      "retry": "never",
      "http_status": 400,
      "example_message": "This is a bearish position, so a take-profit tied to the underlying has to sit BELOW its current price of n/a, and this one is n/a. A long put or short call profits when the underlying FALLS.",
      "detail_keys": [
        "bias",
        "entry_trigger",
        "reference",
        "spot",
        "target"
      ]
    },
    {
      "code": "PROTECT_NO_UNDERLYING_QUOTE",
      "retry": "backoff",
      "http_status": 400,
      "example_message": "No live underlying spot available to validate the underlying-trigger bracket. Wait a moment for the next quote and try again, or switch the bracket to option-price mode.",
      "detail_keys": [
        "symbol"
      ]
    },
    {
      "code": "KEY_CANNOT_MANAGE_WEBHOOKS",
      "retry": "never",
      "http_status": 403
    },
    {
      "code": "INVALID_WEBHOOK_URL",
      "retry": "never",
      "http_status": 400
    },
    {
      "code": "WEBHOOK_ALREADY_EXISTS",
      "retry": "never",
      "http_status": 409
    },
    {
      "code": "WEBHOOK_SIGNING_UNAVAILABLE",
      "retry": "backoff",
      "http_status": 503
    },
    {
      "code": "OPRA_AGREEMENT_REQUIRED",
      "retry": "never"
    },
    {
      "code": "ENTITLEMENT_UNAVAILABLE",
      "retry": "backoff",
      "http_status": 503
    },
    {
      "code": "PROTECT_BAD_STOP_DIRECTION",
      "retry": "never",
      "http_status": 400,
      "example_message": "A stop on a debit position has to sit BELOW the current mark of n/a, and this one is n/a. A long option loses money when the price FALLS.",
      "detail_keys": [
        "mark",
        "position_kind",
        "stop"
      ]
    },
    {
      "code": "PROTECT_BAD_TARGET_DIRECTION",
      "retry": "never",
      "http_status": 400,
      "example_message": "A take-profit on a debit position has to sit ABOVE the current mark of n/a, and this one is n/a. A long option profits when the price RISES.",
      "detail_keys": [
        "mark",
        "position_kind",
        "target"
      ]
    },
    {
      "code": "PROTECT_ZERO_MARK",
      "retry": "backoff",
      "http_status": 400,
      "example_message": "There is no usable price for this contract right now (no live quote, or the contract is worthless), so a stop or target has nothing to trigger against. Wait for a quote, or close the position manually.",
      "detail_keys": [
        "option_symbol"
      ]
    },
    {
      "code": "PROTECT_NO_POSITION",
      "retry": "never",
      "http_status": 404,
      "example_message": "There is no open position in that contract to protect. It may have just closed. Refresh your positions and try again.",
      "detail_keys": [
        "option_symbol",
        "position_side"
      ]
    },
    {
      "code": "PROTECT_QTY_EXCEEDS_POSITION",
      "retry": "never",
      "http_status": 400,
      "example_message": "Cannot protect 0 contracts: only 0 contracts are open.",
      "detail_keys": [
        "have",
        "option_symbol",
        "requested",
        "unit"
      ]
    },
    {
      "code": "PROTECT_STOP_OVER_CAPACITY",
      "retry": "never",
      "http_status": 400,
      "example_message": "Stop-loss capacity exceeded: 0 contract(s) already protected by stops, you have 0 open, requesting 0 more would exit 0 contracts (more than you hold). This leg is fully protected. Cancel an existing stop to free up capacity.",
      "detail_keys": [
        "existing",
        "option_symbol",
        "position",
        "requested"
      ]
    },
    {
      "code": "PROTECT_TARGET_OVER_CAPACITY",
      "retry": "never",
      "http_status": 400,
      "example_message": "Take-profit capacity exceeded: 0 contract(s) already targeted, you have 0 open, requesting 0 more would exit 0 contracts (more than you hold). This leg is fully targeted. Cancel an existing target to free up capacity.",
      "detail_keys": [
        "existing",
        "option_symbol",
        "position",
        "requested"
      ]
    },
    {
      "code": "PROTECT_NEEDS_STOP_OR_TARGET",
      "retry": "never",
      "http_status": 400,
      "example_message": "A protective order needs a stop, a take-profit target, or both. Set at least one and try again.",
      "detail_keys": [
        "detail"
      ]
    },
    {
      "code": "POSITION_NOT_FOUND",
      "retry": "never",
      "http_status": 404
    },
    {
      "code": "PROTECT_LEG_OF_STRUCTURE",
      "retry": "never",
      "http_status": 400
    },
    {
      "code": "COPY_FOLLOWER_CANNOT_PLACE",
      "retry": "never",
      "http_status": 403,
      "example_message": "This account is following a leader account, so you cannot place orders on it directly. Unlink the account first if you want to trade it manually."
    },
    {
      "code": "COPY_FOLLOWER_CANNOT_CANCEL",
      "retry": "never",
      "http_status": 403,
      "example_message": "This account is following a leader account, so you cannot cancel its orders directly. Unlink the account first to manage orders manually."
    },
    {
      "code": "COPY_FOLLOWER_CANNOT_MODIFY",
      "retry": "never",
      "http_status": 403,
      "example_message": "This account is following a leader account, so you cannot modify its orders directly. Unlink the account first to manage orders manually."
    },
    {
      "code": "COPY_SELF_FOLLOW",
      "retry": "never",
      "http_status": 400,
      "example_message": "An account cannot follow itself."
    },
    {
      "code": "COPY_INVALID_MULTIPLIER",
      "retry": "never",
      "http_status": 400,
      "example_message": "The copy multiplier must be greater than zero and no larger than 100."
    },
    {
      "code": "COPY_ALREADY_LINKED",
      "retry": "never",
      "http_status": 409,
      "example_message": "This account is already linked to a leader. Unlink it first before pointing it at a different leader."
    },
    {
      "code": "COPY_DIFFERENT_USERS",
      "retry": "never",
      "http_status": 403,
      "example_message": "Copy trading is restricted to your own accounts. You cannot follow an account owned by another user."
    },
    {
      "code": "COPY_LEADER_IS_FOLLOWER",
      "retry": "never",
      "http_status": 400,
      "example_message": "The account you picked as leader is itself following someone else. Copy-trade chains are not allowed."
    },
    {
      "code": "COPY_FOLLOWER_IS_LEADER",
      "retry": "never",
      "http_status": 400,
      "example_message": "This account already has its own followers, so it cannot follow another account. Remove its followers first."
    },
    {
      "code": "COPY_FOLLOWER_NOT_FLAT",
      "retry": "backoff",
      "http_status": 409,
      "example_message": "This account has 0 open position(s) and 0 pending order(s). Close all positions and cancel all pending orders before linking it to a leader.",
      "detail_keys": [
        "pending_orders",
        "positions"
      ]
    },
    {
      "code": "COPY_ACCOUNT_NOT_FOUND",
      "retry": "never",
      "http_status": 404,
      "example_message": "One or both of the accounts in the follow request do not exist."
    },
    {
      "code": "COPY_NOT_FOLLOWING",
      "retry": "never",
      "http_status": 409,
      "example_message": "This account is not following anyone, so there is no copy link to change. Start one with PUT /trader/v1/accounts/{account_id}/copy."
    },
    {
      "code": "COPY_LEADER_NOT_ACCEPTING",
      "retry": "never",
      "http_status": 409,
      "example_message": "That account is not accepting followers. It has either not been switched on as a leader, or it is archived or failed, so nothing it does would reach you."
    },
    {
      "code": "COPY_CANNOT_LEAD",
      "retry": "never",
      "http_status": 409,
      "example_message": "This account cannot be switched on as a leader while it is following another account, archived, or failed. Stop following first, or use an account that is still active."
    },
    {
      "code": "COPY_FOLLOWERS_OUT_OF_SCOPE",
      "retry": "never",
      "http_status": 409,
      "example_message": "Switching this account off as a leader would detach some followers this credential cannot address, and cancel their pending mirrors. Detach them from each follower's own side first (DELETE /trader/v1/accounts/{follower_id}/copy), or use a credential whose account binding covers them.",
      "detail_keys": [
        "unreachable"
      ]
    },
    {
      "code": "ACCOUNT_REWOUND",
      "retry": "backoff",
      "http_status": 409,
      "example_message": "An administrative adjustment to this account was in progress when this order was sent, so nothing was placed or filled. Try again in a moment."
    },
    {
      "code": "CASH_NO_SHORT_CLOSE",
      "retry": "never",
      "http_status": 400,
      "example_message": "Cash accounts cannot buy to close (you do not hold a short  position to close). Cash accounts only allow long positions, so closing is done by selling.",
      "detail_keys": [
        "option_symbol"
      ]
    },
    {
      "code": "CASH_NO_SHORT_OPEN",
      "retry": "never",
      "http_status": 400,
      "example_message": "Cash accounts cannot sell to open. The leg  would create a short option position. Switch to a margin account if you want to sell options to open.",
      "detail_keys": [
        "option_symbol"
      ]
    },
    {
      "code": "COPY_RELATIONSHIP_CHANGED",
      "retry": "never",
      "http_status": 409,
      "example_message": "The follow relationship changed while this copy was being placed. The mirrored order was skipped to avoid leaving an orphan on your account."
    },
    {
      "code": "FIRM_CONTRACT_BLOCKED",
      "retry": "never",
      "http_status": 403,
      "example_message": "Your firm has blocked this contract, so it cannot be traded on this account. Remove that leg or choose a different strike or expiration.",
      "detail_keys": [
        "option_symbol"
      ]
    },
    {
      "code": "FIRM_CONTRACT_NOT_ALLOWED",
      "retry": "never",
      "http_status": 403,
      "example_message": "This contract is not on your firm's list of permitted contracts. Your firm restricts this account to a specific set of contracts, so choose one from that list.",
      "detail_keys": [
        "option_symbol"
      ]
    },
    {
      "code": "ORDER_BLOCKED_TICKER",
      "retry": "never",
      "http_status": 403,
      "example_message": "Your firm has blocked this ticker on this account. Existing positions can still be closed.",
      "detail_keys": [
        "allowed",
        "rule",
        "symbol"
      ]
    },
    {
      "code": "ORDER_BRACKET_CHILD_LOCKED",
      "retry": "never",
      "http_status": 409,
      "example_message": "The size of a stop or take-profit cannot be changed while its entry order is still working, because the two have to stay matched. Change the quantity on the entry order instead and the stop and take-profit will follow. Their prices can still be edited here."
    },
    {
      "code": "ORDER_CONTRACT_CEASED",
      "retry": "never",
      "http_status": 409,
      "example_message": "This index contract has stopped trading. CBOE index options stop trading before they settle, and this one is past that cutoff. You do not need to do anything: the position settles automatically at the official CBOE settlement value and the cash lands in your account.",
      "detail_keys": [
        "expiration",
        "option_symbol"
      ]
    },
    {
      "code": "ORDER_DAY_CUTOFF",
      "retry": "never",
      "http_status": 400,
      "example_message": "Trading in this ticker is halted for the day after 3:59:59 PM Eastern. Any same-day-expiration positions still open will be auto-closed for you near the close.",
      "detail_keys": [
        "symbol"
      ]
    },
    {
      "code": "ORDER_DIFFERENT_UNDERLYINGS",
      "retry": "never",
      "http_status": 400,
      "example_message": "This order mixes more than one underlying. Every leg of a spread has to be on the same underlying. Place them as separate orders.",
      "detail_keys": [
        "symbols"
      ]
    },
    {
      "code": "ORDER_EXPIRED_CONTRACT",
      "retry": "never",
      "http_status": 400,
      "example_message": "The contract  expired on . Pick a contract that has not expired.",
      "detail_keys": [
        "expiration",
        "option_symbol"
      ]
    },
    {
      "code": "ORDER_FEED_NOT_READY",
      "retry": "backoff",
      "http_status": 503,
      "example_message": "Live market data for this ticker has not started flowing yet. Try again in a few seconds.",
      "detail_keys": [
        "symbol"
      ]
    },
    {
      "code": "ORDER_FORCE_FILL_NEEDS_PRICE",
      "retry": "never",
      "http_status": 400,
      "example_message": "Admin force-fill needs an explicit price: no live quote exists for this contract, so there is nothing to fill against. Place a single-leg LIMIT order and the bypass will fill it at your limit price.",
      "detail_keys": [
        "option_symbol"
      ]
    },
    {
      "code": "ORDER_NO_OVERNIGHT_INDEX",
      "retry": "never",
      "http_status": 403,
      "example_message": "Your account cannot hold index positions overnight; open index only during regular hours (9:30 AM-4:15 PM ET).",
      "detail_keys": [
        "symbol"
      ]
    },
    {
      "code": "ORDER_POSITION_AWAITING_SETTLEMENT",
      "retry": "backoff",
      "http_status": 409,
      "example_message": "This index position has ceased trading and is awaiting its official CBOE settlement value. It is locked and settles automatically at the published SOQ/close. It cannot be closed or modified manually.",
      "detail_keys": [
        "option_symbol"
      ]
    },
    {
      "code": "ORDER_QTY_EXCEEDS_POSITION",
      "retry": "never",
      "http_status": 400,
      "example_message": "Quantity 0 exceeds the open position size of 0 contract(s) in this contract. A closing order can only cover what you hold.",
      "detail_keys": [
        "have",
        "option_symbol",
        "requested"
      ]
    },
    {
      "code": "ORDER_QTY_RATIO_SPREAD",
      "retry": "never",
      "http_status": 400,
      "example_message": "Quantity changes are not supported on ratio spreads (legs with different quantities). Cancel and re-place the order to change the ratio."
    },
    {
      "code": "ORDER_RESTRICTED_INDEX",
      "retry": "never",
      "http_status": 403,
      "example_message": "This index is not available for trading on this platform yet. Contact support if you need access to index options.",
      "detail_keys": [
        "symbol"
      ]
    },
    {
      "code": "ORDER_TRIGGER_AT_SPOT",
      "retry": "never",
      "http_status": 400,
      "example_message": "A trigger of n/a is the same as the underlying's current price of n/a, so there is no way to tell whether you mean \"when it rises to here\" or \"when it falls to here\". Pick a price above or below the current one.",
      "detail_keys": [
        "spot",
        "symbol",
        "trigger"
      ]
    },
    {
      "code": "ORDER_TRIGGER_CROSSES_EXIT",
      "retry": "never",
      "http_status": 400,
      "example_message": "A stop or take-profit tied to the underlying cannot sit on or across the trigger of the dormant entry it belongs to. Move one of them first.",
      "detail_keys": [
        "cleared",
        "level",
        "moved",
        "requested_direction",
        "required_direction",
        "role",
        "spot",
        "trigger"
      ]
    },
    {
      "code": "ORDER_TRIGGER_INVALID_PRICE",
      "retry": "never",
      "http_status": 400,
      "example_message": "That trigger price is not a usable price. Enter a positive number for the price the underlying has to reach.",
      "detail_keys": [
        "trigger"
      ]
    },
    {
      "code": "ORDER_TRIGGER_NO_SPOT",
      "retry": "backoff",
      "http_status": 503,
      "example_message": "Cannot place an underlying trigger on this ticker. Live spot price is unavailable. Try again once the chain has loaded.",
      "detail_keys": [
        "symbol"
      ]
    },
    {
      "code": "ORDER_ZERO_BID_OPENING",
      "retry": "backoff",
      "http_status": 400,
      "example_message": "Cannot open a position in this contract because its bid is zero. Illiquid options are blocked for new positions to protect you from a fill at any ask price.",
      "detail_keys": [
        "option_symbol"
      ]
    },
    {
      "code": "REDUCE_ONLY_NO_POSITION",
      "retry": "never",
      "http_status": 400,
      "example_message": "Nothing to close: that position is already flat, so this order was not placed. Any other legs on the ticket were not placed either. Refresh your positions and try again.",
      "detail_keys": [
        "option_symbol"
      ]
    },
    {
      "code": "RULE_MAX_CONTRACTS_PER_ORDER",
      "retry": "never",
      "http_status": 400,
      "example_message": "This order opens more contracts, and your firm allows at most fewer per order. Legs that CLOSE an existing position do not count toward this limit. Reduce the quantity and submit again.",
      "detail_keys": [
        "countsClosingLegs",
        "limit",
        "requested"
      ]
    },
    {
      "code": "RULE_TRADING_DISABLED",
      "retry": "never",
      "http_status": 403,
      "example_message": "Trading is switched off for this account by your prop firm. Existing positions can still be closed. Contact your firm to have it re-enabled."
    },
    {
      "code": "TICKER_NOT_OPENABLE",
      "retry": "never",
      "http_status": 403,
      "example_message": "This underlying is no longer available for new positions on Rix. You can still close or reduce any position you already hold in it.",
      "detail_keys": [
        "symbol"
      ]
    },
    {
      "code": "ORDER_INSTRUMENT_MALFORMED",
      "retry": "never",
      "http_status": 400,
      "example_message": "The contract is not written in a form this API reads. Write it as the root, the expiration as YYMMDD, C or P, and the strike times 1000 as 8 digits, with no spaces.",
      "detail_keys": [
        "canonical_form",
        "field",
        "occ"
      ]
    },
    {
      "code": "ORDER_INSTRUMENT_NOT_PLACEABLE",
      "retry": "never",
      "http_status": 400,
      "example_message": "This contract is a correctly written contract symbol, but orders cannot be placed on it here: its root is adjusted or non-standard, which usually follows a corporate action such as a split or merger. Trade the standard contract on the same underlying instead.",
      "detail_keys": [
        "field",
        "occ",
        "reason"
      ]
    }
  ],
  "paths": {
    "/trader/v1/accounts": {
      "get": {
        "operationId": "listAccounts",
        "tags": [
          "Accounts"
        ],
        "summary": "THE ACCOUNTS THIS CREDENTIAL CAN ADDRESS — start here.",
        "description": "Every account-scoped operation takes an `account_id` in its path, and this is the only way to discover one. The list is scoped to the CREDENTIAL, not merely to the owner: a key bound to a subset of accounts sees exactly that subset, and a sandbox key sees only sandbox accounts, so the list never names an account the very next call would 404. There is no default account and no implicit selection — if you do not name one, the request does not run.",
        "security": [
          {
            "traderApiKey": [
              "read:account"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The accounts this credential can address.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountsListResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      }
    },
    "/trader/v1/accounts/{account_id}": {
      "get": {
        "operationId": "getAccount",
        "tags": [
          "Accounts"
        ],
        "summary": "The account balance and buying-power state.",
        "security": [
          {
            "traderApiKey": [
              "read:account"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Account state.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/positions": {
      "get": {
        "operationId": "listPositions",
        "tags": [
          "Positions"
        ],
        "summary": "Open positions with mark and unrealised P&L.",
        "security": [
          {
            "traderApiKey": [
              "read:positions"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Positions.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PositionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/copy": {
      "get": {
        "operationId": "getCopyState",
        "tags": [
          "Copy"
        ],
        "summary": "What this account is doing in copy trading: the leader it mirrors (with the size multiplier), how ma",
        "description": "ny accounts mirror IT, and `can_trade_directly`. That last field is the one to read when orders are being refused — a FOLLOWER account cannot be traded directly at all: placement answers COPY_FOLLOWER_CANNOT_PLACE, cancel answers COPY_FOLLOWER_CANNOT_CANCEL and modify answers COPY_FOLLOWER_CANNOT_MODIFY, because a follower’s book has to match its leader’s. DELETE this resource to get the account back.",
        "security": [
          {
            "traderApiKey": [
              "read:account"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The copy state of this account.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyState"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ]
      },
      "put": {
        "operationId": "followLeader",
        "tags": [
          "Copy"
        ],
        "summary": "FOLLOW a leader account: every fill on the leader is mirrored onto this account, scaled by `multiplier`.",
        "description": "The leader must be an account YOU own — cross-user copying is not supported — and must be reachable by THIS credential, so a key bound to a subset of your accounts cannot point one of them at an account it may not address. Refusals are specific and terminal: COPY_SELF_FOLLOW, COPY_ALREADY_LINKED (unfollow first — re-pointing silently would strand the previous leader’s pending mirrors), COPY_LEADER_IS_FOLLOWER and COPY_FOLLOWER_IS_LEADER (chains are not allowed in either direction), and COPY_FOLLOWER_NOT_FLAT — this account must hold no positions and no pending orders, because mirrored fills would otherwise diverge from the leader’s position state from the first order. The LEADER may hold positions; you simply do not receive the ones it already had, or their closes. Idempotent in the useful sense: following the same leader at the same multiplier is refused as COPY_ALREADY_LINKED rather than silently re-applied.",
        "security": [
          {
            "traderApiKey": [
              "write:copy"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The account is now following.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyState"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FollowLeaderRequest"
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "resizeCopyLink",
        "tags": [
          "Copy"
        ],
        "summary": "RESIZE A LIVE LINK — change the multiplier without tearing the relationship down.",
        "description": "Until now this meant CLOSING EVERY POSITION: following again is refused while the account already follows, and re-following requires the follower to be flat, so editing one number cost a full liquidation. ⚠️ THIS DOES NOT RESIZE ANYTHING ALREADY OPEN. Mirrors already placed were sized against the multiplier in force AT THE TIME and stay that way — your book is the record of trades that happened, not a projection of the current setting. Only mirrors placed AFTER this call use the new number. Retro-sizing would mean the engine issuing trades you never asked for, on a live account, to make history match a setting. Refused with COPY_NOT_FOLLOWING if this account follows nobody; start a link with PUT instead.",
        "security": [
          {
            "traderApiKey": [
              "write:copy"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The copy state after the resize.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyState"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResizeCopyLinkRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "unfollowLeader",
        "tags": [
          "Copy"
        ],
        "summary": "STOP FOLLOWING, and get the account back.",
        "description": "This is the ONLY exit from the follower guard, which is why it takes `write:orders:close_only` rather than `write:copy`: a credential that can close a position can always reach it. IDEMPOTENT — an account that follows nothing answers 200 with `unlinked: false`, never 404, so a client retrying after a timeout does not have to tell \"it worked\" from \"it already had\". Pending mirrors are cancelled ATOMICALLY with the unlink, so none can fill onto an account that no longer follows anything. PROTECTIVE EXITS ARE KEPT and their copy lineage severed — unfollowing must not be a way to end up holding an unprotected position. Positions are NOT closed; closing them is an ordinary order you compose afterwards, with your own limit and your own idempotency key.",
        "security": [
          {
            "traderApiKey": [
              "write:orders:close_only"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "No longer following.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyUnlinkResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/copy/leader": {
      "put": {
        "operationId": "setCopyLeader",
        "tags": [
          "Copy"
        ],
        "summary": "BE FOLLOWABLE, OR STOP.",
        "description": "Being mirrored is a consent, not a default: an account starts with `is_leader: false` and a follow of it is refused with COPY_LEADER_NOT_ACCEPTING until this is switched on. Without this call that refusal would be a wall with no door on this surface — the switch would exist only in the browser, and a program could be blocked by a setting it could not reach. `enabled: true` is refused with COPY_CANNOT_LEAD while the account is itself FOLLOWING, archived, or failed (chains are not allowed in either direction, and an account that can never fill cannot usefully lead). `enabled: false` is DESTRUCTIVE and not a simple undo: it DETACHES every follower and cancels their un-filled mirrors, the same action the browser’s leader/disable performs — setting it back to true does not restore them. It is a boolean rather than a toggle so a retry after a timeout lands on the state you asked for. Idempotent in both directions: enabling an account that already leads is a 200 no-op, and disabling one nobody follows answers 200 with `detached_followers: 0`.",
        "security": [
          {
            "traderApiKey": [
              "write:copy"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The copy state after the change.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyLeaderResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetCopyLeaderRequest"
              }
            }
          }
        }
      }
    },
    "/trader/v1/accounts/{account_id}/copy/followers": {
      "get": {
        "operationId": "listCopyFollowers",
        "tags": [
          "Copy"
        ],
        "summary": "The accounts that mirror this one, with each follower’s size multiplier.",
        "description": "Narrowed to what THIS credential may address, so a key bound to a subset of your accounts does not learn about the rest. Same owner by construction. Detaching a follower is done from the FOLLOWER’s side — DELETE /trader/v1/accounts/{follower_id}/copy — so that the account being changed is always the one the request names.",
        "security": [
          {
            "traderApiKey": [
              "read:account"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Accounts mirroring this one.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyFollowersResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/copy/divergences": {
      "get": {
        "operationId": "listCopyDivergences",
        "tags": [
          "Copy trading"
        ],
        "summary": "WHY YOUR BOOK AND YOUR LEADER’S CAME APART.",
        "description": "A divergence is the copy engine reporting that this account and the account it follows have drifted — either the leader holds something you do not (`follower_missing_position`) or you hold something it has exited (`follower_orphan_position`). ⚠️ READ `resolution`, NEVER `resolved_at` ALONE. `resolved_at` means only that the detector stopped emitting the episode. For a missing position the key is emitted from the LEADER’s holdings, so it stops the moment the LEADER closes — you were never made whole. `repaired` is the only value that means a real repair; `no_longer_detected` must never be read as an absence of harm. That is why `status` takes THREE values and not two: an open/all pair would let an episode that closed because the leader flattened drop silently out of `open` and read as fine. An episode resolved before we began recording provenance carries `resolution_unknown` rather than a guess. ⚠️ `leader_visible` false means the leader account is outside this credential’s binding, so the leader-derived fields are null — the episode still appears, because having drifted is your own fact, but the leader’s live holding is not something a key bound only to the follower may read. An account with no copy link answers an EMPTY LIST, never a 404.",
        "security": [
          {
            "traderApiKey": [
              "read:account"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Divergence episodes for this follower account.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyDivergencesResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/margin": {
      "get": {
        "operationId": "getMargin",
        "tags": [
          "Accounts"
        ],
        "summary": "WHY IS MY BUYING POWER X.",
        "description": "`risk_collateral_locked` on the account is a single number; this is what is behind it, line by line. ⚠️ LINES, NOT POSITIONS — the model groups by (root, right, spread-or-naked), and one `spread` line covers a short AND the long that covers it, which are two different positions. There is deliberately no per-position margin figure: splitting a spread’s requirement across its legs is an attribution the model does not make, and inventing one would be a number you could not reconcile against anything. READ `treatment` FIRST: a short you believe is covered but that appears as `naked` is usually the whole answer, and usually because the long does not OUTLIVE the short — the one condition under which a long covers it. On a naked line `bound` names which arm of the model won (price shock, percentage floor, or house minimum per contract), which is what makes the figure auditable rather than merely reported. `as_of` is the server’s ET trading date and is NOT a parameter: a malformed date silently drops every leg and prices an account at zero, so it is not something a client may supply. ⚠️ CHECK `used_stale_spot`: when true at least one root was priced from a session close rather than a live quote. The requirement is still returned — a report should say what it knows — but do not diff it against a live figure without accounting for it. If the book cannot be priced at all you get 503 MARGIN_UNAVAILABLE and never a zero, because an outage reported as “no requirement” is the wrong direction on a risk endpoint.",
        "security": [
          {
            "traderApiKey": [
              "read:positions"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The requirement, and the lines that make it up.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarginResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/portfolio": {
      "get": {
        "operationId": "getPortfolio",
        "tags": [
          "Accounts"
        ],
        "summary": "Portfolio summary.",
        "security": [
          {
            "traderApiKey": [
              "read:positions"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Portfolio summary.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/refusals": {
      "get": {
        "operationId": "listRefusals",
        "tags": [
          "Accounts"
        ],
        "summary": "WHAT A CONTROL REFUSED, INCLUDING WHAT YOU WERE NEVER TOLD.",
        "description": "Kill switches, firm policy and the risk gates all record why they declined to act. When that happens AS YOU SEND an order you get a code on the wire and this is a duplicate of it. When it happens to an order ALREADY RESTING there is no request in flight to answer, and nothing is sent to you at all — your working order simply stops being actionable. ⚠️ `client_visible: false` marks exactly those, and they are the reason this endpoint exists: a stop that never triggered looks identical to a stop that was never hit, and this is how you tell the difference. Newest first, keyset-paginated on `after` (an int8 as a STRING, because a JSON number truncates past 2^53). `control` is a free-form label so a new control is reviewable without a migration — read it, do not branch on a fixed list — and `detail` carries that control’s own context, so branch on `control` rather than on the shape of `detail`.",
        "security": [
          {
            "traderApiKey": [
              "read:orders"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Refusals, newest first, plus the cursor that continues them.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefusalsResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          },
          {
            "name": "sink",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "placement",
                "matcher"
              ]
            },
            "description": "`placement` — refused when you sent it, so you already got a code on the wire. `matcher` — refused while the order was ALREADY RESTING, where there was no request to answer, so this endpoint is the only place it is reported. Omit for both."
          },
          {
            "name": "control",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Narrow to one control, e.g. the kill switch or a policy rule. The values are the same `control` strings this endpoint returns; it is a free-form label by design, so a new control becomes reviewable without a migration."
          },
          {
            "name": "since_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90
            },
            "description": "Only refusals from the last N days."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Page size. Default 50."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,19}$"
            },
            "description": "EXCLUSIVE cursor: the `id` of the last refusal you processed. A STRING because the id is an int8 and a JSON number silently truncates past 2^53. Newest first, so paging with this walks BACKWARDS through history."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/policy": {
      "get": {
        "operationId": "getPolicy",
        "tags": [
          "Accounts"
        ],
        "summary": "THE RULES YOU TRADE UNDER, BEFORE ONE OF THEM REFUSES YOU.",
        "description": "Your firm can cap how fast you send orders, how large a position may get, how long you must hold, and where your price may sit relative to the market. Until now the only way to discover any of that was to break one: POLICY_REFUSED names the rule that fired and its threshold, which is a good refusal but an expensive way to read a configuration value. Read this and size inside your limits instead. ⚠️ THE ANSWER IS FOR THE CALLING CREDENTIAL. Policy binds to (account, key), so a firm may limit one key and not another and the same account answers differently depending on which key asks — `api_key_id` echoes which one you are looking at. You cannot ask about somebody else’s key. EVERY implemented rule kind is listed, in force or not, so “there is no cap on this” is something the document SAYS rather than something you infer from a missing field. The numbers come from the SAME function the order path enforces, so what you read here cannot disagree with what refuses you. They are your firm’s settings: read them rather than hard-coding them, because they can change without a release.",
        "security": [
          {
            "traderApiKey": [
              "read:account"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every implemented rule kind, marked in force or not.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/orders": {
      "get": {
        "operationId": "listOrders",
        "tags": [
          "Orders"
        ],
        "summary": "List orders.",
        "description": "Defaults to WORKING orders; `status=all` includes terminal history and is materially more expensive. `order_userref` NARROWS TO ONE CORRELATION LABEL — the tag you supplied at placement to mark many orders as ONE algorithm run — and it is the way a strategy reads back everything it placed. It is NOT `client_order_id`: that one is unique per user and names exactly one order, and is available as its own query parameter on this endpoint (and via GET /trader/v1/orders/{id} once you hold the platform id), whereas this filter is EXPECTED to return a set, and returns an empty page rather than an error when nothing carries the label.",
        "security": [
          {
            "traderApiKey": [
              "read:orders"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A page of orders, plus `next_cursor` (null when exhausted).",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrdersResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "default": "working",
              "type": "string",
              "enum": [
                "working",
                "all"
              ]
            },
            "description": "`working` (the default) returns only live orders. `all` includes filled, cancelled and rejected ones. ⚠️ Defaults to `working`, so an order you just saw fill is ABSENT unless you ask for `all`."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Orders per page, 1-200. Defaults to 50 — note this cap is lower than the events and ledger endpoints, which allow 500."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{8,256}$"
            },
            "description": "Opaque page cursor from a previous response's `next_cursor`. Pass it back verbatim; do not construct or parse one. A malformed cursor is a 400, never a silent restart — a client paging with a corrupted cursor would otherwise loop on page one forever, never advancing and never being told why."
          },
          {
            "name": "client_order_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "description": "Fetch the ONE order carrying this client-assigned id — the handle you set at placement. Unique per user, so it names exactly one order and returns a one-element page (or an empty one). Resolved as a DIRECT indexed lookup, not a scan of the page window, so an order does not read as missing merely because it sits past the window's edge — a client that took that for \"my order never landed\" and re-placed would have doubled a position. Use `order_userref` instead to fetch a whole RUN."
          },
          {
            "name": "order_userref",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "description": "Fetch exactly the orders belonging to ONE RUN — the correlation label you set at placement. Many orders deliberately share one value, which is what makes this the only parameter that can ask \"give me these forty orders as a run\". ⚠️ NOT a `client_order_id` lookup: that one is unique and names a single order. Matched within the page window, so page through with `cursor` rather than assuming one call returns the whole run."
          }
        ]
      },
      "post": {
        "operationId": "placeOrder",
        "tags": [
          "Orders"
        ],
        "summary": "Place an order.",
        "description": "Idempotency-Key REQUIRED.",
        "security": [
          {
            "traderApiKey": [
              "write:orders:close_only"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "IDEMPOTENT REPLAY: this key already placed this order, and the body is the original order unchanged. Retrying a timed-out placement with the same key is SAFE and is the correct response to one -- this status is how you can tell a replay from a new placement.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceOrderResponse"
                }
              }
            }
          },
          "201": {
            "description": "Accepted. This is a NEW order.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "REQUIRED, as this header or as `idempotency_key` in the body — send exactly one. Omitting both is refused with IDEMPOTENCY_KEY_REQUIRED, because a retried write without a key places a SECOND order. 8-128 characters.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceOrderRequest"
              }
            }
          }
        }
      }
    },
    "/trader/v1/accounts/{account_id}/orders/bulk": {
      "post": {
        "operationId": "placeOrdersBulk",
        "tags": [
          "Orders"
        ],
        "summary": "Place up to 10 orders in ONE request.",
        "description": "⚠️ READ THIS BEFORE YOU USE IT: this is a CONVENIENCE, NOT A TRANSACTION. There is no all-or-nothing semantics available on this platform -- a single placement is already several independent durable commits -- so orders are placed ONE AT A TIME, IN ARRAY ORDER, and any one of them can be refused while its siblings are accepted and FILLED. If item 2 refuses, items 1 and 3 are real, live orders. Do not send a multi-leg strategy as a batch expecting it to arrive whole; use the bracket endpoint, which IS atomic, or accept that you must reconcile.\n\nTHE ENVELOPE IS ALWAYS 200 when the batch was processed, and that status says NOTHING about whether any order was accepted -- read `results[].status`, which carries exactly what the single-order endpoint would have returned for that order (201 placed, 200 idempotent replay, 4xx refused). `placed`/`refused`/`replayed` are counts of those, provided so you need not re-derive them. Deliberately not 207: a status code that cannot express the outcome should not pretend to.\n\nEVERY ORDER CARRIES ITS OWN `idempotency_key` IN THE BODY -- there is no Idempotency-Key header on this route, because one key cannot describe ten orders. They must be DISTINCT within a batch: reusing one is a contradiction rather than a retry, and the whole request is refused. Retrying a batch with the same keys re-places nothing; already-placed items come back as 200 replays.\n\nRATE COST IS N, NOT 1. The batch is charged once against the order bucket at a weight equal to the number of orders, so batching is not a way around the limit -- it is a way to spend the same budget in one round trip. A batch larger than the bucket can ever hold is refused 400 BATCH_TOO_LARGE (retry:never -- waiting cannot help, send fewer); a batch merely larger than the tokens on hand is 429 with Retry-After.",
        "security": [
          {
            "traderApiKey": [
              "write:orders:close_only"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The batch was PROCESSED. This says nothing about acceptance -- read results[].status.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkPlaceResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkPlaceOrdersRequest"
              }
            }
          }
        }
      }
    },
    "/trader/v1/submissions/{idempotency_key}": {
      "get": {
        "operationId": "getSubmission",
        "tags": [
          "Orders"
        ],
        "summary": "What happened to the order sent with this Idempotency-Key.",
        "description": "The recovery primitive: an accepted key replays its response, but a REFUSED key has nothing stored to replay, so after a timeout this is the only way to tell \"refused, do not retry\" from \"never arrived, please retry\". `found: false` means it never arrived.",
        "security": [
          {
            "traderApiKey": [
              "write:orders:close_only"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The submission outcome, or found:false if never seen.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "idempotency_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/trader/v1/quotes": {
      "get": {
        "operationId": "getQuotes",
        "tags": [
          "MarketData"
        ],
        "summary": "Batch NBBO for specific contracts, up to 200 per request, and they MAY span underlyings.",
        "description": "READ THIS BEFORE YOU POLL. Options polling on this platform is DEMAND-DRIVEN: a symbol is fetched upstream only while a WebSocket client somewhere is subscribed to it, or a position or order references it. A REST client generates NO such demand. Roughly 45 seconds after the last live viewer leaves a symbol, the live chain expires and the server still holds a FULLY POPULATED end-of-day snapshot of the previous session’s marks — complete, well-formed, and frozen. It is indistinguishable from live data by inspection. THIS ENDPOINT THEREFORE DEFAULTS TO `freshness=live`, WHICH REFUSES: you get 409 STALE_DATA naming the source and the age rather than prices you would have traded on. Pass `freshness=any` only when you have decided that last session’s close is acceptable, and then CHECK `source` on every response. `source` is not optional and never will be. A BATCH IS NOT ALL-OR-NOTHING: a symbol that fails the freshness bar contributes no rows and its contracts are named in `stale`, while every symbol that DID meet it is returned normally. Only when EVERY symbol is stale is the whole request refused with 409 — an empty list would otherwise read as “no such contracts”. `stale` is kept separate from `not_found` deliberately: those contracts EXIST and we hold last session’s price for them, which you declined. Snapshots are PER-SYMBOL and UNSYNCHRONIZED. There is no cross-symbol “as-of” in this architecture — quotes for two symbols are two reads taken at slightly different instants, possibly from different shards — so a spread or basket calculation that assumes a common timestamp is unsound. `meta.by_symbol` gives you each symbol’s source and age. ABSENCE IS REPORTED, NEVER SWALLOWED: a contract with no row comes back in `not_found` and a string that is not a parseable OCC comes back in `malformed`. Neither is dropped, because the failure this prevents is silent — a malformed OCC that is quietly discarded reads downstream as a contract worth zero. A symbol you are not entitled to see also lands in `not_found`, indistinguishable from a contract that does not exist; the symbol is never named. Requests over the 200-contract ceiling are REFUSED with BATCH_TOO_LARGE rather than truncated, so a silently short answer is not a thing that can happen. Rate-limited on a MARKET-DATA bucket that is completely separate from order entry: polling quotes can never throttle your own cancels.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Quotes for the contracts that had them, plus what was absent or malformed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotesResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "occ",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated OCC symbols. At most 200."
          },
          {
            "name": "freshness",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "any"
              ],
              "default": "live"
            },
            "description": "live (default) REFUSES end-of-day data with 409 STALE_DATA. any accepts it — check `source`."
          }
        ]
      }
    },
    "/trader/v1/greeks": {
      "get": {
        "operationId": "getGreeks",
        "tags": [
          "MarketData"
        ],
        "summary": "The greeks for specific contracts — the same rows GET /trader/v1/quotes returns, projected to iv/delta/gamma/theta/vega.",
        "description": "Identical semantics in every other respect, including the freshness contract. READ THIS BEFORE YOU POLL. Options polling on this platform is DEMAND-DRIVEN: a symbol is fetched upstream only while a WebSocket client somewhere is subscribed to it, or a position or order references it. A REST client generates NO such demand. Roughly 45 seconds after the last live viewer leaves a symbol, the live chain expires and the server still holds a FULLY POPULATED end-of-day snapshot of the previous session’s marks — complete, well-formed, and frozen. It is indistinguishable from live data by inspection. THIS ENDPOINT THEREFORE DEFAULTS TO `freshness=live`, WHICH REFUSES: you get 409 STALE_DATA naming the source and the age rather than prices you would have traded on. Pass `freshness=any` only when you have decided that last session’s close is acceptable, and then CHECK `source` on every response. `source` is not optional and never will be. A BATCH IS NOT ALL-OR-NOTHING: a symbol that fails the freshness bar contributes no rows and its contracts are named in `stale`, while every symbol that DID meet it is returned normally. Only when EVERY symbol is stale is the whole request refused with 409 — an empty list would otherwise read as “no such contracts”. `stale` is kept separate from `not_found` deliberately: those contracts EXIST and we hold last session’s price for them, which you declined. Note greeks are POLLER-OWNED, while NBBO can also be updated by the streamer between poll cycles; `age_ms` measures the poller’s last write, so it is the honest age of THESE fields specifically.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Greeks for the contracts that had them.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GreeksResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "occ",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated OCC symbols. At most 200."
          },
          {
            "name": "freshness",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "any"
              ],
              "default": "live"
            }
          }
        ]
      }
    },
    "/trader/v1/chain/{symbol}": {
      "get": {
        "operationId": "getChainSlice",
        "tags": [
          "MarketData"
        ],
        "summary": "A DTE- and strike-WINDOWED SLICE of an option chain.",
        "description": "THIS IS NOT THE FULL CHAIN and is not intended to become one: a full liquid-name chain is on the order of 800 KB, and serving that per REST poll is not something the platform has the capacity to offer. `max_dte` (default 180) and `strike_range` (default 40, a PERCENTAGE band either side of spot — not a strike count, because strike increments differ per symbol) bound the payload. `window` reports the bounds applied and both `contracts_before_window` and `contracts_returned`, so you can always tell “the window excluded it” from “it does not exist”. If the underlying price is unavailable the request is REFUSED with 503 UNDERLYING_UNAVAILABLE rather than served unwindowed — degrading to the whole chain is the outcome the window exists to prevent. READ THIS BEFORE YOU POLL. Options polling on this platform is DEMAND-DRIVEN: a symbol is fetched upstream only while a WebSocket client somewhere is subscribed to it, or a position or order references it. A REST client generates NO such demand. Roughly 45 seconds after the last live viewer leaves a symbol, the live chain expires and the server still holds a FULLY POPULATED end-of-day snapshot of the previous session’s marks — complete, well-formed, and frozen. It is indistinguishable from live data by inspection. THIS ENDPOINT THEREFORE DEFAULTS TO `freshness=live`, WHICH REFUSES: you get 409 STALE_DATA naming the source and the age rather than prices you would have traded on. Pass `freshness=any` only when you have decided that last session’s close is acceptable, and then CHECK `source` on every response. `source` is not optional and never will be.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A windowed slice of the chain, with the bounds applied.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChainSliceResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "freshness",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "any"
              ],
              "default": "live"
            }
          },
          {
            "name": "max_dte",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 3650,
              "default": 180
            }
          },
          {
            "name": "strike_range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 0.5,
              "maximum": 100,
              "default": 40
            },
            "description": "Percentage band either side of spot."
          }
        ]
      }
    },
    "/trader/v1/credential": {
      "get": {
        "operationId": "getCredential",
        "tags": [
          "Credentials"
        ],
        "summary": "WHAT THIS CREDENTIAL IS — scopes, environment, account bindings, expiry, api_version.",
        "description": "The one call you can make BEFORE knowing what you are allowed to do, and the only route on this surface reachable by ANY authenticated caller regardless of scope: a drop-copy key holding only `subscribe:events` must still be able to ask what it is. START HERE when a request is refused and you are not sure whether the credential lacks a scope, is bound to other accounts, is in the wrong environment, or has expired — all four look alike from a 403. `valid_scopes` lists every scope that exists, so a grant you lack is distinguishable from a name you misspelled. RETURNS THE CALLING CREDENTIAL ONLY — never a sibling key and never a list; use the session-only GET /trader/keys to see them all. A browser session gets a coherent body too, with `credential_type: session` and nulls where a key would carry an id and a version.",
        "security": [
          {
            "traderApiKey": []
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The calling credential.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      }
    },
    "/trader/v1/bars/option/{occ}": {
      "get": {
        "operationId": "getOptionBars",
        "tags": [
          "MarketData"
        ],
        "summary": "HISTORICAL OHLCV FOR ONE OPTION CONTRACT, by OCC.",
        "description": "⚠️ READ `coverage_from` AND `truncated` BEFORE TRUSTING THE WINDOW. This archive is SYNTHESIZED from the platform’s own polling, not bought from a historical vendor, so it begins when polling began rather than when the market did. Ask for two years and you receive what exists, and without these fields you would receive it as a short array with no explanation — a backtest built on that would be quietly wrong about its own sample. `coverage_from` is the earliest bar for THIS series (a newly-listed contract legitimately starts later than the archive as a whole) and `truncated` says whether your window began before it. `from`/`to` are ISO instants; the browser route’s “today” / “3d” shorthand is deliberately not accepted here. `interval` is the set the column itself enforces. Bars carry `n` (trade count) as null when the vendor reported none — never 0. OPRA-gated, like the live chain and quotes: these bars are derived from OPRA Data and the same attestation applies.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Bars, plus the coverage window they came from.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptionBarsResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "occ",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "ISO instant. Default: 24h before `to`."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "ISO instant. Default: now."
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "1d"
              ],
              "default": "1m"
            }
          }
        ]
      }
    },
    "/trader/v1/bars/underlying/{symbol}": {
      "get": {
        "operationId": "getUnderlyingBars",
        "tags": [
          "MarketData"
        ],
        "summary": "HISTORICAL OHLCV FOR AN UNDERLYING.",
        "description": "⚠️ READ `coverage_from` AND `truncated` BEFORE TRUSTING THE WINDOW. This archive is SYNTHESIZED from the platform’s own polling, not bought from a historical vendor, so it begins when polling began rather than when the market did. Ask for two years and you receive what exists, and without these fields you would receive it as a short array with no explanation — a backtest built on that would be quietly wrong about its own sample. `coverage_from` is the earliest bar for THIS series (a newly-listed contract legitimately starts later than the archive as a whole) and `truncated` says whether your window began before it. `from`/`to` are ISO instants; the browser route’s “today” / “3d” shorthand is deliberately not accepted here. `interval` is the set the column itself enforces. Bars carry `n` (trade count) as null when the vendor reported none — never 0. NOT OPRA-gated, deliberately: an equity price is not OPRA Data. Still requires `read:marketdata`, is still metered, and the symbol visibility rule still applies — a root you cannot see live is not readable as history either.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Bars, plus the coverage window they came from.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnderlyingBarsResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "ISO instant. Default: 24h before `to`."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "ISO instant. Default: now."
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "1d"
              ],
              "default": "1m"
            }
          }
        ]
      }
    },
    "/trader/v1/history/option/eod": {
      "get": {
        "operationId": "getHistoricalOptionEod",
        "tags": [
          "MarketData"
        ],
        "summary": "Daily option chain over a date range, from the historical archive.",
        "description": "READ THE COVERAGE BLOCK BEFORE THE ROWS. A historical range is a claim about the past, and the dangerous failure is a thin answer that reads as a quiet market rather than as missing data -- this archive holds a session short by 1,099 roots (SPY, TSLA and VIX among them) behind an HTTP 200 and a valid checksum. Every response carries `coverage`: sessions_served, sessions_degraded (held but partial, curated or unverified), and sessions_absent (not held, each with the reason -- a market holiday, a session never attempted, and one permanently lost are three different answers). A range containing any degraded or absent session is REFUSED with 409 HISTORY_COVERAGE_INCOMPLETE naming every offending day, so you can decide without a second call; pass allow_degraded=true to accept them and coverage.complete stays false. PRICES ARE SCALED INTEGERS, never floats: strike_1e3 is strike x 1000, every *_1e4 is dollars x 10000, and NULL means ABSENT rather than zero -- 80% of a session's rows are listed contracts that never printed, and a published 0.00 is a price a backtest would fill against. quote_age_ms is how stale the NBBO was at the 16:00 close and is a first-class filter: the mean exceeds two hours, so marking against a closing bid without bounding age is marking at lunchtime. Rate-limited on its own bucket, WEIGHTED BY RANGE, and it can never throttle live quotes or order entry. COMPUTING GREEKS FROM THIS DATASET: you have S (pass with_underlying=true), K, T and the price; r comes from /trader/v1/history/rates -- use `cont_1e6`, the continuously-compounded figure Black-Scholes assumes. The one input that is NOT a column is q, the continuous dividend yield, because it is not stored anywhere: our own engine solves it out of the live market by put-call parity and that solve is in-memory, so there is no historical q to publish. Recover it the same way, from these rows: C - P = S*e^(-qT) - K*e^(-rT), i.e. q = -ln((C - P + K*e^(-rT)) / S) / T, taking C and P as the two rights at the SAME strike and expiration on the same session. The published scales carry that to about 1e-6 at 30 days, four orders finer than any dividend yield that matters. Note our q also absorbs a small (~0.3%) baseline covering the American early-exercise premium and long-tenor curve skew, so a parity solve over these rows reproduces what we used rather than a textbook dividend.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Rows, plus the coverage block describing what was and was not read.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoricalOptionEodResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "x-page-items": "rows",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "expiration",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "right",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "C",
                "P"
              ]
            }
          },
          {
            "name": "max_quote_age_ms",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "traded_only",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "allow_degraded",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "with_underlying",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Attach the underlying at each quote as a BRACKET -- the two observations either side, not one value plus an age. Off by default because the underlying series is curated (one liquid contract per root, and some roots produce none), so enabling it silently would narrow your result set for a reason you did not ask for. An age does NOT bound the price: measured, rows at an identical 50-59s staleness carried a 9.5x difference in how far the underlying actually moved (a $0.20 p90 on a quiet day, $1.90 on a volatile one). `underlying_bracket_1e4` is that movement, on that day, for that row. All six fields are NULL when no same-session observation precedes the quote -- deliberately, because a plain ASOF would carry Friday’s close into Monday’s open and present a 65-hour-old price as spot."
          },
          {
            "name": "max_underlying_age_ms",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Drop rows whose preceding underlying observation is older than this. Applies only with `with_underlying=true`."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50000,
              "default": 10000
            },
            "description": "Rows per page. Defaults to 10,000 when omitted — a wide range WILL be truncated, and the response says so with `truncated: true`, a non-null `next_cursor`, and `coverage.complete: false`. Rows are ordered ascending on the session key, so what you lose is the END of your range."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Opaque page cursor. Pass back `next_cursor` from the previous response VERBATIM to continue. A cursor is bound to its dataset and ordering; a malformed or foreign one is refused with 400 INVALID_CURSOR rather than silently restarting you at the beginning of the range."
          }
        ]
      }
    },
    "/trader/v1/history/datasets": {
      "get": {
        "operationId": "listHistoryDatasets",
        "tags": [
          "MarketData"
        ],
        "summary": "START HERE.",
        "description": "The one historical endpoint you can call knowing nothing -- it takes no parameters and reports what the archive holds, rather than requiring you to guess. Every other /history route needs start_date and end_date, which is right for a query and wrong as the only way in: guess badly and you get a 409 or an empty result, neither of which is distinguishable from “we do not go back that far”. Each row names the dataset, the route that serves it, the first and last session held, and the row and byte counts. ⚠️ READ `sessions_partial` BEFORE TRUSTING `sessions`. They are counted separately and deliberately: a dataset with 250 held days, 40 of them short, that advertised “250 days of coverage” would be marketing rather than a catalog -- this archive holds a real session short by 1,099 roots behind an HTTP 200 and a valid checksum. A dataset we serve but hold nothing for still appears here, with zeros and null bounds, because “we do not carry this” and “we have not loaded it yet” must not be the same silence. `bytes` is 0 for the Postgres-backed datasets (rate curves, corporate actions), which have no meaningful on-disk size.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every dataset the archive serves, and what is held of it.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryDatasetsResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      }
    },
    "/trader/v1/history/corporate-actions": {
      "get": {
        "operationId": "getCorporateActions",
        "tags": [
          "MarketData"
        ],
        "summary": "CONTRACT-TERMS CHANGES -- splits, spinoffs, special dividends, symbol changes.",
        "description": "⚠️ READ THIS BEFORE JOINING HISTORICAL OPTION DATA ACROSS ANY DATE RANGE OF LENGTH. A strike only means something in the terms in force on its session date: after a 2:1 split a $400 strike becomes $200 and the deliverable changes, so a range spanning an ex-date holds rows in TWO conventions and a join on (root, expiration, strike) across it silently compares two different contracts. Nothing about the rows looks wrong, which is exactly the problem -- so every historical option response also carries a `terms_changes` array naming the changes that split THAT range, and you do not have to know to call this endpoint. THE TRANSFORM IS PUBLISHED, NOT APPLIED. The archive stores what the vendor printed; restating those prices would destroy your ability to reproduce what actually traded, and whether to back-adjust or forward-adjust, and from which epoch, is your decision, not ours. RATIONALS STAY RATIONAL: `strike_num`/`strike_den` are INTEGERS, never a decimal factor, because a 1:3 reverse split on a $27.50 strike is $9.1666... which is not representable in cents at all -- rounding once at the money boundary is the same rule our own engine follows. CHECK `terms_trust_ceiling`: a schema constraint makes an unsupported deliverable (a spinoff stub we cannot value, a non-standard multiplier) structurally impossible to mark `trusted`, so anything less is us telling you we do not fully know the terms. `deliverable_other_count` > 0 means the contract delivers something with no price we can source. Matches the PRE-action root and the adjusted root alike, so asking for MNST or MNST1 finds the same event. Corrections are UPDATEs that bump `version`, never DELETEs; pass include_superseded=true for the full audit trail of what we believed and when.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Terms changes over the range, newest last.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorporateActionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated OCC roots. Matches the pre-action root and the adjusted root alike."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "include_superseded",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Also return corrected rows. Off by default: the current row is the answer to \"what were the terms\"."
          }
        ]
      }
    },
    "/trader/v1/history/rates": {
      "get": {
        "operationId": "getHistoricalRates",
        "tags": [
          "MarketData"
        ],
        "summary": "THE RISK-FREE CURVE, DAILY -- the last input you need to reproduce our greeks, and the one we never published.",
        "description": "US Treasury par yields, one curve per publication day, every tenor from 1 month to 30 years. ⚠️ TWO COMPOUNDING BASES, BOTH PUBLISHED, BECAUSE THEY ARE DIFFERENT NUMBERS. Treasury publishes PAR yields on a semi-annual bond-equivalent basis; Black-Scholes assumes a CONTINUOUSLY-COMPOUNDED rate. Shipping one under a field called `rate` would make every consumer guess. Measured at a 4.50% par yield -- a 4.99 bp gap -- re-implying vol from the SAME market price moves it 0.018 vol points on a 30-day ATM contract and 0.205 on a 30-day ITM one, with a worst delta error of 0.0021 at 730d. Use `cont_1e6` to price; use `par_1e6` to reconcile against Treasury's own published figure. Pass `tenor_years` and each row also carries `rate_used_1e6`: the rate OUR engine interpolated at that tenor, from the same function live pricing calls, so you reproduce our greeks rather than approximate them -- and it is the PAR figure, because that is what the live engine currently feeds into Black-Scholes. READ THE COVERAGE BLOCK: an absent date has FOUR meanings and this endpoint distinguishes them. A weekend and a bond-market close are FACTS (`dates_not_published`) and never make a range incomplete — and note `bond_market_closed` is named for the BOND market deliberately, because the SIFMA calendar is NOT the equity calendar: Treasury skipped Columbus Day (2024-10-14) and Veterans Day (2024-11-11) while the NYSE traded through both, so this archive holds option sessions on days with no rate curve and that is not a contradiction. The equity calendar's system of record is the session data, not this endpoint; a date we have not fetched is a GAP (`dates_not_fetched`) and refuses the range with 409 HISTORY_COVERAGE_INCOMPLETE unless you pass allow_incomplete=true. A holiday reported as a gap sends you chasing our coverage; a gap reported as a holiday makes you carry a stale rate across a hole you never saw. Rates are scaled integers x 1e6 (4.50% is 45000). Range capped at 4000 days; OPRA-gated by prefix like everything under /history, deliberately -- see the gate's own note on over-gating costing nothing.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Daily curves on both compounding bases, plus the coverage block.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoricalRatesResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "tenor_years",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 30
            },
            "description": "Also return the rate interpolated at this tenor, using the SAME interpolation the live pricing engine uses. 0.0833 is the one-month point."
          },
          {
            "name": "allow_incomplete",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Accept dates whose curve we do not hold. Weekends and confirmed holidays are not gaps and never require this."
          }
        ]
      }
    },
    "/trader/v1/history/coverage": {
      "get": {
        "operationId": "getHistoryCoverage",
        "tags": [
          "MarketData"
        ],
        "summary": "What the archive holds for a date range, WITHOUT reading any of it.",
        "description": "Size a request before making it, and disambiguate an empty result: no rows because the sessions are absent is a different answer from no rows because your filter matched nothing. Reports rather than refuses, so an unusable range can always be diagnosed.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Coverage for the range, and how many rows are available.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryCoverageResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "dataset",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ]
      }
    },
    "/trader/v1/history/option/trade-quote": {
      "get": {
        "operationId": "getHistoricalOptionTradeQuote",
        "tags": [
          "MarketData"
        ],
        "summary": "EVERY PRINT ON THE TAPE, each carrying the NBBO that stood at that instant.",
        "description": "This is the dataset a fill model is built on: the EOD chain tells you where a contract closed, and this tells you what actually traded and what you could have traded against. THE SAME COVERAGE CONTRACT APPLIES -- read `coverage` before the rows, and a range containing a degraded or absent session is REFUSED with 409 HISTORY_COVERAGE_INCOMPLETE unless you pass allow_degraded=true. NOTE `quote_age_ms` IS A DIFFERENT MEASUREMENT HERE than on /history/option/eod: this one is trade-clock minus quote-clock, both real market times, so it is the true staleness of the book at the print. On the EOD route the same field is measured to the 16:00 close, because that file's clock is the vendor's write stamp rather than a market event. Two derivations behind one name because the underlying facts differ -- do not carry a threshold across from one route to the other without re-deciding it. `price_1e4` is NULL when the print carried 0.00 while `size` still says the trade happened: a zero is not a price, and a backtest would fill against it. `quote_ms` NULL means NO quote stood at the print, not midnight. `traded_only` is deliberately NOT accepted here -- every row is a trade, so it would bind, narrow nothing, and read as a real filter. Scaled integers throughout, and the same dedicated rate bucket, weighted by range. COMPUTING GREEKS FROM THIS DATASET: you have S (pass with_underlying=true), K, T and the price; r comes from /trader/v1/history/rates -- use `cont_1e6`, the continuously-compounded figure Black-Scholes assumes. The one input that is NOT a column is q, the continuous dividend yield, because it is not stored anywhere: our own engine solves it out of the live market by put-call parity and that solve is in-memory, so there is no historical q to publish. Recover it the same way, from these rows: C - P = S*e^(-qT) - K*e^(-rT), i.e. q = -ln((C - P + K*e^(-rT)) / S) / T, taking C and P as the two rights at the SAME strike and expiration on the same session. The published scales carry that to about 1e-6 at 30 days, four orders finer than any dividend yield that matters. Note our q also absorbs a small (~0.3%) baseline covering the American early-exercise premium and long-tenor curve skew, so a parity solve over these rows reproduces what we used rather than a textbook dividend.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Prints with the book that stood at each, plus the coverage block.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoricalTradeQuoteResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "x-page-items": "rows",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "expiration",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "right",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "C",
                "P"
              ]
            }
          },
          {
            "name": "max_quote_age_ms",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Trade-clock minus quote-clock at the print. See the note above: this is NOT the same measurement as the field of the same name on /history/option/eod."
          },
          {
            "name": "with_underlying",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Attach the underlying at each quote as a BRACKET -- the two observations either side, not one value plus an age. Off by default because the underlying series is curated (one liquid contract per root, and some roots produce none), so enabling it silently would narrow your result set for a reason you did not ask for. An age does NOT bound the price: measured, rows at an identical 50-59s staleness carried a 9.5x difference in how far the underlying actually moved (a $0.20 p90 on a quiet day, $1.90 on a volatile one). `underlying_bracket_1e4` is that movement, on that day, for that row. All six fields are NULL when no same-session observation precedes the quote -- deliberately, because a plain ASOF would carry Friday’s close into Monday’s open and present a 65-hour-old price as spot."
          },
          {
            "name": "max_underlying_age_ms",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Drop rows whose preceding underlying observation is older than this. Applies only with `with_underlying=true`."
          },
          {
            "name": "allow_degraded",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50000,
              "default": 10000
            },
            "description": "Rows per page. Defaults to 10,000 when omitted — a wide range WILL be truncated, and the response says so with `truncated: true`, a non-null `next_cursor`, and `coverage.complete: false`. Rows are ordered ascending on the session key, so what you lose is the END of your range."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Opaque page cursor. Pass back `next_cursor` from the previous response VERBATIM to continue. A cursor is bound to its dataset and ordering; a malformed or foreign one is refused with 400 INVALID_CURSOR rather than silently restarting you at the beginning of the range."
          }
        ]
      }
    },
    "/trader/v1/history/option/open-interest": {
      "get": {
        "operationId": "getHistoricalOptionOpenInterest",
        "tags": [
          "MarketData"
        ],
        "summary": "OPEN INTEREST PER LISTED CONTRACT, daily.",
        "description": "What positioning survived the session, which volume alone does not tell you -- a contract can trade heavily all day and end flat. THE COVERAGE CONTRACT IS THE SAME as every /history route: read `coverage`, and a degraded or absent session refuses with 409 unless allow_degraded=true. ⚠️ ZERO HERE IS A REPORTED FACT, NOT A MISSING VALUE, and this is the one place in the historical surface where that is true. `open_interest: 0` means the contract is listed and nobody holds it; 47% of a real session's rows are exactly that. Every other dataset NULLs a zero because a published 0.00 price is something a backtest fills against -- here, nulling would instead destroy the distinction between 'no position exists' and 'we do not know', which is the entire question this dataset answers. `observed_ms` is NULL when the vendor reported no observation clock. No quote-derived filters are accepted: this dataset has no book, so `traded_only` and `max_quote_age_ms` are refused as a 400 rather than silently ignored.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Open interest per contract, plus the coverage block.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoricalOpenInterestResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "x-page-items": "rows",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "expiration",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "right",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "C",
                "P"
              ]
            }
          },
          {
            "name": "allow_degraded",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50000,
              "default": 10000
            },
            "description": "Rows per page. Defaults to 10,000 when omitted — a wide range WILL be truncated, and the response says so with `truncated: true`, a non-null `next_cursor`, and `coverage.complete: false`. Rows are ordered ascending on the session key, so what you lose is the END of your range."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Opaque page cursor. Pass back `next_cursor` from the previous response VERBATIM to continue. A cursor is bound to its dataset and ordering; a malformed or foreign one is refused with 400 INVALID_CURSOR rather than silently restarting you at the beginning of the range."
          }
        ]
      }
    },
    "/trader/v1/history/index/eod": {
      "get": {
        "operationId": "getHistoricalIndexEod",
        "tags": [
          "MarketData"
        ],
        "summary": "DAILY LEVELS FOR AN INDEX ROOT -- SPX, VIX, NDX and the rest.",
        "description": "The reference series an option backtest is scored against, and the one this API can serve without an equity market-data subscription, because an index level is not an equity quote. THE COVERAGE CONTRACT IS THE SAME as every /history route. Most index roots are NOT QUOTED, so `bid_1e4`, `ask_1e4` and `quote_ms` are legitimately NULL on the majority of rows -- that is the instrument, not a gap in the archive, and `close_1e4` is the field to reason with. `volume` and `trade_count` are likewise 0 on a level that is computed rather than traded. Contract-level filters are refused as a 400: an index has no expiration, strike or right, so passing them would otherwise reach the query engine and fail as a 500. Scaled integers throughout, same dedicated rate bucket.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Daily index levels, plus the coverage block.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoricalIndexEodResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "x-page-items": "rows",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "max_quote_age_ms",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Only meaningful on the minority of index roots that carry a book at all."
          },
          {
            "name": "allow_degraded",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50000,
              "default": 10000
            },
            "description": "Rows per page. Defaults to 10,000 when omitted — a wide range WILL be truncated, and the response says so with `truncated: true`, a non-null `next_cursor`, and `coverage.complete: false`. Rows are ordered ascending on the session key, so what you lose is the END of your range."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Opaque page cursor. Pass back `next_cursor` from the previous response VERBATIM to continue. A cursor is bound to its dataset and ordering; a malformed or foreign one is refused with 400 INVALID_CURSOR rather than silently restarting you at the beginning of the range."
          }
        ]
      }
    },
    "/trader/v1/symbols": {
      "get": {
        "operationId": "listSymbols",
        "tags": [
          "MarketData"
        ],
        "summary": "THE SYMBOL UNIVERSE — every root on which YOUR /chain, /expirations and /quotes calls will actually resolve.",
        "description": "Start here: every other market-data endpoint takes a symbol, and before this one existed there was no call that would tell you a valid one. The listing is per-caller and agrees with those endpoints exactly — it is filtered through the same gate they enforce, not a second copy of it — so a symbol listed here will not 404 there, and a symbol absent here will not serve. `tradable` is the OPEN gate, which is narrower than the read gate: a root you still hold after it was delisted appears here with `tradable: false`, because you must always be able to reach the chain that CLOSES a position even once opening a new one is barred. Reference data, so no freshness contract and no `freshness` parameter, exactly as /expirations. CHECK `source`: `baseline` means no container has read the ticker table and the list is the compiled-in floor rather than the real universe — short, and not safe to cache. `holdings_degraded` means the held-root lookup failed and roots you hold but cannot search may be missing; those chains are still reachable directly.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Every symbol this caller can load market data for.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SymbolUniverseResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      }
    },
    "/trader/v1/expirations/{symbol}": {
      "get": {
        "operationId": "listExpirations",
        "tags": [
          "MarketData"
        ],
        "summary": "The tradeable expiration calendar for a symbol.",
        "description": "Reference data, not quotes: it carries NO freshness contract and no `freshness` parameter, deliberately — a calendar does not go stale the way a mark does, and refusing it when a symbol has no live poll demand would break the one call a client naturally makes BEFORE it has any demand. For a merged display root (SPX covers SPX a.m. monthlies and SPXW p.m. weeklies) `expirations` is a flat deduped date list and `expirations_meta` carries the {date, root, settle} union — use the `root` from there when building an OCC, because the settlement series determines the true root. A date the platform no longer trades is filtered out at read time.",
        "security": [
          {
            "traderApiKey": [
              "read:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The expiration calendar.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpirationsResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/trader/v1/marketdata/subscriptions": {
      "post": {
        "operationId": "createSubscription",
        "tags": [
          "MarketData"
        ],
        "summary": "REGISTER POLL DEMAND for a set of symbols.",
        "description": "This is the other half of the freshness contract, and you will need it: option polling on this platform is DEMAND-DRIVEN, and a REST client generates no demand by asking for quotes. A symbol no WebSocket viewer is watching and no position references simply stops being fetched, after which every quote request answers 409 STALE_DATA. Registering pins the front of that symbol’s curve into the poller’s demand set so there is live data to serve. REGISTRATION EXPIRES after `ttl_seconds` — re-register periodically to keep a symbol live; that expiry is deliberate, so an abandoned strategy stops consuming polling capacity on its own. A credential may hold at most 25 symbols and the cap counts what you already hold, so it cannot be walked past a few symbols at a time; going over is REFUSED with DEMAND_LIMIT_EXCEEDED rather than truncated. Symbols you are not entitled to see, and symbols with no expiration calendar, come back in `skipped`. Requires `subscribe:marketdata` — a deliberately different grant from `read:marketdata`, because pinning demand consumes shared polling capacity rather than merely reading. MAY BE DISABLED on a given deployment (503 DEMAND_REGISTRATION_DISABLED): capacity, not policy.",
        "security": [
          {
            "traderApiKey": [
              "subscribe:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Demand registered. Re-register before ttl_seconds to keep it.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterDemandResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionRequest"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listSubscriptions",
        "tags": [
          "MarketData"
        ],
        "summary": "What this credential currently has pinned, and the caps that apply.",
        "description": "Entries disappear on their own when their TTL lapses, so an empty list after a quiet period is expected rather than an error.",
        "security": [
          {
            "traderApiKey": [
              "subscribe:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The symbols this credential currently pins.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDemandResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      }
    },
    "/trader/v1/marketdata/subscriptions/{symbol}": {
      "delete": {
        "operationId": "deleteSubscription",
        "tags": [
          "MarketData"
        ],
        "summary": "Release demand for one symbol.",
        "description": "Idempotent: releasing something you do not hold is not an error. You do not have to call this — registration expires by itself — but releasing promptly returns polling capacity to the platform.",
        "security": [
          {
            "traderApiKey": [
              "subscribe:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Released. No body."
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/ledger": {
      "get": {
        "operationId": "listLedgerEntries",
        "tags": [
          "History"
        ],
        "summary": "Every cash movement on the account, newest first, keyset-paginated.",
        "description": "This is the reconciliation surface: a balance a client cannot reconstruct is a balance it has to trust. `total_cash_after` IS NAMED FOR WHAT IT CONTAINS — settled cash PLUS unsettled cash — but CHECK `total_cash_after_basis` FIRST: on a row flagged `cash_only` it is the settled half alone, understated by exactly that account’s unsettled cash at the time. Rows written before 2026-08-10 carry the settled figure only and are understated by the unsettled cash held at that moment. Ledger rows are immutable, so those historical values are not restated. Rows written since carry the full figure. Reconcile across that boundary by summing `amount`, which was always correct. On a `total` row It equals GET /trader/v1/account’s cash plus unsettled, and it does NOT equal GET /trader/v1/portfolio’s `cash_balance`, which is the settled half alone; a reconciliation that assumes otherwise understates by exactly the unsettled amount. `entry_type` is a FREE STRING, not an enum, so a new value cannot break a generated client — and note that `reset`, `admin_rebase` and `rewind` are ledger BOOKENDS whose amount is a balancing artifact sized to the prior ledger, not an economic flow: summing every row blindly does not give you what a trader earned. `order_id` is null for whole classes of row — the flatten, expiration-flatten and settlement-flatten paths each write ONE GROSS row covering many positions — so never assume one entry means one order. THE CURSOR IS STRICT: a malformed `after` is a 400, never a silent restart at page one, because on a money ledger a silent restart double-counts. Pass `next_after` back unchanged; null means the last page.",
        "security": [
          {
            "traderApiKey": [
              "read:account"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A page of cash movements, newest first.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LedgerResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{8,256}$"
            },
            "description": "Opaque page cursor from a previous response's `next_after`. Pass it back verbatim; do not construct or parse one. A malformed cursor is a 400, never a silent restart from page one — which on a MONEY ledger would double-count every row a reconciliation had already added up."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            },
            "description": "Entries per page, 1-500. Defaults to 100."
          },
          {
            "name": "entry_types",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 400
            },
            "description": "Narrow to specific entry types, comma-separated. Omit for every type."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/greeks": {
      "get": {
        "operationId": "getAccountGreeks",
        "tags": [
          "Accounts"
        ],
        "summary": "PORTFOLIO NET GREEKS — your book’s aggregate exposure, weighted and signed by the SERVER so two clie",
        "description": "nts cannot disagree about the same book. The convention is `per_contract x quantity x 100 x (short ? -1 : +1)`, and x100 is the same contract multiplier the platform’s own money math uses. ⚠️ A HOLE IS NOT A ZERO: a leg whose greeks the poller has not computed is EXCLUDED from the sums and counted instead, never summed as 0 — a half-covered book would otherwise report a confident number wrong in a knowable direction, on exactly the legs a risk system most needs. Read `legs_priced` against `legs_total`, or just `complete`, before acting on the aggregate. The greeks are null when NOTHING could be priced, and 0 only when the book is genuinely empty. Scoped `read:positions`, not `read:marketdata`: this is your own book, not a quote, and it is deliberately NOT behind the OPRA gate for the same reason /positions and /portfolio are not.",
        "security": [
          {
            "traderApiKey": [
              "read:positions"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The netted book.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetGreeksResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/position-history": {
      "get": {
        "operationId": "listPositionHistory",
        "tags": [
          "History"
        ],
        "summary": "THE ROUND-TRIP RECORD — one row per position lifecycle that has realized money, which is the trade a",
        "description": "P&L review actually reasons about. NOT a fill feed: /executions publishes fills, and rebuilding trades from them means re-implementing close attribution; this is that attribution already done. ⚠️ A ROW IS NOT NECESSARILY A COMPLETED TRADE. A PARTIAL close books realized P&L while the position is still held, and those rows are HERE — omitting them hides realised money, so a reconciliation that filters on a terminal status alone will understate the account. READ `status` before treating a row as decided: `partially_closed` has NOT decided, and counting it in a win rate or a round-trip statistic produces a wrong number silently. `realized_pnl` is GROSS — use `net_pnl` for the figure after commissions. Paging is keyset on (last_activity_at, lifecycle_id) and carries a SNAPSHOT CEILING: every page of one run reads as of the `as_of` instant the first page minted, because a partially-closed row’s sort key MOVES when it finally closes, and plain keyset over a moving key silently skips it past a reader that has already gone by. A row that moves above the ceiling is served by your NEXT run rather than skipped by this one. A malformed cursor is a 400, never a silent restart at page one.",
        "security": [
          {
            "traderApiKey": [
              "read:positions"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "One keyset page of position history, newest first.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PositionHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Keyset cursor from a previous next_after."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Narrow to one underlying root."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/pnl-calendar": {
      "get": {
        "operationId": "getPnlCalendar",
        "tags": [
          "History"
        ],
        "summary": "REALIZED P&L BY ET TRADING DAY — the same computation the website’s calendar and the firm admin’s Ca",
        "description": "lendar tab read, so a day that is green here is green there. `realized_pnl` counts CLOSING rows only; `commissions` counts ALL fees charged that day, opening fees included, so `net_pnl` is the true daily figure and an opening-only day correctly shows a negative net rather than zero. Days with no fills are ABSENT rather than present with zeroes. Unpaged: one row per trading day since the account’s last reset.",
        "security": [
          {
            "traderApiKey": [
              "read:account"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Realized P&L bucketed by ET trading day.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PnlCalendarResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/executions": {
      "get": {
        "operationId": "listExecutions",
        "tags": [
          "History"
        ],
        "summary": "Every FILL on the account, newest first, keyset-paginated — one row per LEG per fill.",
        "description": "GET /orders tells you what you asked for and what it averaged; this tells you what actually printed, which is what a cost basis and a reconciliation are built from. READ `closes_inventory`, NOT `realized_pnl`, TO TELL AN OPEN FROM A CLOSE. The tempting inference is that a non-null `realized_pnl` means the fill closed something; a close can carry a null realized_pnl, so the inference does not hold. `closes_inventory` comes from the order leg itself and is null only when no order backs the fill at all (a handful of synthetic carryover rows). THIS FEED HONOURS THE ACCOUNT EPOCH: fills before a reset, and fills inside an operator rewind excision, are NOT returned — the accounting that described them has been zeroed, and the same trader’s own UI does not show them either, so a feed that returned them would put this API in contradiction with the platform it reports on. It also drops the equal-and-opposite phantom+reversal pairs a false-breach correction leaves behind, which net to zero and would otherwise be booked as two fills that never happened. `occ` is always present, including on rows whose symbol is not a parseable OCC; the parsed `symbol`/`expiration`/`strike`/`right` go null there rather than the row being dropped, because the money moved either way. THE CURSOR IS STRICT: a malformed `after` is a 400, never a silent restart at page one — this feed gets summed, and a silent restart double-counts.",
        "security": [
          {
            "traderApiKey": [
              "read:orders"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A page of fills, newest first.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListExecutionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque cursor from a previous next_after. Malformed values are refused, not ignored."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "name": "order_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Every fill belonging to one order."
          },
          {
            "name": "occ",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Every fill on one contract, by OCC."
          }
        ]
      }
    },
    "/trader/v1/positions/{id}/close": {
      "post": {
        "operationId": "closePosition",
        "tags": [
          "Positions"
        ],
        "summary": "CLOSE A POSITION YOU HOLD, in one call.",
        "description": "Before this existed a program had to read GET /positions, derive the closing legs itself, flip every side, get every quantity right and remember `intent: \"close\"` — for the operation you reach for when something has ALREADY gone wrong. `order_type` is REQUIRED and has no default: a market close is always deliberate, because a market exit on a one-sided book has filled at $0.00 here before. `limit_price` is the SIGNED net for the whole close (negative = debit, positive = credit), required for `limit` and refused for `market`. Omitting `quantity` closes the whole position — or, when you pass `lifecycle_id`, only that lifecycle’s own remaining quantity rather than the broker-netted inventory total, which may include contracts belonging to OTHER open lifecycles on the same contract. PASS `lifecycle_id` WHENEVER YOU HAVE ONE. TO CLOSE A MULTI-LEG STRUCTURE USE POST /trader/v1/lifecycles/{lifecycle_id}/close INSTEAD: closing one leg of a spread here leaves the other leg a LIVE NAKED SHORT with no protection. `status` is `filled` for a market close and `pending` for a limit that is resting — both are success. An Idempotency-Key is MANDATORY: a retried close without one sends a SECOND closing order, and on a position that already closed the second one OPENS the opposite side.",
        "security": [
          {
            "traderApiKey": [
              "write:orders:close_only"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The closing order. `filled` distinguishes an immediate fill from a resting limit.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClosePositionResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "REQUIRED, as this header or as `idempotency_key` in the body — send exactly one. Omitting both is refused with IDEMPOTENCY_KEY_REQUIRED, because a retried write without a key places a SECOND order. 8-128 characters.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClosePositionRequest"
              }
            }
          }
        }
      }
    },
    "/trader/v1/lifecycles/{lifecycle_id}/close": {
      "post": {
        "operationId": "closeLifecycle",
        "tags": [
          "Positions"
        ],
        "summary": "CLOSE A WHOLE STRUCTURE IN ONE ORDER — the call to use for anything with more than one leg.",
        "description": "It reads every open leg of the lifecycle, flips each side and closes them TOGETHER, so the structure never passes through a state where one leg is closed and the rest are naked. Doing it by hand with two calls creates exactly that state in between, and if the second call is refused — rate limit, buying power, a halt — it stays there; two such positions have been found open in production. Take `lifecycle_id` from `lifecycle_ids` on GET /trader/v1/positions. THERE IS NO `quantity`, deliberately: a partial close has to reduce every leg in the structure’s own ratio, and clamping the legs independently mints a naked short — scale out with POST /orders, where you state every leg yourself. `order_type` is REQUIRED, exactly as on the single-position close, and for the same reason. An Idempotency-Key is MANDATORY.",
        "security": [
          {
            "traderApiKey": [
              "write:orders:close_only"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The closing order for the whole structure.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CloseLifecycleResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "lifecycle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "REQUIRED, as this header or as `idempotency_key` in the body — send exactly one. Omitting both is refused with IDEMPOTENCY_KEY_REQUIRED, because a retried write without a key places a SECOND order. 8-128 characters.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloseLifecycleRequest"
              }
            }
          }
        }
      }
    },
    "/trader/v1/positions/{id}/protect": {
      "post": {
        "operationId": "protectPosition",
        "tags": [
          "Positions"
        ],
        "summary": "Attach a stop and/or a take-profit to a position you ALREADY HOLD.",
        "description": "The bracket route protects an entry as it is placed; this protects inventory that is already exposed — including inventory no bracket ever covered. A LEG OF A MULTI-LEG STRUCTURE IS REFUSED unless you name its `lifecycle_id` (take it from `lifecycle_ids` on GET /trader/v1/positions, NOT from `group_id`): a stop on one leg of a vertical would, when it fires, close that leg and leave the rest naked, so the refusal carries code PROTECT_LEG_OF_STRUCTURE and the lifecycle ids to re-send with. `quantity` is SPREAD UNITS on a structure and CONTRACTS otherwise — `quantity_unit` in the response says which was used. Omitting `quantity` protects the FULL position, which on an already-partly-protected leg fails PROTECT_STOP_OVER_CAPACITY rather than protecting the remainder; that refusal carries existing/requested/position so you can compute what is free. Protection is NEVER silently shrunk to fit. READ `protection` CAREFULLY: `stop_order_id`/`target_order_id` are the orders actually WORKING and `created_*` are the ids this call minted — on this route a dedup into an identical existing order is common, and the created row is then CANCELLED. An Idempotency-Key is MANDATORY.",
        "security": [
          {
            "traderApiKey": [
              "write:orders:close_only"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "IDEMPOTENT REPLAY: this key already attached this protection. Same body as the 201.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProtectResponse"
                }
              }
            }
          },
          "201": {
            "description": "Protection attached. `protection` names the orders actually working.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProtectResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "REQUIRED, as this header or as `idempotency_key` in the body — send exactly one. Omitting both is refused with IDEMPOTENCY_KEY_REQUIRED, because a retried write without a key places a SECOND order. 8-128 characters.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProtectRequest"
              }
            }
          }
        }
      }
    },
    "/trader/v1/accounts/{account_id}/orders/bracket": {
      "post": {
        "operationId": "placeBracketOrder",
        "tags": [
          "Orders"
        ],
        "summary": "Place an ENTRY and its protective stop/target in ONE transaction.",
        "description": "This is the capability a strategy cannot assemble from the other endpoints: placing an entry, waiting for the fill, then protecting it leaves a window in which the position is unprotected. ALL-OR-NOTHING — the children are validated and written inside the entry’s own transaction, so there is no outcome in which an entry exists without its protection. PRICE SIGNS ARE NOT UNIFORM, by inheritance: `limit_price` is a SIGNED net for the structure (negative = debit, positive = credit), while `stop_price` and `target_price` are POSITIVE net premiums. On a MULTI-LEVEL bracket `protection` describes LEVEL 0 ONLY — `bracket_levels[]` is the complete picture, and its entry 0 is reconciled with `protection`. LEVEL QUANTITIES ARE SPREAD UNITS and must sum to the entry’s spread count: one contract per unit on a single-leg entry, one whole spread per unit on a multi-leg one (levels on spreads are accepted where the platform has enabled them; elsewhere a spread with `bracket_levels` is refused). READ `protection` CAREFULLY: `stop_order_id`/`target_order_id` are the orders actually WORKING, and `created_*` are the ids this call minted. They differ when a post-commit dedup pass folds a new child into an identical pre-existing order — the created row is then CANCELLED and `merged_into_existing` is true. Track the working ids. `intent` must be `open`: a bracket entry is an open by construction and the engine refuses closing legs. Requires the FULL `write:orders` scope, not close_only. An Idempotency-Key is MANDATORY: a retried bracket without one places three duplicate orders, not one.",
        "security": [
          {
            "traderApiKey": [
              "write:orders"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "IDEMPOTENT REPLAY: this key already placed this bracket. Same body as the 201. A retried bracket that is NOT recognised as a replay places three duplicate orders, so distinguishing 200 from 201 matters more here than anywhere else on this surface.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceBracketResponse"
                }
              }
            }
          },
          "201": {
            "description": "Bracket placed. `protection` names the orders actually working.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceBracketResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "REQUIRED, as this header or as `idempotency_key` in the body — send exactly one. Omitting both is refused with IDEMPOTENCY_KEY_REQUIRED, because a retried write without a key places a SECOND order. 8-128 characters.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceBracketRequest"
              }
            }
          }
        }
      }
    },
    "/trader/v1/orders/{id}": {
      "get": {
        "operationId": "getOrder",
        "tags": [
          "Orders"
        ],
        "summary": "ONE ORDER BY ID — the read that closes the loop on every write this surface offers.",
        "description": "Placement, modify and cancel all answer with an order id; until now nothing would take one back, so a client that lost a response could only scan the account’s order list and hope the order was still inside the window — which for a terminal order it eventually is not. NOT account-addressed: an order id already determines its account. An order that does not exist and an order your credential may not reach are the SAME answer, 404 ORDER_NOT_FOUND — a 403 would confirm the order exists to a caller not entitled to know it. The body is byte-identical to one element of the order list, from the same projection.",
        "security": [
          {
            "traderApiKey": [
              "read:orders"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The order.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "modifyOrder",
        "tags": [
          "Orders"
        ],
        "summary": "Modify a working order IN PLACE.",
        "description": "Prefer this to cancel-and-replace: cancelling surrenders queue position and opens a window in which the position is unprotected, and on a bracket child the cancel voids protection the replacement may not restore if it is refused. Every field is an ABSOLUTE value, never a delta, so a retry converges rather than compounding — which is why no Idempotency-Key is required here even though placement demands one. RATE-LIMITED on the order-entry bucket, unlike DELETE: a modify is not an escape hatch (the unlimited cancel remains underneath it), while a quote-chasing loop re-pricing every tick is exactly the load the bucket exists to shape. A close-only credential may modify an order whose own intent is `close`. `changes` names the fields this request APPLIED, in your own request vocabulary — the server writes each field you supply without diffing it against the current value, so a field re-sent at its existing value is still listed. It is not a change-detector. A quantity edit cascades to protective children, which are reported in `also_modified`.",
        "security": [
          {
            "traderApiKey": [
              "write:orders:close_only"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Modified. `changes` lists the fields that actually moved.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModifyOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModifyOrderRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "cancelOrder",
        "tags": [
          "Orders"
        ],
        "summary": "Cancel a working order.",
        "description": "Deliberately NOT rate-limited: a 429 on a cancel could trap a trader in a position.",
        "security": [
          {
            "traderApiKey": [
              "write:orders:close_only"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/trader/v1/clock": {
      "get": {
        "operationId": "getClock",
        "tags": [
          "Reference"
        ],
        "summary": "WHEN YOU MAY TRADE, AND WHEN WE START CLOSING YOUR POSITIONS FOR YOU.",
        "description": "Every deadline this platform enforces used to live only in our source, so a program had to hard-code them. ⚠️ `auto_flatten_starts_at` IS NOT AN ORDER DEADLINE — it is the moment the venue begins closing your expiring positions without being asked, so if you intend to manage an expiring position yourself, be finished before it. TWO COHORTS: `regular` applies to everything, `extended` is a SECOND set of cutoffs fifteen minutes later that applies ONLY to the symbols it lists (SPY, QQQ, IWM, DIA) — apply the regular ones to those and you leave fifteen minutes of session unused; apply the extended ones to anything else and you are refused. ⚠️ READ `is_early_close`: on a 13:00 close every cutoff shifts THREE HOURS earlier, so auto-flatten begins at 12:55, and that is the day a hard-coded client is flattened hours before it expected. Every time is an absolute RFC 3339 instant rather than a clock face plus a timezone, because resolving “15:55 America/New_York” correctly across DST is where the bugs are and the server already knows the answer. `regular`, `extended` and `opens_at` are NULL on a weekend or holiday rather than a time that never arrives, so `now < opens_at` can never read as “just wait”; use `next_trading_day` instead. Reachable by ANY authenticated credential, including one scoped only to read positions: a key that will have its positions closed for it has to be able to ask when.",
        "security": [
          {
            "traderApiKey": []
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The venue clock and today’s session windows.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClockResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      }
    },
    "/trader/v1/dropcopy": {
      "get": {
        "operationId": "listDropCopyEvents",
        "tags": [
          "Events"
        ],
        "summary": "A read-only stream of every event across ALL accounts this credential may observe — for a risk syste",
        "description": "m or an audit archive. Not a premium feature: the same process that places an order is the one that reports on it, so an independent observer is the only way a DROPPED report is ever detected. The cursor is OPAQUE and is a MAP internally, because `sequence` is per-account and no single number can express a position across independent sequence spaces. Within an account the order is guaranteed; across accounts no total order is claimed. Mint a key holding only `subscribe:events` and it can observe and do nothing else.",
        "security": [
          {
            "traderApiKey": [
              "subscribe:events"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Events across the visible accounts, the account list, and an opaque next_after.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DropCopyResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque cursor from a previous next_after. A malformed or absent cursor starts from the beginning."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/trader/v1/marketdata/stream": {
      "get": {
        "operationId": "openMarketDataStream",
        "tags": [
          "Events"
        ],
        "summary": "WebSocket.",
        "description": "QUOTE PUSH for the contracts you name. AUTHENTICATE IN THE HANDSHAKE: send `Authorization: Bearer rtk_...` on the upgrade request; there is deliberately no post-connect identify frame. Requires `subscribe:marketdata` — NOT `read:marketdata`, because holding a socket open consumes shared polling and egress capacity for as long as it lives, which reading a quote once does not. ⚠️ YOU MUST SEND A `subscribe{occs}` FRAME: nothing is pushed until you name contracts, and the ceiling is the same 200 the REST batch enforces. An over-large list is REFUSED with BATCH_TOO_LARGE rather than truncated — a silently shortened subscription is a client believing it is watching contracts it is not. Symbols you may not see are returned in `refused` rather than being silently dropped. ⚠️ ENTITLEMENT IS RE-CHECKED ON THE LIVE SOCKET, not only at handshake: every other market-data check on this API is per-request, so a connection that decided once and then ran for hours would keep furnishing data after an attestation lapsed or a subscription ended. If either goes away the socket is CLOSED with 4402 — fix the entitlement, then reconnect. Frames: `subscribe{occs}`, `ping`. Server frames: `ready`, `subscribed`, `quotes`, `pong`, `error`. Close codes: 4401 unauthenticated (do not retry with this credential), 4403 missing subscribe:marketdata (do not retry), 4402 entitlement lapsed, 4013 per-credential connection cap (retry with backoff), 4503 stream disabled.",
        "security": [
          {
            "traderApiKey": [
              "subscribe:marketdata"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "101": {
            "description": "Switching Protocols — the socket is open and the first frame is `ready`."
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      }
    },
    "/trader/v1/stream": {
      "get": {
        "operationId": "openEventStream",
        "tags": [
          "Events"
        ],
        "summary": "WebSocket.",
        "description": "The push transport over the SAME per-account sequence space as GET /trader/v1/events and GET /trader/v1/dropcopy — reconnect with the cursor you last acknowledged and you get exactly what you missed, whichever transport you were on. AUTHENTICATE IN THE HANDSHAKE: send `Authorization: Bearer rtk_...` on the upgrade request. There is deliberately NO post-connect identify frame, because that is a round trip a reconnecting strategy pays exactly when it can least afford it. An unauthenticated upgrade is refused with HTTP 401/403 at the identity chokepoint — a WebSocket upgrade is an ordinary GET, so the handshake simply never completes and the client observes an abnormal close (1006) with no close frame. The 4xxx codes below are the backstop inside the route itself, and are what you see if the socket does open. Actions: `resume{after}` (opaque cursor, lenient — a malformed one starts from the beginning), `subscribe{channels, accounts}` (accounts NARROW only, never widen: the set is intersected against what the credential may see), `ping`. Delivery is AT-LEAST-ONCE — dedup on (account_id, sequence), which the server states on the wire in its `connected` frame. Close codes: 4401 unauthenticated (do not retry with this credential), 4403 missing subscribe:events (do not retry), 4013 per-credential connection cap (retry with backoff), 4503 stream disabled (retry later).",
        "security": [
          {
            "traderApiKey": [
              "subscribe:events"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "101": {
            "description": "Switching Protocols — the socket is open and the first frame is `connected`."
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      }
    },
    "/trader/v1/accounts/{account_id}/reconcile": {
      "get": {
        "operationId": "reconcileAccount",
        "tags": [
          "Accounts"
        ],
        "summary": "The authoritative position and balance snapshot, PAIRED WITH THE SEQUENCE IT CORRESPONDS TO.",
        "description": "A client that has lost its place resyncs from snapshot + sequence instead of replaying from zero — which matters here because accounts are retroactively adjusted as a matter of routine, so a cached reconciliation goes stale without warning. The sequence is read BEFORE the snapshot, so the pair is conservative by construction: the snapshot is at-or-ahead of the sequence, never behind it, and resuming from it may replay events already reflected in the balances (dedup on event `id`). `asOf` is NOT supported and is refused rather than silently ignored.",
        "security": [
          {
            "traderApiKey": [
              "read:positions"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "as_of_sequence, balances, positions, and a resume instruction.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReconcileResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          }
        ]
      }
    },
    "/trader/v1/accounts/{account_id}/events": {
      "get": {
        "operationId": "listEvents",
        "tags": [
          "Events"
        ],
        "summary": "The durable execution event stream, from a cursor.",
        "description": "THE PUSH IS A HINT; THIS IS THE RECORD — the WebSocket and webhook transports deliver from this same per-account sequence space, so reconnecting with `after=<last_seq>` returns exactly what was missed however you were connected. `sequence` is per-account and gap-free by construction (a gap means re-fetch, and only ever means that). Delivery is AT-LEAST-ONCE on every transport: dedup on `id`, or you will double-count fills.",
        "security": [
          {
            "traderApiKey": [
              "subscribe:events"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Events after the cursor, plus next_after, has_more and the account’s current_sequence.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventsResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The account this call operates on. Discover them with GET /trader/v1/accounts."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,19}$"
            },
            "description": "EXCLUSIVE lower bound: the last `sequence` you processed. Omit to start at the beginning of this account's stream. A malformed value is a 400, never a silent restart."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            },
            "description": "Events per page, 1-500. Defaults to 100."
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 400
            },
            "description": "Narrow to specific event types, comma-separated. Omit for every type."
          }
        ]
      }
    },
    "/trader/v1/controls/kill": {
      "get": {
        "operationId": "getKillSwitch",
        "tags": [
          "Controls"
        ],
        "summary": "Active halts covering you: your own account- and key-level halts, any FIRM-level halt over a firm wh",
        "description": "ose accounts you hold, plus any platform-wide halt. Readable by a HALTED key on purpose — a halt gates order placement and fills, never reads, so a client that gets a 503 can find out why it stopped instead of retrying blind. A `global` entry means everyone is halted, not just you.",
        "security": [
          {
            "traderApiKey": []
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Active halts, each with the level it applies at and whether it blocks opens or everything.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KillListResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "engageKillSwitch",
        "tags": [
          "Controls"
        ],
        "summary": "Halt trading for one of your accounts or API keys.",
        "description": "HALT, NOT FLATTEN: positions and resting orders are untouched — use POST /trader/v1/cancel-all to clear the book. Account-level halts refuse OPENS and still allow closes; key-level halts refuse everything from that key (you keep the UI and every other key). Idempotent: halting an already-halted subject returns 200 and preserves the original reason. Platform-wide halts are a PLATFORM-ADMIN action and are not on this surface; a firm-wide halt is engaged by that firm’s owner from the firm console.",
        "security": [
          {
            "traderApiKey": [
              "write:orders:close_only"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Halted. `already_engaged` distinguishes a fresh halt from a repeat.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KillEngageResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EngageHaltRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "releaseKillSwitch",
        "tags": [
          "Controls"
        ],
        "summary": "Release a halt.",
        "description": "SESSION ONLY — an API key can never release a halt, including its own. That asymmetry is the point: a brake a runaway program can let go of is not a brake, and a loop that retries everything it is refused would retry this too. Resuming requires a human with a browser session.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Released. `was_engaged: false` means nothing was halted.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KillReleaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReleaseHaltRequest"
              }
            }
          }
        }
      }
    },
    "/trader/v1/cancel-all": {
      "post": {
        "operationId": "cancelAllOrders",
        "tags": [
          "Controls"
        ],
        "summary": "Cancel every working order, optionally narrowed to one account, symbol, or API key.",
        "description": "With no filter it cancels the whole book, which is the call an operator actually wants in an incident. Deliberately NOT rate-limited — same reasoning as DELETE /orders/{id}. Each order is cancelled individually so bracket children, OCO siblings and copy mirrors all cascade; a single failure is reported in `failed` and never abandons the rest.",
        "security": [
          {
            "traderApiKey": [
              "write:orders:close_only"
            ]
          },
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "What was cancelled, and what could not be.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelAllResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelAllRequest"
              }
            }
          }
        }
      }
    },
    "/trader/keys": {
      "get": {
        "operationId": "listApiKeys",
        "tags": [
          "Credentials"
        ],
        "summary": "List your API keys.",
        "description": "Never returns a secret.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Keys.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeysListResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createApiKey",
        "tags": [
          "Credentials"
        ],
        "summary": "Create an API key.",
        "description": "The secret is returned exactly once. Session only — a key can never mint a key.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "The new key, including its one-time `secret`.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeyRequest"
              }
            }
          }
        }
      }
    },
    "/trader/v1/sandbox/account": {
      "post": {
        "operationId": "createSandboxAccount",
        "tags": [
          "Accounts"
        ],
        "summary": "PROVISION THE SANDBOX ACCOUNT a sandbox key can reach.",
        "description": "START HERE before minting anything: `environment` defaults to `sandbox` when you create a key, and until you call this there is no sandbox account in existence — so the key authenticates, passes every gate, and receives an EMPTY account list with every account-addressed call answering 404. IDEMPOTENT and capped at one per user: the first call is 201, every repeat returns the SAME account with 200, and a concurrent double-call cannot create two. The account is provisioned with no firm, which is what makes it invisible to trailing drawdown, breach monitoring, pass/fail, consistency, payouts and firm metrics — a looping strategy here cannot breach anything. Its balance matches the evaluation size the platform sells on purpose, so your strategy meets the SAME buying-power refusals it will meet live. ⚠️ THIS DOES NOT LIFT THE OPRA GATE. Order entry works immediately, but the chain, quotes and greeks are furnished against the KEY OWNER’S attestation, which knows nothing about environments — sandbox serves real OPRA data and is not exempted from it. Session-only: provisioning creates an account, and a key minting itself an account is the escalation this surface refuses everywhere else.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The existing sandbox account.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxAccountResponse"
                }
              }
            }
          },
          "201": {
            "description": "Sandbox account provisioned.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxAccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      }
    },
    "/trader/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "tags": [
          "Webhooks"
        ],
        "summary": "List your webhook endpoints.",
        "description": "Never returns a signing secret in any form — not the ciphertext, not a prefix, not a hash. If you lost it, rotate.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Your endpoints.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookListResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "REGISTER A WEBHOOK ENDPOINT for a key whose events you want POSTed rather than streamed.",
        "description": "For clients that cannot hold a socket. The signing secret is returned EXACTLY ONCE. ⚠️ SESSION ONLY, and for a sharper reason than key management: an endpoint is where a key’s ENTIRE EVENT STREAM IS SENT, and it OUTLIVES the credential that created it — a stolen key able to point that stream at an attacker’s host has escalated from reading the flow to REDIRECTING it, and rotating the key would not undo it. Delivery starts from NOW, not from the beginning of history: a fresh endpoint is not a backfill, and an unbounded first POST to a URL that has never been proven to work is not something to do by default. Use GET /trader/v1/dropcopy for history — it is paged, and it reads from the same per-account sequence space, so the two interleave exactly. One endpoint per key.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "The endpoint, including its one-time `signing_secret`.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWebhookResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookRequest"
              }
            }
          }
        }
      }
    },
    "/trader/webhooks/{id}": {
      "patch": {
        "operationId": "updateWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Change the URL, description, event filter, or enable/disable.",
        "description": "The URL is RE-VALIDATED here against the full policy — an endpoint created with a vetted host and then patched toward a private address is the obvious bypass, and this is the check that closes it. Setting `status` back to `enabled` also clears the failure counters, so a fixed endpoint is not instantly re-suspended by a tally describing a URL it no longer points at. Session only.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The updated endpoint.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchWebhookRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhook",
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete the endpoint and its signing keys.",
        "description": "Session only.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/trader/webhooks/{id}/rotate-key": {
      "post": {
        "operationId": "rotateWebhookKey",
        "tags": [
          "Webhooks"
        ],
        "summary": "Mint a new signing secret, returned exactly once.",
        "description": "The PREVIOUS key keeps verifying for 24 hours rather than being revoked on the spot — a receiver that checks one secret would otherwise reject every delivery between this call and its own redeploy. Verify against BOTH during the window; the sender signs with the new one. Session only.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The new signing key.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateWebhookKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/trader/webhooks/{id}/attempts": {
      "get": {
        "operationId": "getWebhookHealth",
        "tags": [
          "Webhooks"
        ],
        "summary": "IS THIS WEBHOOK ACTUALLY DELIVERING? Every attempt has been recorded since webhooks shipped and noth",
        "description": "ing could read it, so an endpoint that silently stopped delivering looked exactly like a platform with nothing to say — which is the worst failure this feature has, because the POINT of a webhook is that you stop polling, so you believe you are current while your endpoint has been 500ing for a day. Read `delivering` and `consecutive_failures` first; the attempt list is for working out WHEN it broke. `consecutive_failures` is computed over the whole history rather than the page, so it does not change because you asked for fewer rows. ⚠️ Your endpoint’s RESPONSE BODY is deliberately not returned — it can contain anything from your own network, so it is kept for support. `status_code` and `error_kind` are what you diagnose with. Session-only, like every other webhook management route.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery health, and the attempts behind it.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookHealthResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Page size. Default 50."
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,19}$"
            },
            "description": "EXCLUSIVE cursor: the `id` of the last attempt you processed. A STRING because the id is an int8. Newest first, so paging walks BACKWARDS through history."
          }
        ]
      }
    },
    "/trader/keys/{id}/upgrade": {
      "post": {
        "operationId": "upgradeApiKey",
        "tags": [
          "Credentials"
        ],
        "summary": "MOVE A KEY TO THE CURRENT WIRE VERSION, keeping the same secret.",
        "description": "`api_version` is stamped at mint and never written again, so retiring a wire version answers 410 to every key minted before it — and the only remedy was a full secret rotation, in every config you run, for a change you did not make. This moves the credential instead of replacing it. Takes NO version argument on purpose: no route dispatches on version, so a downgrade is only self-inflicted 410, and a free-text field would let you write a well-formed version this server has never served and brick your own key. Session-only. Read `api_version` on GET /trader/keys to see which of your keys a deprecation is about to affect.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Moved to the current wire version.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/trader/keys/{id}": {
      "patch": {
        "operationId": "updateApiKey",
        "tags": [
          "Credentials"
        ],
        "summary": "NARROW A LIVE KEY without rotating its secret — rename it, drop scopes, tighten its account binding,",
        "description": "or bring its expiry forward. NARROWING ONLY, and each axis refuses its own widening with a 400 that names what it would have added. Narrowing is measured in AUTHORITY, not in strings: a key holding `write:orders` may be demoted to `write:orders:close_only` — the de-fanging move that stops a credential OPENING while leaving a running strategy able to manage its exits — while the reverse is refused, and `write:orders:close_only` cannot be added to a key that holds no write grant at all. A trader key is a secret in somebody else’s hands, and `scopes` and `account_ids` ARE its blast radius; granting new authority to a credential already in circulation is the dangerous direction, so widening stays “mint a new key”, which produces a NEW secret instead of quietly upgrading one already deployed. Expiry may be brought forward but never extended, and never on an ALREADY-EXPIRED key — that would resurrect a secret the owner has already rotated out of their config. `environment` is not editable and is REFUSED rather than ignored: the row disagreeing with the token’s prefix is treated as tampering and would brick the key with an opaque 401 forever. Session-only, like every key-management route: a key that could edit its own scopes would be self-perpetuating. 204 on success.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Updated."
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchKeyRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "revokeApiKey",
        "tags": [
          "Credentials"
        ],
        "summary": "Revoke a key.",
        "description": "Takes effect on the next request — there is no verification cache.",
        "security": [
          {
            "sessionAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "401": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "402": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "403": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "404": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "409": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "422": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "429": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "500": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          },
          "503": {
            "description": "A refusal. `code` is stable and machine-readable; `retry` says whether resending the IDENTICAL request can ever succeed.",
            "headers": {
              "X-RateLimit-Burst": {
                "$ref": "#/components/headers/XRateLimitBurst"
              },
              "X-RateLimit-Refill-Per-Second": {
                "$ref": "#/components/headers/XRateLimitRefillPerSecond"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RixTradeError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    }
  }
}
