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

# Get Tenant Usage History

> Retrieve usage history for a specific tenant



## OpenAPI

````yaml /api-reference/tenant-usage/tenant-usage-openapi.json get /api/v1/external/workspaces/{workspace_id}/tenant-usage/{tenant_id}
openapi: 3.1.0
info:
  title: Papermap Tenant Usage API
  version: 1.0.0
servers:
  - url: https://prod.dataapi.papermap.ai/
security: []
paths:
  /api/v1/external/workspaces/{workspace_id}/tenant-usage/{tenant_id}:
    get:
      summary: Get Tenant Usage History
      description: Retrieve usage history for a specific tenant
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
          description: The workspace ID
        - name: tenant_id
          in: path
          required: true
          schema:
            type: string
          description: The tenant ID
        - name: from_period
          in: query
          required: false
          schema:
            type: string
            pattern: ^\d{4}-\d{2}$
          description: Start period filter (YYYY-MM format)
        - name: to_period
          in: query
          required: false
          schema:
            type: string
            pattern: ^\d{4}-\d{2}$
          description: End period filter (YYYY-MM format)
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
            minimum: 1
          description: Page number
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            default: 50
            minimum: 1
            maximum: 100
          description: Items per page
        - name: X-API-Key-ID
          in: header
          required: true
          schema:
            type: string
          description: API Key Identifier
        - name: X-Workspace-ID
          in: header
          required: true
          schema:
            type: string
          description: Workspace Identifier
        - name: X-Valid-Until
          in: header
          required: true
          schema:
            type: string
          description: Validity timestamp for the request
        - name: X-Signature
          in: header
          required: true
          schema:
            type: string
          description: HMAC-SHA256 signature for authentication
      responses:
        '200':
          description: Tenant usage history retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      workspace_id:
                        type: string
                      tenant_id:
                        type: string
                      usage:
                        type: array
                        items:
                          $ref: '#/components/schemas/TenantUsageItem'
                      total_records:
                        type: integer
                      total_pages:
                        type: integer
        '400':
          description: Invalid period format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TenantUsageItem:
      type: object
      properties:
        tenant_id:
          type: string
          description: The tenant identifier
        period:
          type: string
          description: The billing period (YYYY-MM format)
        period_start:
          type: string
          format: date-time
          description: Start of the billing period
        period_end:
          type: string
          format: date-time
          description: End of the billing period
        credits_used:
          type: integer
          description: Credits consumed in this period
        request_count:
          type: integer
          description: Number of requests made in this period
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
        success:
          type: boolean
          enum:
            - false
        data:
          type: 'null'

````