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

# Get portfolio risk statistics



## OpenAPI

````yaml /api-reference/openapi.json get /v1/risk/stats
openapi: 3.1.0
info:
  title: Mithril API
  version: 1.0.0
  description: >-
    Public API gateway for Mithril — a unified execution and risk API for
    prediction markets. This gateway validates API-key format, rate-limits, and
    forwards every request to the private webapp, which owns all domain logic.
    Request and response bodies are JSON with snake_case fields; every error
    uses the shared `Error` envelope.
servers:
  - url: https://api.trymithril.com
    description: Production
security: []
tags:
  - name: API keys
  - name: Analytics
  - name: Complex Orders
  - name: Fills
  - name: Markets
  - name: Orders
  - name: Portfolio
  - name: Positions
  - name: Receipts
  - name: Risk
  - name: Risk limits
  - name: Subaccounts
  - name: System
  - name: Workspaces
paths:
  /v1/risk/stats:
    get:
      tags:
        - Risk
      summary: Get portfolio risk statistics
      operationId: get_v1_risk_stats
      responses:
        '200':
          description: >-
            Successful response. Body shape is defined by the upstream Mithril
            service.
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded. Retry after the `Retry-After` interval.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: Upstream service unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Error. Uses the shared error envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
    ErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable, machine-readable error code.
          examples:
            - not_found
        message:
          type: string
          description: Human-readable explanation.
        request_id:
          type: string
          description: Correlation ID, echoed in the X-Request-Id header.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key issued to a workspace, prefixed `mk_live_` (production) or
        `mk_test_` (test).

````