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

# Get Usage Statistics

> Retrieve detailed usage statistics and credit consumption

Retrieve detailed usage statistics showing credit consumption across different operations in your account.

<CodeGroup>
  ```python Python theme={null}
  import videodb

  conn = videodb.connect(api_key="your_api_key")

  # Get usage statistics
  usage_data = conn.check_usage()

  print(f"Total Credits Used: {usage_data.get('total_credits_used')}")
  print(f"Monthly Credit Limit: {usage_data.get('monthly_limit')}")
  print(f"Credits Remaining: {usage_data.get('credits_remaining')}")
  ```

  ```javascript Node.js theme={null}
  import { connect } from 'videodb';

  const conn = connect({ apiKey: 'your_api_key' });

  // Get usage statistics
  const usageData = await conn.checkUsage();

  console.log(`Total Credits Used: ${usageData.totalCreditsUsed}`);
  console.log(`Monthly Credit Limit: ${usageData.monthlyLimit}`);
  console.log(`Credits Remaining: ${usageData.creditsRemaining}`);
  ```
</CodeGroup>

<Note>
  * Usage data includes cumulative credits consumed across all operations (video processing, AI generation, storage)
  * Credits reset monthly based on your billing plan
  * Track usage regularly to avoid unexpected bill increases
  * Real-time updates may have slight delays (typically 5-15 minutes)
</Note>

<CardGroup cols={2}>
  <Card title="Billing Overview" icon="credit-card" href="/api-reference/billing/index">
    Manage billing and usage information
  </Card>

  <Card title="Get Invoices" icon="file-text" href="/api-reference/billing/list_invoices">
    Retrieve billing invoices and payment records
  </Card>
</CardGroup>


## OpenAPI

````yaml GET /billing/usage
openapi: 3.0.3
info:
  title: VideoDB Server API
  description: >
    VideoDB Server API for video, audio, and image processing with AI
    capabilities.

    This API provides comprehensive video management, search, indexing, and
    AI-powered features.
  version: 1.0.0
  contact:
    name: VideoDB Support
    url: https://videodb.io
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.videodb.io
    description: Production server
  - url: https://staging-api.videodb.io
    description: Staging server
security:
  - ApiKeyAuth: []
tags:
  - name: Authentication
    description: User authentication and API key management
  - name: Collections
    description: Collection management operations
  - name: Videos
    description: Video upload, processing, and management
  - name: Audio
    description: Audio management operations
  - name: Images
    description: Image management operations
  - name: Search
    description: Content search and indexing
  - name: AI Generation
    description: AI-powered content generation
  - name: Billing
    description: Billing and usage management
  - name: RTStream
    description: Real-time streaming operations
  - name: Utilities
    description: Utility endpoints
  - name: Meeting
    description: Meeting recording and management
  - name: Capture
    description: Capture session management for recording streams
  - name: Editor
    description: Timeline editor operations
  - name: Transcode
    description: Media transcoding operations
  - name: Assets
    description: Cross-collection asset listing
paths:
  /billing/usage:
    get:
      summary: Get billing usage information
      responses:
        '200':
          description: Billing usage data
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/BillingUsage'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    BillingUsage:
      type: object
      properties:
        credit_balance:
          type: number
          example: 100.5
        usage_this_month:
          type: number
          example: 25.75
        breakdown:
          type: object
          additionalProperties:
            type: number
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: API key for authentication (sk-xxx format)

````