openapi: 3.1.0
info:
  title: Risk Parameters
  version: 3.60.0
  description: tastytrade Risk Parameters API.
  contact:
    name: tastytrade API support
    email: api.support@tastytrade.com
    url: https://developer.tastytrade.com
tags:
  - name: accounts
  - name: margin-requirements-public-configuration
  - name: span
paths:
  /accounts/{account_number}/position-limit:
    get:
      description: Returns the position and order size limits configured for an
        account, broken out by instrument type (equities, equity options,
        futures, and future options). Use this to validate order and position
        sizing before submitting orders.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
      responses:
        "200":
          description: The account's position and order size limits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PositionLimit"
                  context:
                    type: string
                    example: /accounts/{account_number}/position-limit
                required:
                  - data
                  - context
        "401":
          description: "Missing or expired access token. Tokens last 15 minutes and must
            be sent on every request. Note: a missing or malformed `User-Agent`
            header also produces a 401, but it is returned as an HTML error page
            from the proxy layer rather than this JSON error body."
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: Authenticated, but the token's scope or the account authority does
            not permit reading this account's position limit.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No account exists for the supplied `account_number`, or it is not
            visible under the authenticated customer.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "429":
          description: Rate limit exceeded. Back off exponentially and reduce the request
            rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - accounts
      operationId: getAccountsAccountNumberPositionLimit
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Account Position Limit
  /accounts/{account_number}/margin-requirements/{underlying_symbol}/effective:
    get:
      description: Returns the margin requirements in effect for a single underlying
        symbol on the given account.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: path
          name: underlying_symbol
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The effective margin requirement rates for the underlying on this
            account.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/MarginRequirement"
                  context:
                    type: string
                    example: /accounts/{account_number}/margin-requirements/{underlying_symbol}/effective
                required:
                  - data
                  - context
        "401":
          description: "Missing or expired access token. Tokens last 15 minutes and must
            be sent on every request. Note: a missing or malformed `User-Agent`
            header also produces a 401, but it is returned as an HTML error page
            from the proxy layer rather than this JSON error body."
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: Authenticated, but the token's scope or the account authority does
            not permit reading this account's margin requirements.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No account exists for the supplied `account_number`, or no
            effective margin requirement exists for the given
            `underlying_symbol`.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "429":
          description: Rate limit exceeded. Back off exponentially and reduce the request
            rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - accounts
      operationId: getAccountsAccountNumberMarginRequirementsUnderlyingSymbolEffective
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Effective Margin Requirements
  /margin-requirements-public-configuration:
    get:
      description: Returns the publicly accessible, read-only global margin
        configuration, such as the risk-free rate. This endpoint requires no
        account context.
      responses:
        "200":
          description: The global, read-only margin configuration.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/MarginRequirementsGlobalConfiguration"
                  context:
                    type: string
                    example: /margin-requirements-public-configuration
                required:
                  - data
                  - context
        "401":
          description: "Invalid access token. Note: a missing or malformed `User-Agent`
            header also produces a 401, but it is returned as an HTML error page
            from the proxy layer rather than this JSON error body. tastytrade
            requires the `User-Agent` format `<product>/<version>` on every
            request."
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "429":
          description: Rate limit exceeded. Back off exponentially and reduce the request
            rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - margin-requirements-public-configuration
      operationId: getMarginRequirementsPublicConfiguration
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Public Margin Configuration
  /span/rows:
    get:
      description: Returns paginated raw rows from the SPAN risk file published by a
        futures exchange (CME or CFE) for a specific date. SPAN is the
        risk-array methodology used to compute margin on futures and future
        options; use these rows to load or audit the source data behind futures
        margin calculations.
      parameters:
        - in: query
          name: date
          description: The date of the SPAN file
          required: true
          schema:
            type: string
            format: date
          example: 2024-01-15
        - in: query
          name: exchange
          description: Exchange source of the SPAN file
          required: true
          schema:
            type: string
            enum:
              - CME
              - CFE
          example: CME
        - in: query
          name: page-offset
          required: false
          schema:
            type: integer
            format: int32
            default: 0
          example: 10
        - in: query
          name: per-page
          required: false
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 50000
            default: 1000
          example: 10
      responses:
        "200":
          description: A paginated array of SPAN file rows for the requested date and
            exchange.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/Row"
                    required:
                      - items
                  context:
                    type: string
                    example: /span/rows
                  pagination:
                    type: object
                    description: Paging metadata, present on paginated list responses.
                    properties:
                      per-page:
                        type: integer
                      page-offset:
                        type: integer
                      item-offset:
                        type: integer
                      total-items:
                        type: integer
                      total-pages:
                        type: integer
                      current-item-count:
                        type: integer
                required:
                  - data
                  - context
        "401":
          description: "Missing or expired access token. Tokens last 15 minutes and must
            be sent on every request. Note: a missing or malformed `User-Agent`
            header also produces a 401, but it is returned as an HTML error page
            from the proxy layer rather than this JSON error body."
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "422":
          description: Invalid query parameters, for example a malformed `date`, an
            `exchange` outside the allowed set, or a `per-page` value beyond the
            permitted range.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Rate limit exceeded. Back off exponentially and reduce the request
            rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - span
      operationId: getSpanRows
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get SPAN File Rows
servers:
  - url: https://api.cert.tastyworks.com
    description: Sandbox
  - url: https://api.tastyworks.com
    description: Production
