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

# Get usage summary

> Returns metered usage for one calendar month (UTC), by meter and by number. Omit `period` for the current month. Usage is measured, not charged: `billingEnabled` is false and no credits are deducted for it. A project token reads its own project; `session` narrows to one number.

Requires `sessions:read`. Project tokens only access resources in their own project.



## OpenAPI

````yaml api-reference/features/operate.json GET /platform/usage
openapi: 3.0.3
info:
  title: Operate API methods
  version: 1.0.0
  description: Task-focused operate methods across supported Polymorfa connection types.
servers: []
security: []
paths:
  /platform/usage:
    get:
      tags:
        - Usage
      summary: Get usage summary
      description: >-
        Returns metered usage for one calendar month (UTC), by meter and by
        number. Omit `period` for the current month. Usage is measured, not
        charged: `billingEnabled` is false and no credits are deducted for it. A
        project token reads its own project; `session` narrows to one number.


        Requires `sessions:read`. Project tokens only access resources in their
        own project.
      operationId: managementGetUsageSummary
      parameters:
        - name: projectId
          in: query
          required: false
          description: Project to read. Omit to total every project in the organization.
          schema:
            type: string
        - name: session
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 128
            description: Number (session name).
          description: |-
            Identifier of the connected Polymorfa session.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | String length | `1` through `128` characters |
        - name: period
          in: query
          required: false
          schema:
            type: string
            pattern: ^\d{4}-(0[1-9]|1[0-2])$
            description: Calendar month in UTC, `YYYY-MM`. Defaults to the current month.
          description: |-
            Specifies period for this query parameter.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Pattern | `^\d{4}-(0[1-9]\|1[0-2])$` |
      responses:
        '200':
          description: Success
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Stable request correlation identifier.
            Polymorfa-Version:
              schema:
                type: string
              description: API version applied to this response.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/management__UsageSummary'
                    description: Structured data carried by this object.
                required:
                  - data
        '400':
          $ref: '#/components/responses/management__BadRequest'
        '401':
          $ref: '#/components/responses/management__Unauthorized'
        '403':
          $ref: '#/components/responses/management__Forbidden'
      security:
        - management__ApiKeyAuth: []
      servers:
        - url: https://api.polymorfa.com
