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

# Get CFDI usage/quota for the current billing month

> Authenticate with either a Supabase session (send the `X-Organization-Id` header) or an API key (external integrations, requires the `read:invoices` scope). Returns how many CFDI the organization has stamped this calendar month (Mexico City time) against its plan's included quota. `cfdiIncluded`/`cfdiRemaining` are `null` for the enterprise plan (unlimited).



## OpenAPI

````yaml https://api.timbrix.mx/api/openapi.json get /usage
openapi: 3.0.0
info:
  title: Timbrix API
  description: >-
    API de facturación electrónica CFDI 4.0 para México, con servidor OAuth2
    para gestionar organizaciones, miembros y webhooks. Compatible con agentes
    de IA — ver la extensión `x-ai-agent-friendly` en la raíz de esta spec.


    REST API with OAuth2 server for managing organizations, members, and
    webhooks.
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: organizations
    description: Organization management endpoints
  - name: oauth
    description: OAuth2 authentication and authorization
  - name: webhooks
    description: Webhook configuration and delivery
  - name: users
    description: User information endpoints
  - name: api-keys
    description: API Keys management and validation
paths:
  /usage:
    get:
      tags:
        - invoices
      summary: Get CFDI usage/quota for the current billing month
      description: >-
        Authenticate with either a Supabase session (send the
        `X-Organization-Id` header) or an API key (external integrations,
        requires the `read:invoices` scope). Returns how many CFDI the
        organization has stamped this calendar month (Mexico City time) against
        its plan's included quota. `cfdiIncluded`/`cfdiRemaining` are `null` for
        the enterprise plan (unlimited).
      operationId: InvoicesController_usage
      parameters:
        - name: X-Organization-Id
          in: header
          description: >-
            Required for Supabase session auth. Ignored when authenticating with
            an API key (the organization resolves from the key).
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponseDto'
        '400':
          description: Missing X-Organization-Id header for a session request
        '404':
          description: organizationId not found
      security:
        - apiKey: []
        - bearer: []
components:
  schemas:
    UsageResponseDto:
      type: object
      properties:
        plan:
          type: string
          enum:
            - starter
            - pro
            - business
            - enterprise
        cfdiIncluded:
          type: object
          example: 500
          nullable: true
          description: null = ilimitado (plan enterprise)
        cfdiUsedThisMonth:
          type: number
          example: 128
        cfdiRemaining:
          type: object
          example: 372
          nullable: true
          description: null = ilimitado (plan enterprise)
        periodResetsAt:
          type: string
          example: '2026-09-01T06:00:00.000Z'
        usagePct:
          type: number
          example: 70.5
        projectedCostMxn:
          type: object
          example: 25
          nullable: true
          description: >-
            Costo estimado del excedente este mes en MXN — null en el plan
            enterprise
      required:
        - plan
        - cfdiIncluded
        - cfdiUsedThisMonth
        - cfdiRemaining
        - periodResetsAt
        - usagePct
        - projectedCostMxn
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API Key for authentication (format: sk_...)'
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````