<!-- /en/docs (en) -->

# Getting started with the FrankLab API

The FrankLab API is the programmatic interface to the content generation platform. A single partner API key unlocks generation (video, images, audio, text) and every billing operation: balance, transactions, tariffs, cost estimates and exports.

## Base URL

```
https://apergrex.ru/franklab/api
```

The same API is served at `https://franklab.ru/franklab/api`.

## Get an API key

1. Sign in to the apergrex.ru cabinet and open **Settings → API**.
2. Click "Create key" — you receive a value like `fl_live_…`.
3. The raw key is shown **exactly once** — store it immediately. Treat it like a password: it grants access to your balance and partner operations.

Your key list is also available programmatically (`GET /v1/billing/api-keys`, see [API reference → api-keys](/en/docs/reference)); minting and revoking keys requires the signed-in cabinet session, so a key itself can never issue further keys.

## First request

Check the balance:

```bash
curl -H "X-API-Key: $FRANKLAB_KEY" \
  https://apergrex.ru/franklab/api/v1/billing/balance
```

Response:

```json
{
  "available": 413.5,
  "total": 500,
  "used": 86.5,
  "reserved": 0,
  "isLow": false,
  "updatedAt": "2026-09-04T12:00:00.000Z"
}
```

## Cost before you launch

Before running a generation, request an exact quote at your tariff:

```bash
curl -X POST -H "X-API-Key: $FRANKLAB_KEY" -H "Content-Type: application/json" \
  -d '{"modelId":"mars-v1-5","duration":5,"resolution":"720p"}' \
  https://apergrex.ru/franklab/api/v1/billing/pricing/estimate
```

The estimate charges nothing and starts no tasks.

## Next steps

- [Authentication](/en/docs/authentication) — keys, headers, limits
- [Billing](/en/docs/billing) — balance, reservations, transactions, tariffs
- [API reference](/en/docs/reference) — every endpoint
- [Pricing](/en/docs/pricing) — the base price list
