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

# Get Monthly Usage Endpoint

> Get monthly usage data for a tenant with validation for year and month parameters.

Args: request: Request object containing year and month with validation user_context: User context with tenant admin permissions resource_id: Optional[UUID]. If provided, get usage data for a specific resource. Otherwise, get aggregated usage data across all resources.

Returns: Monthly usage records for the specified month and year



## OpenAPI

````yaml api-reference/openapi.json get /billing/usages/monthly
openapi: 3.1.0
info:
  title: Endpoints
  version: '1.0'
servers:
  - url: https://api.contextual.ai/v1
security:
  - BearerAuth: []
paths:
  /billing/usages/monthly:
    get:
      tags:
        - /billing
      summary: Get Monthly Usage Endpoint
      description: >-
        Get monthly usage data for a tenant with validation for year and month
        parameters.


        Args: request: Request object containing year and month with validation
        user_context: User context with tenant admin permissions resource_id:
        Optional[UUID]. If provided, get usage data for a specific resource.
        Otherwise, get aggregated usage data across all resources.


        Returns: Monthly usage records for the specified month and year
      operationId: get_monthly_usage_endpoint_billing_usages_monthly_get
      parameters:
        - name: year
          in: query
          required: true
          schema:
            type: integer
            minimum: 2025
            title: Year
        - name: month
          in: query
          required: true
          schema:
            type: integer
            maximum: 12
            minimum: 1
            title: Month
        - name: resource_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Resource Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonthlyUsageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    MonthlyUsageResponse:
      properties:
        usages:
          items:
            $ref: '#/components/schemas/DailyUsage'
          type: array
          title: Usages
          description: List of daily usages
      type: object
      required:
        - usages
      title: MonthlyUsageResponse
      description: Response to GET /billing/usage/monthly request
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DailyUsage:
      properties:
        date:
          type: string
          format: date
          title: Date
          description: Date of the usage
        usage_type:
          $ref: '#/components/schemas/UsageType'
          description: Type of usage
        quantity:
          type: integer
          title: Quantity
          description: Usage quantity
        price:
          type: number
          title: Price
          description: Price per unit
      type: object
      required:
        - date
        - usage_type
        - quantity
        - price
      title: DailyUsage
      description: ''
    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
    UsageType:
      type: string
      enum:
        - QUERY_REFORMULATION_INPUT_TOKEN
        - QUERY_REFORMULATION_OUTPUT_TOKEN
        - QUERY_EXPANSION_INPUT_TOKEN
        - QUERY_EXPANSION_OUTPUT_TOKEN
        - QUERY_FILTER_TOKEN
        - QUERY_RETRIEVAL_TOKEN
        - QUERY_RERANK_TOKEN
        - QUERY_GENERATION_INPUT_TOKEN
        - QUERY_GENERATION_OUTPUT_TOKEN
        - QUERY_CONTEXTUALIZATION_TOKEN
        - QUERY_GROUNDEDNESS_TOKEN
        - QUERY_PLANNING_INPUT_TOKEN
        - QUERY_PLANNING_OUTPUT_TOKEN
        - QUERY_TRANSLATION_INPUT_TOKEN
        - QUERY_TRANSLATION_OUTPUT_TOKEN
        - QUERY_REQUEST
        - TUNE_REQUEST
        - EVAL_REQUEST
        - INGEST_BASIC_PAGE
        - INGEST_STANDARD_PAGE
        - INGEST_V3_STANDARD_PAGE
        - INGEST_V3_ADVANCED_PAGE
        - INGEST_V3_PREMIUM_PAGE
        - PARSE_BASIC_PAGE
        - PARSE_STANDARD_PAGE
        - RERANK_TOKEN
        - RERANK_V2_MINI_TOKEN
        - RERANK_V2_TOKEN
        - GENERATE_INPUT_TOKEN
        - GENERATE_OUTPUT_TOKEN
        - LMUNIT_TOKEN
        - ACL_COST
        - STRUCTURED_EXTRACTION_COST
        - STRUCTURED_EXTRACTION_INPUT_TOKENS
        - STRUCTURED_EXTRACTION_OUTPUT_TOKENS
        - STRUCTURED_EXTRACTION_CACHED_TOKENS
        - STRUCTURED_EXTRACTION_REASONING_TOKENS
      title: UsageType
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````