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

# API reference

> The managed REST API: authenticate with a bearer key, connect an OnlyFans account once, then call any method or stream events over HTTP.

The REST API is a managed HTTP surface over the same capabilities as the SDK.
You authenticate with a bearer API key, connect an OnlyFans account once, then
call any method or stream realtime events — with nothing to host and no session
management of your own.

```
Base URL   https://api.onlyfanskit.dev
Auth       Authorization: Bearer <api-key>
Errors     application/problem+json  (RFC 9457)
```

## The flow

<Steps>
  <Step title="Authenticate">
    Send your API key as a bearer token. Confirm it with `GET /v1/me`. See
    [Authentication](/authentication).
  </Step>

  <Step title="Connect an account">
    `POST /v1/connect/*` links an OnlyFans account and returns an account `id`.
    See [Connect an account](/build/overview) or the [connect flows](/connect/overview).
  </Step>

  <Step title="Act on it">
    `POST /v1/accounts/{id}/{resource}/{method}` calls any SDK method.
    Enumerate them with `GET /v1/sdk/methods`.
  </Step>

  <Step title="Receive events">
    Stream over [SSE](/realtime/server-sent-events) or register a
    [webhook](/realtime/webhooks).
  </Step>
</Steps>

## Two API surfaces

This reference documents the **platform API** (`/v1/*`) — the endpoints you
call to manage and act on accounts. The OnlyFans API surface that the SDK
wraps is documented as typed [SDK resources](/sdk/overview); reach any of it
through the generic SDK passthrough below.

## Calling any SDK method

The single most useful endpoint is the SDK passthrough:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# object-arg form (most methods)
curl -X POST https://api.onlyfanskit.dev/v1/accounts/$ID/posts/feed \
  -H "Authorization: Bearer $OFK_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "limit": 10 }'

# positional-args form
curl -X POST https://api.onlyfanskit.dev/v1/accounts/$ID/messages/send \
  -H "Authorization: Bearer $OFK_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "args": [123456, { "text": "Hi!" }] }'

# read methods also work over GET
curl "https://api.onlyfanskit.dev/v1/accounts/$ID/chats/list?limit=20" \
  -H "Authorization: Bearer $OFK_KEY"
```

It maps onto `of.{resource}.{method}(...args)` and returns
`{ "result": ... }`. Use the endpoint pages in this section for the managed
endpoints (connect, accounts, webhooks, events) and
[SDK resources](/sdk/overview) for the method catalog.
