> ## 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.

# Short Rate Monte Carlo Simulation

> Simulate short rate paths using Monte Carlo methods with Vasicek, CIR, or Hull-White models. Generate multiple stochastic paths for the evolution of interest rates over time, essential for pricing path-dependent derivatives, CVA/DVA calculations, and scenario analysis. Use this for complex rate derivatives that cannot be priced analytically. [Tier: ENTERPRISE, Credits: 10]



## OpenAPI

````yaml api-specs/models.json post /quantlib/models/short-rate/monte-carlo
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Models
  description: >-
    Advanced financial modeling module for short rate models, stochastic
    volatility, jump-diffusion processes, and local volatility models. Pro Tier
    required (5 credits per request).
  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-models
    description: >-
      Advanced financial modeling including short rate models, stochastic
      volatility, jump-diffusion, and local volatility models
    x-displayName: Models
paths:
  /quantlib/models/short-rate/monte-carlo:
    post:
      tags:
        - quantlib-models
      summary: Short Rate Monte Carlo Simulation
      description: >-
        Simulate short rate paths using Monte Carlo methods with Vasicek, CIR,
        or Hull-White models. Generate multiple stochastic paths for the
        evolution of interest rates over time, essential for pricing
        path-dependent derivatives, CVA/DVA calculations, and scenario analysis.
        Use this for complex rate derivatives that cannot be priced
        analytically. [Tier: ENTERPRISE, Credits: 10]
      operationId: short_rate_mc
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - vasicek
                    - cir
                    - hull_white
                  default: vasicek
                  description: Short rate model for path simulation
                kappa:
                  type: number
                  default: 0.1
                  description: Mean reversion speed
                theta:
                  type: number
                  default: 0.05
                  description: Long-term mean rate
                sigma:
                  type: number
                  default: 0.01
                  description: Rate volatility
                r0:
                  type: number
                  default: 0.03
                  description: Initial short rate
                T:
                  type: number
                  default: 1
                  description: Simulation horizon in years
                n_steps:
                  type: integer
                  default: 252
                  description: Number of time steps (e.g., 252 for daily steps in one year)
                n_paths:
                  type: integer
                  default: 100
                  description: >-
                    Number of Monte Carlo paths to simulate. More paths = higher
                    accuracy but slower computation
                seed:
                  type: integer
                  nullable: true
                  description: >-
                    Random seed for reproducibility. Leave null for random
                    results
              example:
                model: hull_white
                kappa: 0.18
                theta: 0.045
                sigma: 0.01
                r0: 0.035
                T: 2
                n_steps: 504
                n_paths: 10000
                seed: 42
      responses:
        '200':
          description: Successfully simulated rate paths
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      model:
                        type: string
                        example: hull_white
                      n_paths:
                        type: integer
                        example: 10000
                      mean_terminal_rate:
                        type: number
                        description: Average rate at terminal time across all paths
                      min_terminal:
                        type: number
                        description: Minimum terminal rate across all paths
                      max_terminal:
                        type: number
                        description: Maximum terminal rate across all paths
                    example:
                      model: hull_white
                      n_paths: 10000
                      mean_terminal_rate: 0.0448
                      min_terminal: 0.0012
                      max_terminal: 0.0921
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/InsufficientCreditsError'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Invalid API key
    InsufficientCreditsError:
      description: Insufficient credits to complete the request
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: >-
                  Insufficient credits. This endpoint requires 5 credits.
                  Current balance: 2 credits.
    ValidationError:
      description: Request validation failed
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: array
                items:
                  type: object
                  properties:
                    loc:
                      type: array
                      items:
                        type: string
                    msg:
                      type: string
                    type:
                      type: string
          example:
            detail:
              - loc:
                  - body
                  - kappa
                msg: field required
                type: value_error.missing
  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

````