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

# Get Usage Breakdown

> Get detailed usage breakdown.

Returns usage breakdown by operation type and extractor
for the specified billing period.

**Query Parameters:**
- `billing_month`: Month to query (YYYY-MM format, defaults to current)

**Requirements:**
- Read permission

**Example:**
```python
# Current month
response = await client.get("/v1/organizations/billing/usage/breakdown")

# Specific month
response = await client.get(
    "/v1/organizations/billing/usage/breakdown",
    params={"billing_month": "2025-11"}
)
```



## OpenAPI

````yaml get /v1/organizations/billing/usage/breakdown
openapi: 3.1.0
info:
  title: Mixpeek API
  description: >-
    This is the Mixpeek API, providing access to various endpoints for data
    processing and retrieval.
  termsOfService: https://mixpeek.com/terms
  contact:
    name: Mixpeek Support
    url: https://mixpeek.com/contact
    email: info@mixpeek.com
  version: '0.82'
servers:
  - url: https://api.mixpeek.com
    description: Production
security: []
paths:
  /v1/organizations/billing/usage/breakdown:
    get:
      tags:
        - Organization Billing
      summary: Get Usage Breakdown
      description: |-
        Get detailed usage breakdown.

        Returns usage breakdown by operation type and extractor
        for the specified billing period.

        **Query Parameters:**
        - `billing_month`: Month to query (YYYY-MM format, defaults to current)

        **Requirements:**
        - Read permission

        **Example:**
        ```python
        # Current month
        response = await client.get("/v1/organizations/billing/usage/breakdown")

        # Specific month
        response = await client.get(
            "/v1/organizations/billing/usage/breakdown",
            params={"billing_month": "2025-11"}
        )
        ```
      operationId: get_usage_breakdown_v1_organizations_billing_usage_breakdown_get
      parameters:
        - name: billing_month
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Billing month in YYYY-MM format (defaults to current month)
            examples:
              - 2025-12
            title: Billing Month
          description: Billing month in YYYY-MM format (defaults to current month)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageBreakdownResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    UsageBreakdownResponse:
      properties:
        billing_month:
          type: string
          title: Billing Month
          description: Billing month (YYYY-MM)
          examples:
            - 2025-12
        total_credits:
          type: integer
          title: Total Credits
          description: Total credits consumed
          examples:
            - 23450
        total_cost_usd:
          type: number
          title: Total Cost Usd
          description: Total cost in USD
          examples:
            - 23.45
        by_operation:
          additionalProperties:
            type: integer
          type: object
          title: By Operation
          description: Credits consumed by operation type
          examples:
            - batch: 2450
              extractor: 15000
              search: 1000
              upload: 5000
        by_extractor:
          additionalProperties:
            type: integer
          type: object
          title: By Extractor
          description: Credits consumed by extractor
          examples:
            - multimodal_extractor: 10000
              text_extractor: 5000
        by_namespace:
          additionalProperties:
            type: integer
          type: object
          title: By Namespace
          description: >-
            Credits consumed by namespace (SP-242 — chargeback / cost-allocation
            for multi-namespace orgs). Keyed by namespace_id; excludes
            namespace-less consumption. Empty for older usage recorded before
            per-namespace attribution.
          examples:
            - ns_clientA: 18000
              ns_clientB: 5450
        by_retriever:
          additionalProperties:
            type: integer
          type: object
          title: By Retriever
          description: >-
            Credits consumed by retriever (per-product query-cost attribution
            for chargeback). Keyed by retriever_id (resource_type='retriever'
            charges: queries, enrichment). Empty when no retriever-attributed
            usage.
          examples:
            - ret_search_prod: 4200
              ret_support_bot: 900
        pending_credits:
          type: number
          title: Pending Credits
          description: >-
            Unflushed sub-credit usage accrued but not yet committed to
            by_operation. Micro-priced per-op usage (e.g. MVS writes/queries at
            ~0.001 credit each) accumulates here and rolls into by_operation in
            whole credits as it crosses 1 — so real activity is visible
            immediately, before a whole credit accrues (BACKE-790).
          default: 0
          examples:
            - 0.014
        pending_by_operation:
          additionalProperties:
            type: number
          type: object
          title: Pending By Operation
          description: Unflushed fractional credits by operation type.
          examples:
            - mvs_query: 0.004
              mvs_write: 0.01
        period_start:
          type: string
          format: date-time
          title: Period Start
          description: Start of billing period
        period_end:
          type: string
          format: date-time
          title: Period End
          description: End of billing period
      type: object
      required:
        - billing_month
        - total_credits
        - total_cost_usd
        - by_operation
        - by_extractor
        - period_start
        - period_end
      title: UsageBreakdownResponse
      description: Response with detailed usage breakdown.
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Always false for error responses
          default: false
        status:
          type: integer
          title: Status
          description: HTTP status code for this error
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: Error details payload
      type: object
      required:
        - status
        - error
      title: ErrorResponse
      description: Error response model.
      examples:
        - error:
            details:
              id: ns_123
              resource: namespace
            message: Namespace not found
            type: NotFoundError
          status: 404
          success: false
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable error message
        type:
          type: string
          title: Type
          description: Stable error type identifier (machine-readable)
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Fine-grained error code for programmatic handling (e.g.,
            namespace_name_taken, feature_extractor_not_found). Present only
            when consumers may need to branch on a specific error condition.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Optional structured details to help debugging (validation errors,
            IDs, etc.)
      type: object
      required:
        - message
        - type
      title: ErrorDetail
      description: Error detail model.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````