# Rate limits and pagination

The tiktornado API's limits per key, per IP and per customer, what a 429 answer looks like, and how cursor pagination works on posts and comments.

## The limits [#the-limits]

| Limit | Counts | Applies to |
| --- | --- | --- |
| 120 requests a minute | Per API key | API and MCP requests |
| 150 requests a minute | Per API key, at our network edge | API and MCP requests |
| 300 requests a minute | Per IP address, at our network edge | Every request to `api.tiktornado.com` |
| 60 upload links a minute | Per customer | `POST /uploads` |
| 20 replies a minute | Per customer | `POST /comments/{commentId}/replies` |
| 60 units of TikTok work a minute | Per customer | Uploads, posts, edits, cancels, replies and the account reads (see below) |

The limit of 120 a minute per key is the one to plan for. It is a bucket of 120 that refills steadily, about 2 a second, so you can send a burst and then keep going at that pace. The edge limits are counted at each edge location on its own, so they are approximate. They stop floods before they reach the API.

Limits per customer are shared by every key you have.

### TikTok work per customer [#tiktok-work-per-customer]

Requests that reach TikTok also count against a budget of 60 a minute, shared by all your keys:

| Request | Costs |
| --- | --- |
| `POST /uploads` | 1 |
| `POST /posts` | 3, plus 1 for each media item and 1 for a `coverImageRef` |
| `PATCH /posts/{postId}` | 1, plus 1 for each new media item and 1 for a new `coverImageRef`. 3 instead of 1 when the post never reached TikTok's scheduler |
| `DELETE /posts/{postId}` | 1 |
| `POST /comments/{commentId}/replies` | 1 |
| `GET /accounts/{accountId}/post-options`, `/music` and `/locations` | 1 each |

So you can schedule about 15 single-video posts a minute, or 12 if you upload each file first. A post with 35 photos costs 38, so it takes most of a minute's budget on its own.

### MCP requests [#mcp-requests]

Every request to the MCP server checks your key first, which counts as one request against your key's 120 a minute. A tool call then makes its own API request, so each tool call counts as two.

## When you go over [#when-you-go-over]

Every limit answers the same way: status `429`, reason `slow_down`, and a `Retry-After` header in seconds.

```json operation="GET /accounts" kind="response" status="429"
{
  "error": {
    "reason": "slow_down",
    "message": "You're going a bit fast. Wait a moment and try again."
  }
}
```

```text
HTTP/1.1 429 Too Many Requests
Retry-After: 60
```

- `Retry-After` is always `60`: every limit refills within a minute.
- There are no other rate limit headers. Nothing tells you how many requests are left, so pace yourself and back off on `429`.
- A `429` is never stored under an `Idempotency-Key`. Retry the change with the same key once you have waited.
- From MCP, a tool call over a limit comes back as a tool error with reason `slow_down`. A request refused at the edge, or when the key is checked, answers HTTP `429` instead.

## Several requests at once [#several-requests-at-once]

Changes to one account are fastest one at a time. Each save reads the account's posts around its time, to apply the daily limit, so saves to the same account sent in parallel get in each other's way: some can fail with `500` `unknown_error`. Retry those with the same `Idempotency-Key`. Saves for different accounts can run in parallel.

`queue: true` posts read the account's next 4 weeks, so send queued posts to one account strictly one after another.

## Pagination [#pagination]

`GET /posts` and `GET /posts/{postId}/comments` answer one page at a time:

| Parameter | Meaning |
| --- | --- |
| `limit` | Items per page, a whole number from 1 to 100. 25 if left out |
| `cursor` | The `nextCursor` of the previous page. Leave it out for the first page |

Each answer carries `nextCursor`. Pass it back as `cursor`, with the same other parameters, to get the next page. It is `null` on the last page.

```bash
curl "https://api.tiktornado.com/api/v1/posts?limit=50&cursor=<nextCursor>" \
  -H "Authorization: Bearer $TIKTORNADO_API_KEY"
```

- A page can hold fewer items than `limit` and still not be the last: `GET /posts` leaves out posts on accounts whose subscription isn't active. Keep going until `nextCursor` is `null`.
- Posts come newest scheduled time first. Comments come newest first.
- A `limit` outside 1 to 100, or a `cursor` we can't read, answers `400` `invalid_request`.
- `GET /accounts` isn't paged: it answers all your accounts at once.