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

# Get Session Cost Breakdown

> Get cost breakdown for a session.



## OpenAPI

````yaml /openapi.json get /api/sessions/{session_id}/cost-breakdown
openapi: 3.1.0
info:
  title: Nenyax API
  description: Backend API for Nenyax Voice Agent Platform
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /api/sessions/{session_id}/cost-breakdown:
    get:
      tags:
        - Sessions
      summary: Get Session Cost Breakdown
      description: Get cost breakdown for a session.
      operationId: get_session_cost_breakdown_api_sessions__session_id__cost_breakdown_get
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionCostBreakdownResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SessionCostBreakdownResponse:
      properties:
        session_id:
          type: string
          title: Session Id
        total_cost:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total Cost
        events:
          items:
            $ref: '#/components/schemas/UsageEventResponse'
          type: array
          title: Events
        cost_by_type:
          additionalProperties:
            type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          type: object
          title: Cost By Type
      type: object
      required:
        - session_id
        - total_cost
        - events
        - cost_by_type
      title: SessionCostBreakdownResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UsageEventResponse:
      properties:
        id:
          type: string
          title: Id
        session_id:
          type: string
          title: Session Id
        user_id:
          type: string
          title: User Id
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
        provider:
          type: string
          title: Provider
        event_type:
          $ref: '#/components/schemas/UsageEventType'
        quantity:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Quantity
        unit_cost:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Unit Cost
        total_cost:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total Cost
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - session_id
        - user_id
        - provider
        - event_type
        - quantity
        - unit_cost
        - total_cost
        - created_at
      title: UsageEventResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UsageEventType:
      type: string
      enum:
        - stt_minutes
        - llm_tokens
        - tts_characters
      title: UsageEventType

````