components:
  schemas:
    PositionLimit:
      type: object
      properties:
        id:
          description: Unique identifier for this position-limit record.
          type: integer
          format: int32
          example: 12345
        account-number:
          description: The account these limits apply to.
          type: string
          example: 5WX01234
        equity-option-order-size:
          description: Maximum number of contracts allowed on a single equity option order.
          type: integer
          format: int32
          example: 2500
        equity-order-size:
          description: Maximum number of shares allowed on a single equity order.
          type: integer
          format: int32
          example: 10000
        future-option-order-size:
          description: Maximum number of contracts allowed on a single future option order.
          type: integer
          format: int32
          example: 100
        future-order-size:
          description: Maximum number of contracts allowed on a single futures order.
          type: integer
          format: int32
          example: 100
        underlying-opening-order-limit:
          description: Maximum opening order size permitted per underlying.
          type: integer
          format: int32
          example: 5000
        equity-option-position-size:
          description: Maximum aggregate equity option position size, in contracts.
          type: integer
          format: int32
          example: 10000
        equity-position-size:
          description: Maximum aggregate equity position size, in shares.
          type: integer
          format: int32
          example: 50000
        future-option-position-size:
          description: Maximum aggregate future option position size, in contracts.
          type: integer
          format: int32
          example: 500
        future-position-size:
          description: Maximum aggregate futures position size, in contracts.
          type: integer
          format: int32
          example: 500
      description: The maximum order and position sizes permitted for an account,
        broken out by instrument type.
    MarginRequirement:
      type: object
      properties:
        long-equity-initial:
          description: Initial margin rate charged on long equity positions in this
            underlying, as a decimal rate of market value (the Reg T standard is
            `0.50`; higher-risk symbols carry higher rates). Decimal value
            serialized as a JSON string (e.g. "150.25").
          type: string
          format: decimal
        long-equity-maintenance:
          description: Maintenance margin rate charged on long equity positions in this
            underlying (standard `0.25`). Decimal value serialized as a JSON
            string (e.g. "150.25").
          type: string
          format: decimal
        naked-option-floor:
          description: Absolute per-contract dollar floor for naked (uncovered) option
            requirements; for puts the floor is capped at the cash-secured
            requirement. The naked requirement charged is the greatest of the
            standard, minimum, and floor calculations. Decimal value serialized
            as a JSON string (e.g. "150.25").
          type: string
          format: decimal
        naked-option-minimum:
          description: 'Rate used in the alternative minimum naked (uncovered) option
            calculation: rate × underlying price for calls, or rate × strike
            price for puts, plus the option premium, per contract. Decimal value
            serialized as a JSON string (e.g. "150.25").'
          type: string
          format: decimal
        naked-option-standard:
          description: 'Rate used in the standard naked (uncovered) option calculation:
            rate × underlying price, minus the out-of-the-money amount, plus the
            option premium, per contract. Decimal value serialized as a JSON
            string (e.g. "150.25").'
          type: string
          format: decimal
        short-equity-initial:
          description: Initial margin rate charged on short equity positions in this
            underlying (standard `0.50`). Decimal value serialized as a JSON
            string (e.g. "150.25").
          type: string
          format: decimal
        short-equity-maintenance:
          description: Maintenance margin rate charged on short equity positions in this
            underlying (standard `0.30`). Decimal value serialized as a JSON
            string (e.g. "150.25").
          type: string
          format: decimal
        underlying-symbol:
          description: The underlying symbol these requirements apply to.
          type: string
          example: AAPL
        clearing-identifier:
          description: Clearing-firm identifier associated with the underlying, when
            present.
          type: string
        is-deleted:
          description: Whether this margin requirement record has been soft-deleted and is
            no longer active.
          type: boolean
          example: false
      description: The effective margin requirement rates for a single underlying symbol.
    MarginRequirementsGlobalConfiguration:
      type: object
      properties:
        risk-free-rate:
          description: The risk-free interest rate. Decimal value serialized as a JSON
            string (e.g. "150.25").
          type: string
          format: decimal
      description: Publicly accessible, read-only global margin configuration values.
    Row:
      type: object
      properties:
        file-date:
          description: The date of the SPAN file this row was sourced from.
          type: string
          format: date
          example: 2026-06-08
        row-index:
          description: Zero-based position of this row within the SPAN file.
          type: integer
          format: int32
          example: 0
        exchange:
          description: The exchange that published the SPAN file (`CME` or `CFE`).
          type: string
          example: CME
        row-data:
          description: The raw, unparsed content of the SPAN file row.
          type: string
          example: 0CME 20260608
      description: A single raw row from an exchange-published SPAN risk file. SPAN is
        the risk-array methodology used to compute futures and future-option
        margin.
x-tastytrade-service:
  serviceName: margin-rates-api
  group: risk-parameters
  title: Risk Parameters
