> ## 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.

# Authentication

> Authenticate to the REST API with a bearer API key, manage keys, and scope them down for least-privilege automations.

The REST API authenticates with a bearer **API key**.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://api.onlyfanskit.dev/v1/me \
  -H "Authorization: Bearer $OFK_KEY"
```

Create and manage keys in the [dashboard](https://onlyfanskit.dev/dashboard),
or mint additional keys programmatically:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST https://api.onlyfanskit.dev/v1/me/keys \
  -H "Authorization: Bearer $OFK_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "label": "ci", "scopes": ["accounts:read", "sdk:call"] }'
```

<Warning>
  The plaintext key is shown **once**, on creation. Store it securely. A key
  can never be issued with more scopes than the caller that mints it.
</Warning>

## Identity

`GET /v1/me` returns who you are — your org, plan, scopes, and resolved
limits. Use it to confirm a key works and to discover what it can do.

## Scopes

Every key carries a set of scopes. The everyday set
(`accounts:read`, `accounts:write`, `sdk:call`, `webhooks:read`,
`webhooks:write`, `me:read`, `me:write`, `usage:read`) is granted by default;
mint narrower keys for least-privilege automations. Full list in
[Scopes](/platform/scopes).

## Connecting vs. calling

Two distinct steps on the hosted platform:

1. **Connect** an OnlyFans account once — onlyfanskit captures and stores the
   session on our infrastructure. See [Connect an account](/connect/overview).
2. **Call** methods or **stream** events against that account using your API
   key and the account `id`.

You do not ship session cookies or host your own login pages.

## TypeScript SDK

The SDK documents method signatures and types. **Execute calls through the REST
API** unless you run on onlyfanskit internal infrastructure. See
[TypeScript SDK](/sdk/overview) and [Connecting the client](/sdk/client).
