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

# Get Org Conversation Usage Stats

> Get detailed usage statistics for organization dashboard.

Returns detailed metrics including active users, agent runs, token usage,
daily breakdown, and team usage for the specified time window.

**Access Control**: Requires VIEW_ORG_CONVERSATIONS permission (Admin or Owner role).

Args:
    org_id: The organization ID
    time_window: Time window filter (7d, 30d, 90d, ytd)
    days: Number of days to look back (default 7)

Returns:
    OrgUsageStats: Detailed usage statistics for the org



## OpenAPI

````yaml /openapi/openhands-cloud.json get /api/organizations/{org_id}/conversations/usage-stats
openapi: 3.1.0
info:
  title: OpenHands
  description: 'OpenHands: Code Less, Make More'
  version: 0.0.1
servers: []
security: []
paths:
  /api/organizations/{org_id}/conversations/usage-stats:
    get:
      tags:
        - Orgs
      summary: Get Org Conversation Usage Stats
      description: >-
        Get detailed usage statistics for organization dashboard.


        Returns detailed metrics including active users, agent runs, token
        usage,

        daily breakdown, and team usage for the specified time window.


        **Access Control**: Requires VIEW_ORG_CONVERSATIONS permission (Admin or
        Owner role).


        Args:
            org_id: The organization ID
            time_window: Time window filter (7d, 30d, 90d, ytd)
            days: Number of days to look back (default 7)

        Returns:
            OrgUsageStats: Detailed usage statistics for the org
      operationId: >-
        get_org_conversation_usage_stats_api_organizations__org_id__conversations_usage_stats_get
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Org Id
        - name: time_window
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Time window filter
            description: 'Options: 7d, 30d, 90d, ytd (overrides days when provided)'
          description: 'Options: 7d, 30d, 90d, ytd (overrides days when provided)'
        - name: days
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 1
              - type: 'null'
            description: Number of days to look back
            title: Days
          description: Number of days to look back
        - name: X-Org-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Org-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgUsageStats'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    OrgUsageStats:
      properties:
        active_users:
          type: integer
          title: Active Users
          default: 0
        agent_runs:
          type: integer
          title: Agent Runs
          default: 0
        usage_conversation_count:
          type: integer
          title: Usage Conversation Count
          default: 0
        total_tokens:
          type: integer
          title: Total Tokens
          default: 0
        estimated_spend:
          type: number
          title: Estimated Spend
          default: 0
        daily_usage:
          items:
            $ref: '#/components/schemas/DailyUsageData'
          type: array
          title: Daily Usage
        team_usage:
          items:
            $ref: '#/components/schemas/TeamUsageData'
          type: array
          title: Team Usage
        model_usage:
          items:
            $ref: '#/components/schemas/ModelUsageData'
          type: array
          title: Model Usage
        agent_usage:
          items:
            $ref: '#/components/schemas/AgentUsageData'
          type: array
          title: Agent Usage
      type: object
      title: OrgUsageStats
      description: Detailed usage statistics for organization dashboard.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DailyUsageData:
      properties:
        date:
          type: string
          title: Date
        tokens:
          type: integer
          title: Tokens
          default: 0
        conversations:
          type: integer
          title: Conversations
          default: 0
      type: object
      required:
        - date
      title: DailyUsageData
      description: Daily usage data for a single day.
    TeamUsageData:
      properties:
        user_id:
          type: string
          title: User Id
        user_email:
          anyOf:
            - type: string
            - type: 'null'
          title: User Email
        user_name:
          anyOf:
            - type: string
            - type: 'null'
          title: User Name
        conversation_count:
          type: integer
          title: Conversation Count
          default: 0
        total_tokens:
          type: integer
          title: Total Tokens
          default: 0
        percentage:
          type: number
          title: Percentage
          default: 0
      type: object
      required:
        - user_id
      title: TeamUsageData
      description: Usage data for a single user/team.
    ModelUsageData:
      properties:
        model_name:
          type: string
          title: Model Name
        conversation_count:
          type: integer
          title: Conversation Count
          default: 0
        total_tokens:
          type: integer
          title: Total Tokens
          default: 0
        total_cost:
          type: number
          title: Total Cost
          default: 0
      type: object
      required:
        - model_name
      title: ModelUsageData
      description: Usage data for a single model.
    AgentUsageData:
      properties:
        agent_name:
          type: string
          title: Agent Name
        conversation_count:
          type: integer
          title: Conversation Count
          default: 0
        total_cost:
          type: number
          title: Total Cost
          default: 0
      type: object
      required:
        - agent_name
      title: AgentUsageData
      description: Usage data for a single agent.
    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:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-Access-Token

````