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

# API Authentication Guide | Video Background Remover API Key Setup

> Complete authentication guide for VideoBGRemover API. Learn API key setup, security best practices, rate limiting, and troubleshooting with examples.

## API Key Format

All API requests require authentication using an API key with the format `vbr_` followed by 32 characters.

```
vbr_1234567890abcdef1234567890abcdef
```

## Request Header

Include your API key in the `X-Api-Key` header for all requests:

```bash theme={"dark"}
curl -X GET https://api.videobgremover.com/v1/credits \
  -H "X-Api-Key: vbr_your_api_key_here"
```

> [!WARNING]
>
> Never share your API key publicly or include it in client-side code. Keep it secure on your server.

## Getting Your API Key

**1. Create an account**

Sign up at [videobgremover.com](https://videobgremover.com) if you haven't already.

**2. Generate API key**

Go to [API Management](https://videobgremover.com/api-management) and create a new API key with a descriptive name.

**3. Add credits before processing**

Creating a key does not add free processing credits. Purchase credits before starting a background-removal job.

## Testing Authentication

Test your API key by checking your credit balance:

```bash theme={"dark"}
curl -X GET https://api.videobgremover.com/v1/credits \
  -H "X-Api-Key: vbr_your_api_key_here"
```

**Success Response:**

```json theme={"dark"}
{
  "user_id": "user-uuid",
  "total_credits": 100,
  "remaining_credits": 95,
  "used_credits": 5
}
```

## Authentication Errors

### Invalid API Key (401)

```json theme={"dark"}
{
  "error": "Invalid API key"
}
```

**Common causes:**

* Typo in the API key
* Using wrong header name (should be `X-Api-Key`)
* API key was deleted or deactivated

### Missing API Key (401)

```json theme={"dark"}
{
  "error": "API key required"
}
```

**Solution:** Make sure you include the `X-Api-Key` header in your request.

## Security Best Practices

> [accordion] Server-side only
>
> Never use API keys in client-side JavaScript, mobile apps, or any publicly accessible code.

> [accordion] Environment variables
>
> Store your API key in environment variables, not in your source code:
>
> ```bash theme={"dark"}
> export VIDEOBGREMOVER_API_KEY="vbr_your_api_key_here"
> ```

> [accordion] Key rotation
>
> Regularly rotate your API keys. Create a new key before deleting the old one to avoid downtime.

> [accordion] Separate keys for environments
>
> Use different API keys for development, staging, and production environments.

## Rate Limits

Limits can vary by endpoint and account. Handle `429 Too Many Requests` responses with backoff, and contact support before planning a high-volume workload instead of relying on a fixed undocumented quota.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.