> ## 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.

# Configure Auto-Recharge

> Enable and configure automatic credit recharge settings

Enable or disable automatic credit recharge and configure the threshold and recharge amounts for your account.

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

  payload = {
      "enabled": True,
      "threshold_credits": 100,
      "recharge_amount": 500
  }

  response = requests.post(
      "https://api.videodb.io/billing/auto_recharge",
      json=payload,
      headers={"x-access-token": "your_api_key"}
  )

  result = response.json()
  print(f"Auto-Recharge Updated: {result.get('success')}")
  print(f"New Settings: {result.get('settings')}")
  ```

  ```javascript Node.js theme={null}
  const payload = {
      enabled: true,
      thresholdCredits: 100,
      rechargeAmount: 500
  };

  const response = await fetch("https://api.videodb.io/billing/auto_recharge", {
      method: "POST",
      headers: {
          "x-access-token": "your_api_key",
          "Content-Type": "application/json"
      },
      body: JSON.stringify(payload)
  });

  const result = await response.json();
  console.log(`Auto-Recharge Updated: ${result.success}`);
  console.log(`New Settings: ${JSON.stringify(result.settings)}`);
  ```
</CodeGroup>

<Note>
  * Threshold amount determines when auto-recharge triggers
  * Recharge amount is the credit quantity added when threshold is met
  * Requires a valid payment method on file
  * Set `enabled` to `false` to disable auto-recharge without losing your configuration
  * Changes take effect immediately
</Note>

<CardGroup cols={2}>
  <Card title="Get Auto-Recharge Settings" icon="check" href="/api-reference/billing/get_auto_recharge">
    Check current auto-recharge configuration
  </Card>

  <Card title="Get Usage Statistics" icon="chart-line" href="/api-reference/billing/get_usage">
    Monitor credit consumption and balance
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /billing/auto_recharge
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/auto_recharge:
    post:
      summary: Update auto recharge settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enabled:
                  type: boolean
                  example: true
                threshold:
                  type: number
                  example: 10
                amount:
                  type: number
                  example: 50
      responses:
        '200':
          description: Auto recharge updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Auto recharge settings updated
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: API key for authentication (sk-xxx format)

````