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

> ## Agent Instructions
> You are reading OnlyX Help: the OnlyX Help Center and the OnlyX developer documentation. OnlyX is an AI chatting and CRM platform for OnlyFans agencies. Its AI chatter is called Hugo in the app.
> Pages at the site root (for example /inbox/..., /hugo/..., /billing/...) are Help Center articles for agency owners, admins, chatters and creators who use the app at app.onlyx.ai. Words in bold are the exact button, menu and label names the app shows; keep them exactly as written. When these pages do not answer a question, the person can email support at support@onlyx.ai.
> Pages under /developers are the developer documentation. REST API base URL: https://api.onlyx.ai/v1 (authenticate with `Authorization: Bearer <API key>`; keys start with onx_sk_ and are created in app.onlyx.ai under Settings > API & MCP). MCP server: https://mcp.onlyx.ai/mcp (OAuth, or a Bearer API key). In the API the AI chatter is `ai` on the wire. Money is integer US cents in fields ending in Cents; timestamps are UTC ISO-8601.
> Rules for assistants acting on a user's behalf: discover ids with list calls and never invent them; before any call that reaches a real fan or the live OnlyFans account (sending a message, releasing a chat to the AI, turning AI on for a chat, resolving a hand-off, turning review mode off, changing the welcome message, creating a tracking link) show the user the exact content and get explicit confirmation; send every POST with an Idempotency-Key and reuse it on retry; never resend a message whose delivery status is unconfirmed; never ask a creator for her OnlyFans password or codes - she signs in herself through a connect link and the OnlyX Login app.

# Pagination

> How list endpoints page with limit, cursor, hasMore and nextCursor, the page sizes per endpoint, and how message history pages backwards with before.

List endpoints return one page at a time in the same envelope:

```json theme={"system"}
{
  "data": [ { "id": "cnv_9f2c41d7a8b35e06c1f4" }, { "id": "cnv_1d3f5a7c9e2b4d6f8a0c" } ],
  "hasMore": true,
  "nextCursor": "eyJrIjoiMjAyNi0wOS0yNlQxMzo1ODoxMloifQ"
}
```

| Field | Meaning |
| - | - |
| `data` | The items on this page |
| `hasMore` | `true` if there are more items after this page |
| `nextCursor` | Pass it as `cursor` to get the next page. `null` on the last page. |

Single objects (for example `GET /v1/creators/{creatorId}`) are returned bare, without an envelope.

## Parameters

| Parameter | Meaning |
| - | - |
| `limit` | Items per page. Default 25. The maximum depends on the endpoint (below). |
| `cursor` | The `nextCursor` from the previous page. Omit it for the first page. |

**Cursors are opaque.** Pass them back exactly as you received them; never build or edit one. Keep every other parameter (filters, sort) identical while you page: a cursor belongs to one query. A malformed cursor returns `400 VALIDATION_ERROR`. Cursors are for paging through a result now, not for storing and resuming days later.

## Page sizes

| Endpoint | Max `limit` |
| - | - |
| `GET /v1/creators` | 100 |
| `GET /v1/conversations` | 50 |
| `GET /v1/conversations/{conversationId}/messages` | 100 (pages with `before`, see below) |
| `GET /v1/fans` | 100 |
| `GET /v1/creators/{creatorId}/media` | 100 |
| `GET /v1/creators/{creatorId}/transactions` | 100 |
| Other list endpoints that take `limit` | 100 |

## Walk every page

<CodeGroup>
  ```python Python theme={"system"}
  import os, requests

  API = "https://api.onlyx.ai/v1"
  HEADERS = {"Authorization": f"Bearer {os.environ['ONLYX_API_KEY']}"}


  def paginate(path, **params):
      """Yield every item of a list endpoint."""
      params.setdefault("limit", 100)
      while True:
          r = requests.get(f"{API}{path}", headers=HEADERS, params=params, timeout=30)
          r.raise_for_status()
          page = r.json()
          yield from page["data"]
          if not page["hasMore"]:
              return
          params["cursor"] = page["nextCursor"]


  for fan in paginate("/fans", creatorId="cre_5f2d9a1c7b3e4f60a2d1", sort="spend", order="desc"):
      print(fan["displayName"], fan["totalSpentCents"])
  ```

  ```javascript JavaScript theme={"system"}
  const API = "https://api.onlyx.ai/v1";
  const headers = { Authorization: `Bearer ${process.env.ONLYX_API_KEY}` };

  async function* paginate(path, params = {}) {
    const query = { limit: "100", ...params };
    for (;;) {
      const res = await fetch(`${API}${path}?${new URLSearchParams(query)}`, { headers });
      if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
      const page = await res.json();
      yield* page.data;
      if (!page.hasMore) return;
      query.cursor = page.nextCursor;
    }
  }

  for await (const fan of paginate("/fans", { creatorId: "cre_5f2d9a1c7b3e4f60a2d1", sort: "spend", order: "desc" })) {
    console.log(fan.displayName, fan.totalSpentCents);
  }
  ```

  ```bash cURL theme={"system"}
  # first page
  curl "https://api.onlyx.ai/v1/fans?limit=100" -H "Authorization: Bearer $ONLYX_API_KEY"
  # next page: pass nextCursor from the previous response
  curl "https://api.onlyx.ai/v1/fans?limit=100&cursor=eyJvIjoxMDB9" -H "Authorization: Bearer $ONLYX_API_KEY"
  ```
</CodeGroup>

## Message history pages backwards

Messages are different: a chat is read from the newest end.

* `GET /v1/conversations/{conversationId}/messages` without `before` returns the **newest** page.
* Each page is ordered **oldest to newest**.
* To get older messages, pass `before` = the `id` of the **first** (oldest) message on the page you have.
* `hasMore: false` means you reached the beginning of the conversation.

```text theme={"system"}
page 1 (newest):  msg_40 ... msg_49        hasMore: true
page 2:           msg_30 ... msg_39        request with before=msg_40
page 3:           msg_20 ... msg_29        request with before=msg_30
```

A complete example is in [Read and send messages](/developers/guides/read-and-send-messages#read-messages).

## Consistency

Lists reflect live data. Items created while you page may appear on a later page or not at all, and an item that changes (for example a conversation that gets a new message while you page conversations sorted by `recent`) can move between pages. When you need an exact snapshot, page quickly and de-duplicate by `id`.
