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

# Pricing

> How usage and quota work for the programmable worlds API.

The Alakazam programmable worlds API is **free during the developer preview**.
Usage is fully metered so you can see exactly what you'd pay later — but no
charges are incurred today.

## What's metered

Two units are metered per app:

| Unit           | Counts when                                          |
| -------------- | ---------------------------------------------------- |
| **Generation** | you create a world (`POST /v1/worlds`)               |
| **Session**    | you mint a runtime token (`POST /v1/sessions/token`) |

## Daily quota

Each app has a daily quota per unit. Usage is **reserved before any GPU spend**,
so you never get charged for work that didn't happen — and a failed generation
is refunded automatically.

If you exceed a daily quota, the call returns `402` and nothing is created:

```json theme={null}
{ "detail": "daily generation quota exceeded", "schemaVersion": "1.0" }
```

<Note>
  Quota is enforced fail-closed. If the metering backend is briefly unavailable,
  the call returns `503` rather than allowing unmetered usage.
</Note>

## Check your usage

`GET /v1/usage` returns today's usage against your caps:

```bash theme={null}
curl 'https://api.alakazam.gg/v1/usage' \
  -H 'Authorization: Bearer YOUR_SECRET_KEY'
```

```json theme={null}
{
  "day": "2026-06-28",
  "usage": { "generation": 3, "session": 12 },
  "caps":  { "generation": 50, "session": 200, "session_seconds": 7200 }
}
```