components:
  schemas:
    management__UsageSummary:
      type: object
      additionalProperties: false
      properties:
        period:
          type: string
          pattern: ^\d{4}-\d{2}$
          description: |-
            Calendar month in UTC.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Pattern | `^\d{4}-\d{2}$` |
        start:
          type: string
          format: date-time
          description: |-
            Specifies start for this management usage summary.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `date-time` |
        end:
          type: string
          format: date-time
          description: |-
            Specifies end for this management usage summary.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `date-time` |
        projectId:
          type: string
          format: uuid
          nullable: true
          description: |-
            Identifier of the Polymorfa project that owns this resource.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string`; Format: `uuid` |
            | Alternative 2 | `null` |

            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        session:
          type: string
          nullable: true
          description: |-
            Identifier of the connected Polymorfa session.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string` |
            | Alternative 2 | `null` |
        billingEnabled:
          type: boolean
          description: Always false while usage is measured but not charged.
        meters:
          type: array
          items:
            $ref: '#/components/schemas/management__UsageMeterTotal'
          description: Meters associated with this management usage summary.
        numbers:
          type: array
          maxItems: 100
          description: |-
            Totals per number, most call time first.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Array size | At most `100` items |
          items:
            type: object
            additionalProperties: false
            properties:
              session:
                type: string
                description: Identifier of the connected Polymorfa session.
              projectId:
                type: string
                format: uuid
                nullable: true
                description: |-
                  Identifier of the Polymorfa project that owns this resource.

                  <!-- polymorfa-input-table -->
                  **Accepted alternatives**
                  | Alternative | Accepted input |
                  | --- | --- |
                  | Alternative 1 | Type: `string`; Format: `uuid` |
                  | Alternative 2 | `null` |

                  **Value constraints**
                  | Constraint | Accepted input |
                  | --- | --- |
                  | Format | `uuid` |
              meters:
                type: array
                items:
                  $ref: '#/components/schemas/management__UsageMeterTotal'
                description: Meters associated with this number.
            required:
              - session
              - projectId
              - meters
        numbersTruncated:
          type: boolean
          description: True when more than 100 numbers had usage.
      required:
        - period
        - start
        - end
        - projectId
        - session
        - billingEnabled
        - meters
        - numbers
        - numbersTruncated
    management__UsageMeterTotal:
      type: object
      additionalProperties: false
      properties:
        meter:
          allOf:
            - $ref: '#/components/schemas/management__UsageMeter'
          description: |-
            Specifies meter for this management usage meter total.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `call.duration` | Call.duration. |
            | `call.cloud_pulses` | Call.cloud pulses. |
            | `campaign.call` | Campaign.call. |
            | `tts.characters` | Tts.characters. |
            | `tts.seconds` | Tts.seconds. |
            | `stt.seconds` | Stt.seconds. |
            | `agent.seconds` | Agent.seconds. |
            | `agent.tokens` | Agent.tokens. |
            | `agent.provider_cost` | Agent.provider cost. |
            | `channels.peak` | Channels.peak. |
            | `storage.byte_days` | Storage.byte days. |
        unit:
          allOf:
            - $ref: '#/components/schemas/management__UsageUnit'
          description: |-
            Specifies unit for this management usage meter total.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `second` | Second. |
            | `pulse` | Pulse. |
            | `call` | Call. |
            | `character` | Character. |
            | `token` | Token. |
            | `provider_unit` | Provider unit. |
            | `channel` | Channel. |
            | `byte_day` | Byte day. |
        keySource:
          allOf:
            - $ref: '#/components/schemas/management__UsageKeySource'
          description: |-
            Specifies key source for this management usage meter total.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `none` | None. |
            | `managed` | Managed. |
            | `customer` | Customer. |
        quantity:
          type: number
          minimum: 0
          description: |-
            Number of units included for this item.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Numeric value | `0` or greater |
        records:
          type: integer
          minimum: 0
          description: |-
            Specifies records for this management usage meter total.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Numeric value | `0` or greater |
      required:
        - meter
        - unit
        - keySource
        - quantity
        - records
    management__ErrorEnvelope:
      type: object
      required:
        - error
        - data
        - docs
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - param
            - request_id
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - conflict_error
                - rate_limit_error
                - api_error
                - upstream_error
              description: |-
                Type discriminator for this object.

                <!-- polymorfa-input-table -->
                **Allowed values**
                | Value | Meaning |
                | --- | --- |
                | `invalid_request_error` | Invalid request error. |
                | `authentication_error` | Authentication error. |
                | `permission_error` | Permission error. |
                | `conflict_error` | Conflict error. |
                | `rate_limit_error` | Rate limit error. |
                | `api_error` | Api error. |
                | `upstream_error` | Upstream error. |
            code:
              type: string
              description: Stable failure code. Use this value for programmatic handling.
            message:
              type: string
              description: Safe explanation of the failure.
            param:
              type: string
              nullable: true
              description: |-
                Invalid request field, or null when no field applies.

                <!-- polymorfa-input-table -->
                **Accepted alternatives**
                | Alternative | Accepted input |
                | --- | --- |
                | Alternative 1 | Type: `string` |
                | Alternative 2 | `null` |
            request_id:
              type: string
              description: >-
                Matches the X-Request-Id response header. Include it when you
                contact support.
            request_log_url:
              type: string
              format: uri
              description: >-
                Console page that shows this request. Returned only to
                organization and project credentials whose request was logged.


                <!-- polymorfa-input-table -->

                **Value constraints**

                | Constraint | Accepted input |

                | --- | --- |

                | Format | `uri` |
          description: Error details returned when the operation fails.
        data:
          type: string
          nullable: true
          enum:
            - null
          description: |-
            Always null for a failed request.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `null` | Null. |

            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string` |
            | Alternative 2 | `null` |
        docs:
          type: string
          format: uri
          description: |-
            Documentation link to this failure code.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uri` |
    management__UsageMeter:
      type: string
      enum:
        - call.duration
        - call.cloud_pulses
        - campaign.call
        - tts.characters
        - tts.seconds
        - stt.seconds
        - agent.seconds
        - agent.tokens
        - agent.provider_cost
        - channels.peak
        - storage.byte_days
      description: >-
        What was measured. Calls record `call.duration` (seconds) and, for
        outgoing Cloud API calls, `call.cloud_pulses` (6-second pulses). The
        other meters belong to voice automation and have no records yet.
    management__UsageUnit:
      type: string
      enum:
        - second
        - pulse
        - call
        - character
        - token
        - provider_unit
        - channel
        - byte_day
    management__UsageKeySource:
      type: string
      enum:
        - none
        - managed
        - customer
      description: >-
        Whose provider key produced the usage. `none` for usage without a
        provider key, such as calls.
  responses:
    management__BadRequest:
      description: A path, query, or request-body value did not pass validation.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__Unauthorized:
      description: Missing/invalid credential for this audience.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__Forbidden:
      description: Authenticated but lacks the required scope/role/audience.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
  securitySchemes:
    management__ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Send your team API key or project token as `Authorization: Bearer
        <token>`. The credential must have the required permissions. Project
        tokens can access only their own project.

````