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

# Get Tenant Stats

> Get tenant usage statistics and analytics.

**Purpose:** View usage statistics, performance metrics, and billing data

**What it returns:**
```json
{
  "tenant_id": "uuid",
  "total_agents": 5,              // Number of AI agents created
  "total_calls_today": 23,        // Today's call volume
  "total_calls_month": 456,       // Monthly call volume
  "avg_call_duration": 180.5,     // Average call length (seconds)
  "avg_sentiment_score": 0.75,    // Customer satisfaction (-1 to 1)
  "active_sessions": 3,            // Current active calls/sessions
  "monthly_usage_cents": 1250,    // Billing amount for current month
  "last_call_at": "2025-10-02T10:30:00Z"  // Last call timestamp
}
```

**Used For:**
- **Billing calculations:** Track monthly_usage_cents for invoicing
- **Usage monitoring:** Check if approaching monthly_call_limit
- **Customer dashboards:** Display usage stats to tenant users
- **Capacity planning:** Monitor concurrent calls vs max_concurrent_calls
- **Performance tracking:** Average call duration and sentiment scores
- **Support insights:** Identify usage patterns and issues

**Real-World Scenarios:**
- Admin sees tenant approaching limit → proactively offer upgrade
- Customer views their dashboard → sees call volume trends
- Billing system queries stats → generates monthly invoice
- Support team checks stats → troubleshoots customer issues



## OpenAPI

````yaml https://api.mrassistant.ai/openapi.json get /tenants/{tenant_id}/stats
openapi: 3.1.0
info:
  title: Backend - Multilingual Voice Agent System
  description: FastAPI backend for multilingual voice agents with tool use
  version: 1.0.0
servers: []
security: []
paths:
  /tenants/{tenant_id}/stats:
    get:
      tags:
        - tenants
      summary: Get Tenant Stats
      description: >-
        Get tenant usage statistics and analytics.


        **Purpose:** View usage statistics, performance metrics, and billing
        data


        **What it returns:**

        ```json

        {
          "tenant_id": "uuid",
          "total_agents": 5,              // Number of AI agents created
          "total_calls_today": 23,        // Today's call volume
          "total_calls_month": 456,       // Monthly call volume
          "avg_call_duration": 180.5,     // Average call length (seconds)
          "avg_sentiment_score": 0.75,    // Customer satisfaction (-1 to 1)
          "active_sessions": 3,            // Current active calls/sessions
          "monthly_usage_cents": 1250,    // Billing amount for current month
          "last_call_at": "2025-10-02T10:30:00Z"  // Last call timestamp
        }

        ```


        **Used For:**

        - **Billing calculations:** Track monthly_usage_cents for invoicing

        - **Usage monitoring:** Check if approaching monthly_call_limit

        - **Customer dashboards:** Display usage stats to tenant users

        - **Capacity planning:** Monitor concurrent calls vs
        max_concurrent_calls

        - **Performance tracking:** Average call duration and sentiment scores

        - **Support insights:** Identify usage patterns and issues


        **Real-World Scenarios:**

        - Admin sees tenant approaching limit → proactively offer upgrade

        - Customer views their dashboard → sees call volume trends

        - Billing system queries stats → generates monthly invoice

        - Support team checks stats → troubleshoots customer issues
      operationId: get_tenant_stats_tenants__tenant_id__stats_get
      parameters:
        - name: tenant_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Tenant Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````