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

# Credits API

Read credit balances, purchase packs, configure auto top-off, and inspect transactions.

Credit endpoints help account owners understand remaining generation capacity.

## Get credits

```bash
curl https://littledemo.com/api/v1/credits \
  -H "Authorization: Bearer ld_live_xxx"
```

## Purchase credits

```bash
curl -X POST https://littledemo.com/api/v1/credits/purchase \
  -H "Authorization: Bearer ld_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"packId":"20"}'
```

## Auto top-off

```bash
curl https://littledemo.com/api/v1/credits/auto-topoff \
  -H "Authorization: Bearer ld_live_xxx"
```

```bash
curl -X PUT https://littledemo.com/api/v1/credits/auto-topoff \
  -H "Authorization: Bearer ld_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true,"packId":"20","threshold":3}'
```

## Transactions

```bash
curl https://littledemo.com/api/v1/credits/transactions \
  -H "Authorization: Bearer ld_live_xxx"
```