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

# Get detailed voice deployment analysis with billing breakdown



## OpenAPI

````yaml /openapi-specs/brainbase-openapi.documented.json post /api/voice-analysis
openapi: 3.0.0
info:
  title: Brainbase REST API
  version: 1.0.3
  description: API documentation for Brainbase REST API
servers:
  - url: https://brainbase-monorepo-api.onrender.com
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Team
    description: Endpoints related to team functionalities
  - name: Integrations
    description: Endpoints for integrations
  - name: Assets
    description: Endpoints for asset management
  - name: Workers
    description: Endpoints for worker operations
  - name: Flows
    description: Endpoints for flow management
  - name: Voice Deployments
    description: Endpoints for voice deployments
  - name: Voice V1 Deployments
    description: Endpoints for voice v1 deployments
  - name: Voice Deployment Logs
    description: Endpoints for voice deployment logs
  - name: Voice Deployment Outbound Data
    description: Endpoints for voice deployment outbound data
  - name: Chat Deployments
    description: Endpoints for chat deployments
  - name: Chat Deployment Logs
    description: Endpoints for chat deployment logs
  - name: Tags
    description: Endpoints for tag management and worker tag assignment
  - name: Echo
    description: Endpoints for Echo test suites, agents, and scorecards
  - name: Flow Versions
    description: Endpoints for flow version control
  - name: Deployment History
    description: Endpoints for deployment change history
  - name: Deployment Parameters
    description: Endpoints for deployment parameters
  - name: Log Exports
    description: Endpoints for async log export to CSV/JSON
  - name: Logs
    description: >-
      Universal log lookup — fetch any deployment log by ID without needing
      worker or deployment context
  - name: Deployments
    description: >-
      Universal deployment lookup — fetch any deployment by ID without needing
      worker context
paths:
  /api/voice-analysis:
    post:
      tags:
        - Voice Analysis
      summary: Get detailed voice deployment analysis with billing breakdown
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                startDate:
                  type: string
                  format: date-time
                  description: Start date for analysis (ISO 8601)
                endDate:
                  type: string
                  format: date-time
                  description: End date for analysis (ISO 8601)
                granularity:
                  type: string
                  enum:
                    - daily
                    - weekly
                    - monthly
                    - yearly
                  default: monthly
                  description: Time granularity for breakdown
                deploymentIds:
                  type: array
                  items:
                    type: string
                  description: Optional filter by deployment IDs
                workerId:
                  type: string
                  description: Optional filter by worker ID
                includeTransfers:
                  type: boolean
                  default: true
                  description: Include transfer analysis
                includeCallDetails:
                  type: boolean
                  default: false
                  description: Include detailed call logs in response
                timezone:
                  type: string
                  default: UTC
                  description: Timezone for date calculations
      responses:
        '200':
          description: Voice deployment analysis results
          content:
            application/json:
              schema:
                type: object
                properties:
                  summary:
                    type: object
                    properties:
                      totalCalls:
                        type: number
                      totalMinutes:
                        type: number
                      totalTransfers:
                        type: number
                        description: Number of calls with at least one transfer record
                      totalTransferMinutes:
                        type: number
                        description: >-
                          Total transfer duration from transfer records, in
                          minutes
                      totalTransferEvents:
                        type: number
                        description: Raw transfer callback/event row count
                      totalTransferEventMinutes:
                        type: number
                        description: >-
                          Total duration summed from raw transfer callback/event
                          rows, in minutes
                      averageCallDuration:
                        type: number
                  breakdown:
                    type: array
                    items:
                      type: object
                      properties:
                        period:
                          type: string
                        periodStart:
                          type: string
                          format: date-time
                        periodEnd:
                          type: string
                          format: date-time
                        totalCalls:
                          type: number
                        totalMinutes:
                          type: number
                        totalTransfers:
                          type: number
                          description: Number of calls with at least one transfer record
                        totalTransferMinutes:
                          type: number
                          description: >-
                            Total transfer duration from transfer records, in
                            minutes
                        totalTransferEvents:
                          type: number
                          description: Raw transfer callback/event row count
                        totalTransferEventMinutes:
                          type: number
                          description: >-
                            Total duration summed from raw transfer
                            callback/event rows, in minutes
                        deployments:
                          type: array
                          items:
                            type: object
                            properties:
                              deploymentId:
                                type: string
                              deploymentName:
                                type: string
                              workerId:
                                type: string
                              workerName:
                                type: string
                              calls:
                                type: number
                              minutes:
                                type: number
                              transfers:
                                type: number
                                description: >-
                                  Number of calls with at least one transfer
                                  record
                              transferMinutes:
                                type: number
                                description: >-
                                  Transfer duration from transfer records, in
                                  minutes
                              transferEvents:
                                type: number
                                description: Raw transfer callback/event row count
                              transferEventMinutes:
                                type: number
                                description: >-
                                  Duration summed from raw transfer
                                  callback/event rows, in minutes
                              averageCallDuration:
                                type: number
                  callDetails:
                    type: array
                    items:
                      type: object
                      properties:
                        logId:
                          type: string
                        deploymentId:
                          type: string
                        deploymentName:
                          type: string
                        workerId:
                          type: string
                        workerName:
                          type: string
                        startTime:
                          type: string
                          format: date-time
                        endTime:
                          type: string
                          nullable: true
                          format: date-time
                        duration:
                          type: number
                        fromNumber:
                          type: string
                          nullable: true
                        toNumber:
                          type: string
                          nullable: true
                        direction:
                          type: string
                          nullable: true
                        transfers:
                          type: number
                          description: 1 when the call has a transfer record, otherwise 0
                        transferMinutes:
                          type: number
                          description: >-
                            Transfer duration from the transfer record, in
                            minutes
                        transferEvents:
                          type: number
                          description: Raw transfer callback/event row count
                        transferEventMinutes:
                          type: number
                          description: >-
                            Duration summed from raw transfer callback/event
                            rows, in minutes
        '401':
          description: Unauthorized
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import BrainbaseLabs from 'brainbase-labs';

            const client = new BrainbaseLabs({
              apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.voiceAnalysis.analyze();

            console.log(response.breakdown);
        - lang: Python
          source: |-
            import os
            from brainbase_labs import BrainbaseLabs

            client = BrainbaseLabs(
                api_key=os.environ.get("BRAINBASE_LABS_API_KEY"),  # This is the default and can be omitted
            )
            response = client.voice_analysis.analyze()
            print(response.breakdown)
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key authentication

````