> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fincept.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Calculate Option-Adjusted Spread (OAS)

> Calculate the Option-Adjusted Spread - the constant spread over the risk-free curve that accounts for embedded options in a bond. OAS removes the value of embedded options (calls, puts, prepayment options) to isolate the pure credit spread. Calculated using Monte Carlo simulation or binomial trees to value the option component. Essential for MBS, callable bonds, and any security with embedded optionality. Provides a fair comparison between bonds with and without embedded options. [Tier: PRO, Credits: 5]



## OpenAPI

````yaml api-specs/solver.json post /quantlib/solver/finance/oas
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Solver
  description: >-
    Solver module endpoints for FinceptQuantLib API. The Solver module (Basic
    Tier, 1 credit per request) provides advanced financial solvers including
    bond analytics (yield, duration, convexity), implied volatility
    calculations, spread computations (Z-spread, ASW, OAS), curve bootstrapping,
    interest rate conversions, and model calibration (Vasicek, CIR). Essential
    for fixed income analysis, derivatives pricing, and risk management.
  version: 3.0.0
  contact:
    name: Fincept API Support
    url: https://fincept.in
servers:
  - url: https://api.fincept.in
    description: Fincept API Production Server
security:
  - APIKeyHeader: []
tags:
  - name: quantlib-solver
    description: >-
      Advanced financial solvers for bond analytics, implied volatility, spread
      calculations, and model calibration
    x-displayName: Solver
paths:
  /quantlib/solver/finance/oas:
    post:
      tags:
        - quantlib-solver
      summary: Calculate Option-Adjusted Spread (OAS)
      description: >-
        Calculate the Option-Adjusted Spread - the constant spread over the
        risk-free curve that accounts for embedded options in a bond. OAS
        removes the value of embedded options (calls, puts, prepayment options)
        to isolate the pure credit spread. Calculated using Monte Carlo
        simulation or binomial trees to value the option component. Essential
        for MBS, callable bonds, and any security with embedded optionality.
        Provides a fair comparison between bonds with and without embedded
        options. [Tier: PRO, Credits: 5]
      operationId: oas_endpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - price
                - scenario_cashflows
                - times
                - probabilities
                - base_rates
                - base_times
              properties:
                price:
                  type: number
                  description: Current market price of the security
                  example: 102.5
                scenario_cashflows:
                  type: array
                  description: Array of cash flow arrays, one for each scenario
                  items:
                    type: array
                    items:
                      type: number
                  example:
                    - - 3
                      - 3
                      - 103
                    - - 3
                      - 3
                      - 3
                      - 103
                    - - 3
                      - 103
                times:
                  type: array
                  description: Array of payment times in years (same for all scenarios)
                  items:
                    type: number
                  example:
                    - 1
                    - 2
                    - 3
                    - 4
                probabilities:
                  type: array
                  description: Array of scenario probabilities (must sum to 1.0)
                  items:
                    type: number
                  example:
                    - 0.4
                    - 0.4
                    - 0.2
                base_rates:
                  type: array
                  description: Array of zero rates for the base discount curve
                  items:
                    type: number
                  example:
                    - 0.03
                    - 0.035
                    - 0.04
                    - 0.042
                base_times:
                  type: array
                  description: Array of times for the base discount curve
                  items:
                    type: number
                  example:
                    - 1
                    - 2
                    - 3
                    - 4
            example:
              price: 102.5
              scenario_cashflows:
                - - 3
                  - 3
                  - 103
                - - 3
                  - 3
                  - 3
                  - 103
                - - 3
                  - 103
              times:
                - 1
                - 2
                - 3
                - 4
              probabilities:
                - 0.4
                - 0.4
                - 0.2
              base_rates:
                - 0.03
                - 0.035
                - 0.04
                - 0.042
              base_times:
                - 1
                - 2
                - 3
                - 4
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      oas:
                        type: number
                        description: >-
                          The option-adjusted spread as a decimal (multiply by
                          10000 for basis points)
                        example: 0.0085
              example:
                success: true
                data:
                  oas: 0.0085
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/InsufficientTierError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
      security:
        - APIKeyHeader: []
components:
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Invalid API key
    InsufficientTierError:
      description: API tier insufficient for this endpoint
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Endpoint requires Basic tier or higher
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Get your key at
        https://api.fincept.in/auth/register

````