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

# Account balance & limits

> Check credits, Unlimited package status, active jobs, and the daily video quota remaining on one account.

One lightweight call that tells you whether your account is ready to submit the next request. It works well as a gate before a batch.

### Authorizations

**Authorization** `string` *required*

API key formatted `Bearer vg_...`.

```bash cURL theme={null} theme={null}
curl https://vigen.id/api/v1/user/credits \
  -H "Authorization: Bearer vg_4b1a82f3c9d0e1f2a3b4c5d6e7f80912"
```

```js Node.js theme={null} theme={null}
const info = await (
  await fetch("https://vigen.id/api/v1/user/credits", {
    headers: { Authorization: `Bearer ${process.env.VIGEN_API_KEY}` },
  })
).json();

if (info.user.credits < 10 || info.limits.dailyVideosRemaining === 0) {
  console.warn("tidak layak mengirim batch");
}
```

```python Python theme={null} theme={null}
info = requests.get(
    "https://vigen.id/api/v1/user/credits",
    headers={"Authorization": f"Bearer {api_key}"},
).json()

print(info["user"]["credits"], info["unlimited"], info["limits"])
```

### Responses

**success** `boolean` *required*

`true` when the data was read.

**user** `object` *required*

**contents of user**

**uid** `string` *required*

The account's internal id. Stable and safe to use as a key in your own database.

**email** `string`

Email of the Google account that owns the key.

**credits** `number` *required*

Current credit balance. Can be fractional (for example `1.5`).

**unlimited** `object` *required*

Status of the Unlimited package. No credits are deducted for eligible models while `active` is `true`.

**contents of unlimited**

**active** `boolean` *required*

`true` while the quota is still valid.

**daysLeft** `number`

Days remaining. Repeated purchases stack, so this can exceed the duration of a single package.

**expiresAt** `string (ISO 8601) | null`

Expiry time; `null` when no package is active.

**limits** `object` *required*

The limits that will decide whether your next request is accepted.

**contents of limits**

**maxConcurrentJobs** `number` *required*

Concurrent processes allowed for Unlimited quota usage. Currently `2`.

**currentActiveJobs** `number` *required*

Jobs owned by your account that are still `queued`, `dispatching`, or `processing`.

**dailyVideoLimit** `number` *required*

Maximum successful videos per day. Currently `50`.

**dailyVideosGenerated** `number` *required*

Already used today. Failed jobs are not counted.

**dailyVideosRemaining** `number` *required*

Left for today, minimum `0`.

**resetsAt** `string` *required*

`"00:00 WIB"` — the reset uses Western Indonesia Time, not UTC.

```json 200 theme={null} theme={null}
{
  "success": true,
  "user": {
    "uid": "0f7c9a1e-42b3-4c9a-9d0f-8a3e2b1c5d64",
    "email": "saya@tokokamu.com",
    "credits": 128
  },
  "unlimited": {
    "active": true,
    "daysLeft": 1,
    "expiresAt": "2026-11-05T03:41:12.000Z"
  },
  "limits": {
    "maxConcurrentJobs": 2,
    "currentActiveJobs": 1,
    "dailyVideoLimit": 50,
    "dailyVideosGenerated": 12,
    "dailyVideosRemaining": 38,
    "resetsAt": "00:00 WIB"
  }
}
```

```json 401 theme={null} theme={null}
{ "error": "API Key tidak valid atau telah dicabut." }
```

```json 503 theme={null} theme={null}
{ "error": "Vigen sedang dalam pemeliharaan. Penggunaan API key dinonaktifkan sementara." }
```

## Common usage patterns

> [tab] Gate before a batch
>
> ```js theme={null} theme={null}
> async function canSubmit(model, parameters) {
>   const [{ limits }, models] = await Promise.all([vigen.credits(), vigen.models()]);
>   const m = models.video.find((x) => x.id === model);
>   const harga = perkirakanHarga(m, parameters);
>
>   return (
>     limits.dailyVideosRemaining > 0 &&
>     limits.currentActiveJobs < limits.maxConcurrentJobs &&
>     (await vigen.credits()).user.credits >= harga
>   );
> }
> ```

> [tab] Low balance alert
>
> ```js theme={null} theme={null}
> // run hourly from cron
> const { user, unlimited } = await vigen.credits();
>
> if (!unlimited.active && user.credits < 20) {
>   await notifyOwner(`Sisa kredit ${user.credits}. Beli lagi di https://vigen.id/billing`);
> }
> ```

> [tab] Watch the daily quota
>
> ```js theme={null} theme={null}
> const { limits } = await vigen.credits();
>
> if (limits.dailyVideosRemaining <= 5) {
>   scheduler.pauseNewVideoJobsUntil(nextWibMidnight());
> }
> ```

> [!WARNING]
>
> The `maxConcurrentJobs` number only drives rejection when your request is paid for by the Unlimited quota. Per-credit usage can have more than two active jobs, but it will queue longer.


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