> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.minikai.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.minikai.com/_mcp/server.

# Pagination

List endpoints such as `GET /api/v1/Records` are cursor-paginated. Rather than page numbers, you ask for a number of
items relative to a cursor, and the response hands you the cursors you need to keep going. This stays stable even while
records are being added.

## Response shape

A paginated response wraps the results alongside the cursors and a total count:

```json
{
  "items": [/* ... */],
  "beforeCursor": "0f8c1e2a-...",
  "afterCursor": "7b3d9a14-...",
  "totalCount": 248
}
```

* `items` holds the page of results.
* `afterCursor` points at the next page.
* `beforeCursor` points at the previous page.
* `totalCount` is the total number of matching records.

## Request a page

Pass a cursor together with a limit. To move forward, use `afterCursor` with `limitAfter`; to move back, use
`beforeCursor` with `limitBefore`. Omit the cursor on the first request to start from the beginning.

`$MINIKAI_BASE_URL` below is your region's base URL, which [Data regions](/guides/get-started/data-regions) lists.

```bash
# First page: the most recent 50 records
curl "$MINIKAI_BASE_URL/api/v1/Records?limitAfter=50" \
  -H "Authorization: Bearer sk_live_..."

# Next page: pass the afterCursor from the previous response
curl "$MINIKAI_BASE_URL/api/v1/Records?afterCursor=7b3d9a14-...&limitAfter=50" \
  -H "Authorization: Bearer sk_live_..."
```

Set `sortDescending=false` to return oldest records first. When `afterCursor` comes back empty, you have reached the end
of the results.