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

# Billing & Credits

> Understand VoiceDub API pricing, credit system, auto top-up, and billing management

The VoiceDub API uses a credit-based system where you pay for what you use. Credits are consumed when creating voice dubs and training custom voice models.

## Credit System

All API operations consume credits based on audio duration:

<CardGroup cols={2}>
  <Card title="Voice Dubbing" icon="microphone">
    **10 credits per minute** of audio

    Minimum 10 credits per dub (for clips under 1 minute)
  </Card>

  <Card title="Voice Training" icon="brain">
    **10 credits per minute** of training

    Cost depends on your `maxMinutes` setting
  </Card>
</CardGroup>

### Credit Examples

<AccordionGroup>
  <Accordion title="Voice Dubbing Costs">
    * **30-second TikTok clip:** 10 credits (minimum charge)
    * **3-minute song:** 30 credits
    * **10-minute podcast segment:** 100 credits
  </Accordion>

  <Accordion title="Voice Training Costs">
    * **5-minute training:** 50 credits
    * **10-minute training:** 100 credits
    * **30-minute training:** 300 credits
    * **60-minute training:** 600 credits
  </Accordion>
</AccordionGroup>

## Purchasing Credits

Buy credits through the [Billing Dashboard](https://voicedub.ai/developer/billing):

### Credit Packages (\$0.01 per credit)

| Credits | Price  |
| ------- | ------ |
| 500     | \$5    |
| 5,000   | \$50   |
| 50,000  | \$500  |
| 125,000 | \$1250 |

<Info>
  Credits never expire and can be used anytime.
</Info>

## Auto Top-Up

Set up automatic credit top-ups to ensure uninterrupted API access. Auto top-up triggers when your balance falls below a threshold you set.

### How Auto Top-Up Works

<Steps>
  <Step title="Set your threshold">
    Choose when to trigger auto top-up (e.g., when balance drops below 500 credits)
  </Step>

  <Step title="Set your target">
    Choose the credit balance to restore to (e.g., top up to 2,000 credits)
  </Step>

  <Step title="Add a payment method">
    Securely store a payment method for automatic charges
  </Step>

  <Step title="Automatic monitoring">
    System checks your balance every 30 minutes and triggers a top-up when needed (as long as 6 hours have passed since the last auto top-up)
  </Step>
</Steps>

### Auto Top-Up Settings

<ParamField body="threshold" type="integer">
  Minimum credit balance before triggering auto top-up (100-99,000 credits)
</ParamField>

<ParamField body="target" type="integer">
  Credit balance to restore to when auto top-up triggers (1,100–100,000 credits; must be at least 1,000 credits above threshold)
</ParamField>

### Auto Top-Up Behavior

**Frequency:** System checks every 30 minutes for accounts with auto top-up enabled

**Rate Limiting:** Maximum 1 auto top-up per 6 hours

**Failure Handling:** If payment fails, you'll receive an email notification and auto top-up will pause until you resolve the issue (such as updating your payment method) and complete the payment

**Payment Authentication:** If your payment method requires 3D Secure or similar authentication, you'll receive an email notification and auto top-up will pause until you complete authentication manually

## Managing Payment Methods

Access payment method management through the [Billing Dashboard](https://voicedub.ai/developer/billing):

* **Set default payment method** for auto top-ups
* **Update expiring cards** seamlessly
* **Remove unused methods** for security

## Billing Management

### Invoices & Receipts

* **Automatic receipts** emailed after each purchase
* **Downloadable invoices** available in your dashboard
* **Tax information** included where applicable
* **Billing history** with detailed transaction records

### Failed Payments

When auto top-up payments fail:

1. **Immediate notification** via email
2. **Auto top-up paused** to prevent retry loops
3. **Manual retry option** in your dashboard
4. **Alternative payment methods** can be used

Common failure reasons:

* **Insufficient funds** in bank account
* **Expired credit card** needs updating
* **3D Secure authentication** required
* **Bank decline** due to fraud protection

### Payment Authentication Required

If your payment method requires additional authentication:

<Info>
  You'll receive an email with a secure link to complete authentication. Auto top-up will resume once completed.
</Info>

**What triggers authentication:**

* First time using a new payment method
* Large or unusual transaction amounts
* Bank security requirements
* Regulatory compliance (Strong Customer Authentication)

## Credit Usage Tracking

Monitor your credit consumption:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://api.voicedub.ai/v1/me' \
    -H 'Authorization: Api-Key YOUR_API_KEY'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.voicedub.ai/v1/me', {
    headers: {
      'Authorization': 'Api-Key YOUR_API_KEY'
    }
  });

  const data = await response.json();
  console.log('Credit balance:', data.user.apiCredits);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get('https://api.voicedub.ai/v1/me',
    headers={
      'Authorization': 'Api-Key YOUR_API_KEY'
    }
  )

  data = response.json()
  print('Credit balance:', data['user']['apiCredits'])
  ```
</CodeGroup>

<Accordion title="Show Response">
  ```json theme={null}
  {
    "user": {
      "apiCredits": 1847
    }
  }
  ```
</Accordion>

### Usage Monitoring

* **Real-time balance** updates after each API call
* **Usage analytics** in your developer dashboard
* **Historical usage data** for budgeting and forecasting

## Rate Limits & Fair Usage

While there are no hard limits on credit usage, we monitor for:

* **Unusual consumption patterns** that may indicate abuse
* **Automated systems** generating excessive load
* **Terms of service violations**

<Info>
  Accounts violating fair usage may have temporary restrictions applied while we investigate.
</Info>

## Credit Restoration for Errors

If an API operation fails due to a processing error or technical issue on our platform, any credits used for that operation will be automatically restored to your account.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Auto top-up not working">
    **Check these common issues:**

    * Payment method expired or invalid
    * Auto top-up disabled in settings
    * Recent auto top-up within 6-hour limit
    * Insufficient bank funds or card limits
    * Authentication required (check email)

    **Solutions:**

    * Update payment method in the [Billing Dashboard](https://voicedub.ai/developer/billing)
    * Re-enable auto top-up if disabled
    * Wait for rate limit to reset
    * Complete payment authentication
  </Accordion>

  <Accordion title="Payment declined">
    **Common causes:**

    * Insufficient funds
    * Bank fraud protection
    * Expired card details
    * International transaction blocked

    **Solutions:**

    * Contact your bank to authorize the transaction
    * Update payment method with current details
    * Try a different payment method
    * Use manual top-up instead of auto top-up
  </Accordion>

  <Accordion title="Missing credits after payment">
    **Immediate steps:**

    * Check the [Billing Dashboard](https://voicedub.ai/developer/billing) for transaction status
    * Verify payment was successful in your bank/card statement
    * Allow up to 5 minutes for credit balance to update

    **If credits still missing:**

    * Contact support with payment confirmation
    * Provide transaction ID or receipt number
  </Accordion>

  <Accordion title="Unexpected credit consumption">
    **Review your usage:**

    * Check API request logs in the [Logs Dashboard](https://voicedub.ai/developer/logs)
    * Verify audio duration calculations (minimum 1-minute charge)
    * Review failed requests that may have consumed credits
    * Confirm credit costs: 10 credits per minute for both dubbing and training

    **Contact Support:**

    * Email us at [help@voicedub.ai](mailto:help@voicedub.ai), including the email address you used to sign up and details about your usage
    * Include specific request IDs or timestamps for faster resolution
    * Our team will review your account and provide detailed usage breakdown
  </Accordion>
</AccordionGroup>

<Check>
  Need help with billing? Contact our support team at [help@voicedub.ai](mailto:help@voicedub.ai) for personalized assistance.
</Check>
