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

# Comprehensive Tail Risk Analysis

> Performs a complete suite of tail risk metrics including CVaR (Expected Shortfall), Tail VaR, maximum drawdown, omega ratio, and Sortino ratio. Provides a holistic view of downside risk beyond standard VaR. Essential for hedge funds, pension funds, and institutions focused on tail risk management. [Tier: PRO, Credits: 5]



## OpenAPI

````yaml api-specs/risk.json post /quantlib/risk/tail-risk/comprehensive
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Risk Module
  description: >-
    Professional-grade risk management endpoints including Value at Risk (VaR),
    stress testing, copulas, extreme value theory (EVT), XVA calculations,
    sensitivities, and portfolio hedging. Part of the Pro Tier (5 credits per
    request).
  version: 3.0.0
  contact:
    name: Fincept API Support
    url: https://fincept.in
    email: support@fincept.in
servers:
  - url: https://api.fincept.in
    description: Fincept API Production Server
security:
  - APIKeyHeader: []
tags:
  - name: quantlib-risk
    description: Risk Management Module - Pro Tier (5 credits/request)
    x-displayName: Risk
paths:
  /quantlib/risk/tail-risk/comprehensive:
    post:
      tags:
        - quantlib-risk
      summary: Comprehensive Tail Risk Analysis
      description: >-
        Performs a complete suite of tail risk metrics including CVaR (Expected
        Shortfall), Tail VaR, maximum drawdown, omega ratio, and Sortino ratio.
        Provides a holistic view of downside risk beyond standard VaR. Essential
        for hedge funds, pension funds, and institutions focused on tail risk
        management. [Tier: PRO, Credits: 5]
      operationId: tail_risk
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - returns
              properties:
                returns:
                  type: array
                  description: Historical return series
                  items:
                    type: number
                  minItems: 100
                  example:
                    - 0.01
                    - -0.03
                    - 0.02
                    - -0.05
                confidence:
                  type: number
                  description: Confidence level for risk metrics
                  example: 0.99
                  default: 0.99
                portfolio_value:
                  type: number
                  description: Portfolio value for absolute risk amounts
                  example: 1000000
                  default: 1000000
            example:
              returns:
                - 0.008
                - -0.025
                - 0.015
                - -0.042
                - 0.011
                - -0.018
                - 0.022
              confidence: 0.95
              portfolio_value: 10000000
      responses:
        '200':
          description: Comprehensive tail risk metrics
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      cvar:
                        type: number
                        description: Conditional VaR (Expected Shortfall)
                        example: 385000
                      var:
                        type: number
                        description: Value at Risk
                        example: 325000
                      max_drawdown:
                        type: number
                        description: Maximum drawdown from peak
                        example: 0.185
                      omega_ratio:
                        type: number
                        description: Omega ratio (probability-weighted gains/losses)
                        example: 1.45
                      sortino_ratio:
                        type: number
                        description: Sortino ratio (return/downside deviation)
                        example: 1.82
                      tail_ratio:
                        type: number
                        description: Ratio of 95th percentile gain to 5th percentile loss
                        example: 0.78
              example:
                success: true
                data:
                  cvar: 385000
                  var: 325000
                  max_drawdown: 0.185
                  omega_ratio: 1.45
                  sortino_ratio: 1.82
                  tail_ratio: 0.78
        '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 API credits for this request
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Insufficient credits. This endpoint requires 5 credits.
    ValidationError:
      description: Request validation error
      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
  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

````