# Create your account

You need three things to call the VidLab API: an account, an API key and some credit. It takes a few minutes, and nothing is charged until a generation succeeds.

## Sign up

Create an account on [vidlab.ai](https://vidlab.ai/sign-in?mode=up). One account covers the dashboard, the Playground and the API.

## Create a key

Open [API keys](https://vidlab.ai/api-keys) in the dashboard, accept the Developer API terms and create a key. Give each app its own key, so you can revoke one without breaking the rest.

The full key is shown once, when you create it. Copy it somewhere safe straight away, such as a password manager or your platform's secret store. VidLab stores only a hash, so a lost key cannot be shown again: delete it and make a new one.

A new key can do everything. To narrow one, give it an expiry date, an IP allowlist, a list of allowed models or a spend limit from its menu. See [Key controls](https://docs.vidlab.ai/authentication#key-controls).

## Add credit

The API is prepaid. Open [Billing](https://vidlab.ai/credits), choose an amount and pay by card. The credit arrives as soon as the payment clears.

- Each generation reserves its price while it runs. Only a success is charged, and a failed generation is free.
- The dashboard shows credits, 100 credits to the dollar. The API speaks dollars.
- To keep long jobs from stopping on an empty balance, turn on auto-reload.

The amounts you can add, auto-reload and refunds are on [Billing](https://docs.vidlab.ai/billing).

## Use your key

Put the key in an environment variable. Every example in these docs reads `VIDLAB_API_KEY`.

```bash
export VIDLAB_API_KEY="vidlab_sk_your_key_here"
```

Send it as a bearer token with each request. This call reads your balance, so it is a quick way to check that the key works.

```bash cURL
curl https://vidlab.ai/v1/balance \
  -H "Authorization: Bearer $VIDLAB_API_KEY"
```

```python Python
import os, requests

r = requests.get(
    "https://vidlab.ai/v1/balance",
    headers={"Authorization": f"Bearer {os.environ['VIDLAB_API_KEY']}"},
)
print(r.json())
```

```js JavaScript
const res = await fetch("https://vidlab.ai/v1/balance", {
  headers: { Authorization: `Bearer ${process.env.VIDLAB_API_KEY}` },
});
console.log(await res.json());
```

Keep the key on your server. Never put it in a browser, a mobile app, a committed file or a prompt, where anyone can read it.

## Next step

You have an account, a key and credit. Now make your [first generation](https://docs.vidlab.ai/quickstart).
