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

# Get usage

> Returns call-minutes and sent-SMS usage for your organization, grouped by day, week, or month (UTC buckets; weekly buckets start on Monday). When from_date is omitted, the range defaults to the last 30 days for day, 12 weeks for week, and 12 months for month.



## OpenAPI

````yaml get /v2/usage
openapi: 3.0.3
info:
  title: OpenMic External API v2
  version: '2.0'
  description: >-
    The OpenMic External API (v2) provides programmatic access to agents, calls,

    phone numbers, tools, contact lists, campaigns, and voices.


    ## Authentication

    All endpoints require an API key passed as a Bearer token in the

    `Authorization` header:

    ```

    Authorization: Bearer <your_api_key>

    ```


    ## Rate Limiting

    Most endpoints are limited to **100 requests per minute** per organization.

    The `POST /create-phone-call` endpoint has a stricter limit of **5 requests
    per minute**.
  contact:
    name: OpenMic Support
servers:
  - url: https://api.openmic.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Verify API key identity.
  - name: Agents
    description: Create and manage voice AI agents.
  - name: Calls
    description: Initiate and track phone calls.
  - name: Phone Numbers
    description: Manage phone numbers and agent assignments.
  - name: Tools
    description: Manage agent tools (API requests, call transfers, etc.).
  - name: Contact Lists
    description: Manage contact lists and individual contacts.
  - name: Campaigns
    description: Create and manage outbound dialing campaigns.
  - name: Voices
    description: Browse available voices for agents.
  - name: SMS
    description: Send SMS messages.
paths:
  /v2/usage:
    get:
      tags:
        - Usage
      summary: Get usage
      description: >-
        Returns call-minutes and sent-SMS usage for your organization, grouped
        by day, week, or month (UTC buckets; weekly buckets start on Monday).
        When from_date is omitted, the range defaults to the last 30 days for
        day, 12 weeks for week, and 12 months for month.
      operationId: getUsage
      parameters:
        - name: group_by
          in: query
          schema:
            type: string
            enum:
              - day
              - week
              - month
            default: day
          description: Bucket granularity for the breakdown.
        - name: from_date
          in: query
          schema:
            type: string
            format: date-time
          description: Start of the range (inclusive, ISO 8601).
        - name: to_date
          in: query
          schema:
            type: string
            format: date-time
          description: End of the range (exclusive, ISO 8601). Defaults to now.
      responses:
        '200':
          description: Usage totals and per-period breakdown.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUsageResponse'
              example:
                group_by: day
                start_date: '2026-06-17T00:00:00.000Z'
                end_date: '2026-07-17T00:00:00.000Z'
                total_minutes: 16.5
                total_sms_sent: 3
                breakdown:
                  - period_start: '2026-06-20'
                    minutes: 10
                    sms_sent: 1
                  - period_start: '2026-07-10'
                    minutes: 6.5
                    sms_sent: 2
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    GetUsageResponse:
      type: object
      required:
        - group_by
        - start_date
        - end_date
        - total_minutes
        - total_sms_sent
        - breakdown
      properties:
        group_by:
          type: string
          enum:
            - day
            - week
            - month
          description: Bucket granularity used for the breakdown.
        start_date:
          type: string
          format: date-time
          description: Start of the reported range (inclusive).
        end_date:
          type: string
          format: date-time
          description: End of the reported range (exclusive).
        total_minutes:
          type: number
          description: Total call minutes used in the range.
          example: 16.5
        total_sms_sent:
          type: integer
          description: Total outbound SMS messages sent in the range.
          example: 3
        breakdown:
          type: array
          items:
            $ref: '#/components/schemas/UsageBucket'
    UsageBucket:
      type: object
      required:
        - period_start
        - minutes
        - sms_sent
      properties:
        period_start:
          type: string
          description: >-
            UTC start date of the bucket (YYYY-MM-DD). Weekly buckets start on
            Monday.
          example: '2026-07-10'
        minutes:
          type: number
          description: Call minutes used in this period, rounded to 2 decimals.
          example: 6.5
        sms_sent:
          type: integer
          description: Outbound SMS messages sent in this period.
          example: 2
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        details:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
              message:
                type: string
              error:
                type: string
              retryAfter:
                type: integer
    InternalServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key obtained from the OpenMic dashboard.

````