> ## 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 Yield Curve

> Generate a yield curve from a short rate model (Vasicek or CIR). The yield curve represents the relationship between bond yields and their time to maturity, fundamental for bond valuation and risk management. Use this endpoint to extract continuously compounded yields from the short rate model for curve fitting or scenario analysis. [Tier: ENTERPRISE, Credits: 10]



## OpenAPI

````yaml api-specs/models.json post /quantlib/models/short-rate/yield-curve
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/yield-curve:
    post:
      tags:
        - quantlib-models
      summary: Short Rate Yield Curve
      description: >-
        Generate a yield curve from a short rate model (Vasicek or CIR). The
        yield curve represents the relationship between bond yields and their
        time to maturity, fundamental for bond valuation and risk management.
        Use this endpoint to extract continuously compounded yields from the
        short rate model for curve fitting or scenario analysis. [Tier:
        ENTERPRISE, Credits: 10]
      operationId: short_rate_yield
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - maturities
              properties:
                model:
                  type: string
                  enum:
                    - vasicek
                    - cir
                  default: vasicek
                  description: Short rate model to use for yield curve generation
                kappa:
                  type: number
                  default: 0.1
                  description: >-
                    Mean reversion speed (annualized). Controls how quickly
                    rates revert to long-term mean
                theta:
                  type: number
                  default: 0.05
                  description: Long-term mean rate (annualized). The equilibrium rate level
                sigma:
                  type: number
                  default: 0.01
                  description: >-
                    Rate volatility (annualized). Higher values produce steeper
                    curves
                r0:
                  type: number
                  default: 0.03
                  description: Initial short rate (annualized). Starting point of the curve
                maturities:
                  type: array
                  items:
                    type: number
                  description: Maturities in years where yields are calculated
              example:
                model: cir
                kappa: 0.2
                theta: 0.05
                sigma: 0.015
                r0: 0.025
                maturities:
                  - 0.5
                  - 1
                  - 2
                  - 3
                  - 5
                  - 7
                  - 10
                  - 20
                  - 30
      responses:
        '200':
          description: Successfully generated yield curve
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      model:
                        type: string
                        example: cir
                      yield_curve:
                        type: array
                        items:
                          type: object
                          properties:
                            maturity:
                              type: number
                              description: Time to maturity in years
                            yield:
                              type: number
                              description: Continuously compounded yield (annualized)
                    example:
                      model: cir
                      yield_curve:
                        - maturity: 0.5
                          yield: 0.0275
                        - maturity: 1
                          yield: 0.0298
                        - maturity: 2
                          yield: 0.0335
                        - maturity: 3
                          yield: 0.0361
                        - maturity: 5
                          yield: 0.0399
                        - maturity: 7
                          yield: 0.0424
                        - maturity: 10
                          yield: 0.0453
                        - maturity: 20
                          yield: 0.0488
                        - maturity: 30
                          yield: 0.0495
        '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

````