> ## 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 Exposure Profile (EPE and PFE)

> Generates both Expected Positive Exposure (EPE) and Potential Future Exposure (PFE) profiles from simulated exposure paths. EPE is the average exposure at each time point, while PFE is the high quantile. Both are fundamental for counterparty credit risk management, capital allocation, and XVA calculations. [Tier: PRO, Credits: 5]



## OpenAPI

````yaml api-specs/risk.json post /quantlib/risk/portfolio-risk/exposure-profile
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/portfolio-risk/exposure-profile:
    post:
      tags:
        - quantlib-risk
      summary: Calculate Exposure Profile (EPE and PFE)
      description: >-
        Generates both Expected Positive Exposure (EPE) and Potential Future
        Exposure (PFE) profiles from simulated exposure paths. EPE is the
        average exposure at each time point, while PFE is the high quantile.
        Both are fundamental for counterparty credit risk management, capital
        allocation, and XVA calculations. [Tier: PRO, Credits: 5]
      operationId: exposure_profile
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - paths
              properties:
                paths:
                  type: array
                  description: Simulated exposure paths (Monte Carlo scenarios)
                  items:
                    type: array
                    items:
                      type: number
                  example:
                    - - 100000
                      - 105000
                      - 110000
                    - - 100000
                      - 98000
                      - 103000
                confidence:
                  type: number
                  description: Confidence level for PFE calculation
                  example: 0.95
                  default: 0.95
            example:
              paths:
                - - 100000
                  - 110000
                  - 125000
                  - 135000
                  - 145000
                - - 100000
                  - 95000
                  - 105000
                  - 115000
                  - 130000
                - - 100000
                  - 105000
                  - 98000
                  - 110000
                  - 120000
                - - 100000
                  - 92000
                  - 88000
                  - 95000
                  - 105000
              confidence: 0.95
      responses:
        '200':
          description: Exposure profiles
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      epe_profile:
                        type: array
                        description: Expected Positive Exposure at each time point
                        items:
                          type: number
                        example:
                          - 100000
                          - 100500
                          - 104000
                          - 113750
                          - 125000
                      pfe_profile:
                        type: array
                        description: 95th percentile exposure at each time point
                        items:
                          type: number
                        example:
                          - 100000
                          - 109250
                          - 123250
                          - 133250
                          - 143250
              example:
                success: true
                data:
                  epe_profile:
                    - 100000
                    - 100500
                    - 104000
                    - 113750
                    - 125000
                  pfe_profile:
                    - 100000
                    - 109250
                    - 123250
                    - 133250
                    - 143250
        '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

````