# Credits and billing

> What costs what, and what is free.

One credit is one profile, one video, one comment, one reply, one hashtag, one sound, one playlist, one live room or
one transcript returned to you. In video search one video is one credit, in account search one account is one
credit, in a follower or following list one profile is one credit, in the playlists of an account one playlist is
one credit, in sound search one sound is one credit, in live search one live room is one credit, and in hashtag
search one hashtag is one credit. You buy credits in
packs and spend them at any pace.

## Packs [#packs]

| Pack | Price | Credits | Per 1,000 |
|---|---|---|---|
| Free | $0 | 1,000, once | $0 |
| Starter | $10 | 80,000 | $0.125 |
| Builder | $50 | 500,000 | $0.100 |
| Growth | $200 | 2,500,000 | $0.080 |
| Scale | $600 | 10,000,000 | $0.060 |

Invoice and bank transfer from $500, and Enterprise packs from $2,000 with a signed SLA: hello@tikdataapi.com.

## Buying a pack [#buying-a-pack]

Card checkout runs on Stripe. Ask the API for a checkout link and open it:

```bash
curl -X POST https://api.tikdataapi.com/v1/billing/checkout \
  -H "x-api-key: $KEY" -H "content-type: application/json" \
  -d '{"pack":"builder"}'
```

```json
{ "url": "https://checkout.stripe.com/c/pay/cs_...", "pack": "builder", "usd": 50, "credits": 500000 }
```

The credits land in the wallet within seconds of payment, and the rate limit rises to the pack's. Check with `/v1/me`.

## Rules [#rules]

- **Credits never expire.** Paid or free, they stay in the wallet until you spend them.
- **No per-call minimum.** A request that returns nothing costs nothing: the video list of a private account,
  a video with no comments, a search with no result, the end of a list.
- **Failed requests are free.** Any status other than `200` charges zero.
- **Lookups are free.** A list read by username or by hashtag name first changes the name to an id. That lookup
  costs nothing.
- **Cache hits cost half.** Responses are cached for a short time per endpoint; a hit is marked `"cache": "hit"`.
- **`fresh=true` bypasses the cache.** An item that has a cached copy costs double and is marked
  `"cache": "bypass"`. An item with no cached copy costs the normal price.
- A charge never takes the balance below zero. At zero the API answers `402` with a link to buy more.
- One wallet per account. All packs land in the same balance; the oldest credits are spent first.
- Full refund of an unused pack within 14 days, on request to hello@tikdataapi.com.

## Price per item [#price-per-item]

| Item | Credits |
|---|---|
| Profile, also in account search and in a follower or following list | 1 |
| Video, from any endpoint, search included | 1 |
| Comment or reply | 1 |
| Hashtag, also in hashtag search | 1 |
| Playlist, in the playlists of an account | 1 |
| Sound, also in sound search | 1 |
| Live room, in live search | 1 |
| Live state of an account, live or not | 1 |
| Transcript of a video | 1 |
| Cached item | half of the above |
| `fresh=true` item that has a cached copy | double the above |
| `fresh=true` item with no cached copy | the same as above |
| Empty result, error, `404` | 0 |

## Cache times [#cache-times]

| Read | In cache for |
|---|---|
| Profile | 10 minutes |
| Video | 5 minutes |
| Videos of an account | 2 minutes |
| Comments and replies | 2 minutes |
| Hashtag | 10 minutes |
| Videos of a hashtag | 5 minutes |
| Video search, account search, followers, following | 5 minutes |
| Sound, playlists of an account | 10 minutes |
| Videos of a sound, videos of a playlist, related videos | 5 minutes |
| Reposts of an account, trending videos | 2 minutes |
| Sound search | 5 minutes |
| Live search, live state of an account | 1 minute |
| Transcript | 10 minutes |
| Hashtag search | 5 minutes |

The cache is shared by the single endpoints and the batches. Poll less often than these times and every read
is new.

## Reading the bill [#reading-the-bill]

Every response has `credits_charged` and `balance_remaining`. The same numbers are in the `x-credits-charged` and
`x-balance-remaining` headers, so a proxy can meter without parsing the body.

## SLA credit [#sla-credit]

For each full hour where the [status page](/status) shows success under 99.9 percent, every customer who made a failed
request in that hour gets 2 percent of their last pack back as credits. The number that counts is the outside
probe, which calls the public API every minute from a different network.
