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

# Get Workspace Usage

> Returns credit usage broken down by product type over time. The response is a tabular structure with columns, column_types, column_units, and rows.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/workspace/analytics/query/usage-by-product-over-time
openapi: 3.1.0
info:
  title: Threetone API Documentation
  description: >-
    This is the documentation for the Threetone API. You can use this API to use
    our service programmatically with API keys sent in the x-api-key header. You
    can create and manage API keys in the dashboard at
    https://threetone.in/app/developers/api-keys.
  version: '1.0'
servers:
  - url: https://api.threetone.in
    description: Production
security: []
paths:
  /v1/workspace/analytics/query/usage-by-product-over-time:
    post:
      tags:
        - access:all
      summary: Get Workspace Usage
      description: >-
        Returns credit usage broken down by product type over time. The response
        is a tabular structure with columns, column_types, column_units, and
        rows.
      operationId: usage_by_product_over_time
      parameters:
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Your API key for programmatic access. Send it in the x-api-key
              header; you can create and manage keys from the Developers page.
            title: X-Api-Key
          description: >-
            Your API key for programmatic access. Send it in the x-api-key
            header; you can create and manage keys from the Developers page.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Body_Get_Workspace_Usage_v1_workspace_analytics_query_usage_by_product_over_time_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceAnalyticsQueryResponseModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_Get_Workspace_Usage_v1_workspace_analytics_query_usage_by_product_over_time_post:
      properties:
        start_time:
          type: integer
          minimum: 1577836800000
          title: Start Time
          description: >-
            Start of the time range as a Unix timestamp in milliseconds. Must be
            at least 2020-01-01.
        end_time:
          type: integer
          minimum: 1577836800000
          title: End Time
          description: >-
            End of the time range as a Unix timestamp in milliseconds. Must be
            at least 2020-01-01.
        interval_seconds:
          type: integer
          minimum: 1
          title: Interval Seconds
          description: >-
            Bucket size in seconds. Each row in the response covers this many
            seconds of the selected time range. For example, pass 3600 for
            hourly buckets or 86400 for daily buckets. Whether `time_zone`
            shifts bucket boundaries depends on this value: whole-day multiples
            (e.g. 86400) align to local midnight; whole-hour multiples up to 24
            hours (e.g. 3600, 14400) align to local hour boundaries from
            midnight; sub-hour values and other sizes remain UTC-anchored
            regardless of `time_zone`.
          default: 60
        group_by:
          anyOf:
            - items:
                type: string
                enum:
                  - product_type
                  - model
                  - voice_id
                  - user_id
                  - fiat_currency
                  - fiat_charge_type
                  - region
                  - reporting_workspace_id
                  - request_source
                  - resource_id
                  - subresource_id
                  - request_queue_type
                  - voice_multiplier
                  - hashed_xi_api_key
                  - billing_group_id
                  - surface
                  - actor
              type: array
            - type: 'null'
          title: Group By
        filters:
          anyOf:
            - items:
                $ref: '#/components/schemas/ColumnFilter'
              type: array
            - type: 'null'
          title: Filters
        time_zone:
          type: string
          title: Time Zone
          description: >-
            IANA time zone identifier (e.g. 'America/New_York', 'Europe/London',
            'UTC') used to align bucket boundaries for eligible
            `interval_seconds` values. Whole-day multiples start at local
            midnight; whole-hour multiples up to 24 hours align to local hour
            boundaries from midnight. Sub-hour intervals and other bucket sizes
            remain UTC-anchored regardless of this setting. Defaults to UTC.
          default: UTC
      type: object
      required:
        - start_time
        - end_time
      title: >-
        Body_Get_Workspace_Usage_v1_workspace_analytics_query_usage_by_product_over_time_post
    WorkspaceAnalyticsQueryResponseModel:
      properties:
        columns:
          items:
            type: string
          type: array
          title: Columns
        column_types:
          items:
            type: string
            enum:
              - String
              - Float
              - DateTime
              - Int
              - Bool
              - JSON
              - Map
              - Array
          type: array
          title: Column Types
        rows:
          items:
            items:
              anyOf:
                - type: string
                - type: integer
                - type: number
                - type: boolean
                - type: string
                  format: date-time
                - type: 'null'
            type: array
          type: array
          title: Rows
        column_units:
          items:
            anyOf:
              - $ref: '#/components/schemas/ColumnUnit'
              - type: 'null'
          type: array
          title: Column Units
      type: object
      required:
        - columns
        - column_types
        - rows
        - column_units
      title: WorkspaceAnalyticsQueryResponseModel
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ColumnFilter:
      properties:
        column:
          type: string
          title: Column
        operation:
          type: string
          enum:
            - in
            - not_in
            - le
            - ge
            - lt
            - gt
            - eq
            - neq
          title: Operation
        values:
          items:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - type: string
                format: date-time
              - type: boolean
              - type: 'null'
          type: array
          title: Values
      type: object
      required:
        - column
        - operation
        - values
      title: ColumnFilter
    ColumnUnit:
      type: string
      enum:
        - ms
        - s
        - min
        - duration
        - credits
        - usd
        - eur
        - inr
        - pln
        - gbp
        - ratio
        - rating
      title: ColumnUnit
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````