# onlyfanskit > Build on OnlyFans from TypeScript, REST, the CLI, or an AI agent. Connect an account, read and send messages, pull earnings, and react to events in real time. ## Docs - [Assistant](https://docs.onlyfanskit.dev/.mintlify/Assistant.md) - [Get caller identity](https://docs.onlyfanskit.dev/api-reference/account/get-caller-identity.md): Returns the identity behind the API key — org, plan, scopes, and resolved limits. - [Get usage and rate limits](https://docs.onlyfanskit.dev/api-reference/account/get-usage-and-rate-limits.md): Current usage counters plus the org and per-account rate-limit windows. Requires the `usage:read` scope. - [List API keys](https://docs.onlyfanskit.dev/api-reference/account/list-api-keys.md): List keys in the caller's org. Requires `me:read`. - [Mint an API key](https://docs.onlyfanskit.dev/api-reference/account/mint-an-api-key.md): Issue another key in the caller's org. A new key can never hold more scopes than the caller. The plaintext key is shown once. Requires `me:write`. - [Revoke an API key](https://docs.onlyfanskit.dev/api-reference/account/revoke-an-api-key.md): Revoke a key in the caller's org. You cannot revoke the key you are calling with. Requires `me:write`. - [Disconnect an account](https://docs.onlyfanskit.dev/api-reference/accounts/disconnect-an-account.md): Disconnect the account and purge its sealed session. Requires `accounts:write`. - [Get a connected account](https://docs.onlyfanskit.dev/api-reference/accounts/get-a-connected-account.md) - [List connected accounts](https://docs.onlyfanskit.dev/api-reference/accounts/list-connected-accounts.md): List every OnlyFans account connected under the caller's key. Requires `accounts:read`. - [Reauthenticate an account](https://docs.onlyfanskit.dev/api-reference/accounts/reauthenticate-an-account.md): Re-acquire a fresh session using the account's sealed stored credentials. Only works when the account was connected with `remember_credentials: true`. Returns an attempt that completes in one trip when no 2FA is required, or parks on `needs_app_otp`. Requires `accounts:write`. - [Validate an account session](https://docs.onlyfanskit.dev/api-reference/accounts/validate-an-account-session.md): Smoke-test that the account's stored session still works by fetching the creator's own profile from OnlyFans. Returns 410 if the session is missing and the account must reconnect. - [Cancel a connect attempt](https://docs.onlyfanskit.dev/api-reference/connect/cancel-a-connect-attempt.md): Cancel and clear an in-flight attempt. - [Connect from a browser cookie](https://docs.onlyfanskit.dev/api-reference/connect/connect-from-a-browser-cookie.md): Link an OnlyFans account from credentials already extracted from a logged-in browser session. The session is validated against `/users/me` through a proxy, sealed, and a new account id is returned. Requires `accounts:write`. - [Connect from a cURL export](https://docs.onlyfanskit.dev/api-reference/connect/connect-from-a-curl-export.md): Link an account by pasting a browser 'Copy as cURL' export. The cookie, x-bc, and user id are parsed from the command; supply them explicitly to override. Requires `accounts:write`. - [Connect with email + password](https://docs.onlyfanskit.dev/api-reference/connect/connect-with-email-+-password.md): Start an attempt-based login. Returns immediately with an `attempt_id` and `polling_url`; the login runs in the background. Poll `GET /v1/connect/login/{attemptId}` until `state` is `completed_success` (an `account_id` is present) or a challenge state (`needs_otp`, `needs_app_otp`, `needs_email`, `n… - [Create an embeddable connect session](https://docs.onlyfanskit.dev/api-reference/connect/create-an-embeddable-connect-session.md): Start a hosted connect session the creator completes in a popup or iframe (no API key on the front end). Returns an `embed_url` and `phone_url`. Requires `accounts:write`. - [Poll a connect attempt](https://docs.onlyfanskit.dev/api-reference/connect/poll-a-connect-attempt.md): Returns the current state of an in-flight or completed login attempt. When two-factor is required the attempt parks on the matching state and `next_actions` describes what to submit next. - [Submit a 2FA code](https://docs.onlyfanskit.dev/api-reference/connect/submit-a-2fa-code.md): Submit an SMS / authenticator code, or signal that selfie verification has completed. A wrong code parks the attempt on `wrong_2fa_code_retry` so it can be re-submitted. - [Trigger the device-verification email](https://docs.onlyfanskit.dev/api-reference/connect/trigger-the-device-verification-email.md): When an attempt parks on `needs_email`, this triggers OnlyFans to send the device-verification code to the creator's email. Submit the code with `PUT /v1/connect/login/{attemptId}`. - [API reference](https://docs.onlyfanskit.dev/api-reference/introduction.md): The managed REST API: authenticate with a bearer key, connect an OnlyFans account once, then call any method or stream events over HTTP. - [Stream realtime events (SSE)](https://docs.onlyfanskit.dev/api-reference/realtime/stream-realtime-events-sse.md): Server-Sent Events stream of the account's realtime activity — new messages, subscriptions, tips, posts, streams, and more. Each SSE message carries the OnlyFans event name as the `event:` field and `{ data, meta, ts }` as `data:`. Send `Accept: text/event-stream`. Clients that send `Last-Event-ID`… - [Call a read-only SDK method](https://docs.onlyfanskit.dev/api-reference/sdk/call-a-read-only-sdk-method.md): GET form of the SDK passthrough for read methods. The query string is passed as a single object argument. - [Call any SDK method](https://docs.onlyfanskit.dev/api-reference/sdk/call-any-sdk-method.md): Generic passthrough that maps onto `of.{resource}.{method}(...args)` on the connected account. Accepts positional args via `{ "args": [...] }`, a bare array, or a single object body (most methods). GET is supported for read methods — the query string becomes a single object arg. Requires `sdk:call`.… - [Enumerate SDK methods](https://docs.onlyfanskit.dev/api-reference/sdk/enumerate-sdk-methods.md): Discoverable map of every SDK resource to its method names. Lets agents enumerate what they can do with an account without reading source. Auth-required. - [Delete the webhook config](https://docs.onlyfanskit.dev/api-reference/webhooks/delete-the-webhook-config.md) - [Get the webhook config](https://docs.onlyfanskit.dev/api-reference/webhooks/get-the-webhook-config.md): Returns the configured webhook for an account. The signing secret is only returned on write. Requires `webhooks:read`. - [Send a test webhook event](https://docs.onlyfanskit.dev/api-reference/webhooks/send-a-test-webhook-event.md): Delivers a synthetic `test` event to the configured webhook for connectivity testing, signed the same way as live events. Requires `webhooks:write`. - [Set the webhook config](https://docs.onlyfanskit.dev/api-reference/webhooks/set-the-webhook-config.md): Register or replace the webhook destination for an account. The returned `signingSecret` is used to verify the `X-Webhook-Signature` HMAC on delivered events — store it on write. Requires `webhooks:write`. - [Authentication](https://docs.onlyfanskit.dev/authentication.md): Authenticate to the REST API with a bearer API key, manage keys, and scope them down for least-privilege automations. - [Commands](https://docs.onlyfanskit.dev/cli/commands.md): Every onlyfans CLI command — connect accounts, manage them, send messages, stream events, and run health checks. - [CLI](https://docs.onlyfanskit.dev/cli/overview.md): Drive common tasks from the terminal — no code required. - [Core concepts](https://docs.onlyfanskit.dev/concepts.md): The core nouns — account, connect attempt, resource and method, API key and scope, and realtime delivery — and how they relate. - [Connect from a cookie](https://docs.onlyfanskit.dev/connect/cookie.md): Link an OnlyFans account from an existing logged-in session by posting its cookie and x-bc value. - [Connect from a cURL export](https://docs.onlyfanskit.dev/connect/curl.md): Link an OnlyFans account by pasting a browser 'Copy as cURL' export — the cookie, x-bc, and user id are extracted for you. - [Embedded connect](https://docs.onlyfanskit.dev/connect/embed.md): Drop a connect flow into your own product. - [Connect with email + password](https://docs.onlyfanskit.dev/connect/login.md): Connect an account with the creator's email and password. Start a login, poll until it resolves, and handle any SMS, authenticator, or email challenge. - [Connect via mobile / QR](https://docs.onlyfanskit.dev/connect/mobile.md): The creator signs in on their own device — you never see credentials. - [Connect an account](https://docs.onlyfanskit.dev/connect/overview.md): Four ways to link an OnlyFans account: paste a cookie, import a request, log in with email and password, or let the creator approve on their own device. - [Two-factor & challenges](https://docs.onlyfanskit.dev/connect/two-factor.md): Resolve SMS, authenticator, email, and selfie challenges during connect, and reauthenticate an account from stored credentials. - [Content & posts](https://docs.onlyfanskit.dev/guides/content-and-posts.md): Create posts, manage the vault, schedule, and stories. - [Earnings & analytics](https://docs.onlyfanskit.dev/guides/earnings-and-analytics.md): Pull revenue, transactions, and performance stats. - [Fans & subscribers](https://docs.onlyfanskit.dev/guides/fans-and-subscribers.md): List fans, track subscriptions, segment audiences. - [Mass messaging](https://docs.onlyfanskit.dev/guides/mass-messaging.md): Send to many fans and track campaign performance. - [Messaging & chats](https://docs.onlyfanskit.dev/guides/messaging.md): Read conversations, send messages, manage chats. - [onlyfanskit](https://docs.onlyfanskit.dev/introduction.md): Build on OnlyFans from TypeScript, REST, the CLI, or an AI agent. Connect an account, read and send messages, pull earnings, and react to events in real time. - [Hosted MCP](https://docs.onlyfanskit.dev/mcp/hosted.md): Use the platform's MCP endpoint without running a server. - [Install & configure](https://docs.onlyfanskit.dev/mcp/install.md): Run the MCP server and connect an agent. - [AI / MCP](https://docs.onlyfanskit.dev/mcp/overview.md): Drive an OnlyFans account from any MCP-compatible agent. - [Tools](https://docs.onlyfanskit.dev/mcp/tools.md): How the tool catalog is organized. - [Error handling](https://docs.onlyfanskit.dev/platform/errors.md): Every API error is a parseable RFC 9457 problem document — built for both humans and AI agents to know what failed, whether to retry, and what to do next. - [Rate limiting](https://docs.onlyfanskit.dev/platform/rate-limiting.md): How limits are enforced and how to back off. - [Scopes](https://docs.onlyfanskit.dev/platform/scopes.md): What each API key is allowed to do. - [Quickstart](https://docs.onlyfanskit.dev/quickstart.md): From zero to a working OnlyFans call in about two minutes. Connect an account, then read your profile and send a message — over REST or with the TypeScript SDK. - [Realtime overview](https://docs.onlyfanskit.dev/realtime/overview.md): Three ways to receive account activity as it happens. - [Server-Sent Events](https://docs.onlyfanskit.dev/realtime/server-sent-events.md): Subscribe to a connected account's live activity over HTTP. - [Webhooks](https://docs.onlyfanskit.dev/realtime/webhooks.md): Receive signed HTTP callbacks for account events. - [WebSocket (SDK)](https://docs.onlyfanskit.dev/realtime/websocket.md): Connect directly to the realtime stream from the SDK. - [Connecting the client](https://docs.onlyfanskit.dev/sdk/client.md): Create an OnlyFans client from a connected account session, with options for custom transport and credentials. - [Handling errors](https://docs.onlyfanskit.dev/sdk/errors.md): Catch OnlyFansAPIError, read its status and body, and know what the common OnlyFans error responses mean. - [TypeScript SDK](https://docs.onlyfanskit.dev/sdk/overview.md): A typed OnlyFans client for your backend. Strongly typed across every API domain, zero runtime dependencies, with built-in realtime and webhooks. - [Account & identity](https://docs.onlyfanskit.dev/sdk/resources/account-and-identity.md): SDK resources for the creator and their audience: users, subscriptions, security, helpers, sessions, referrals, and streaks. - [Content](https://docs.onlyfanskit.dev/sdk/resources/content.md): SDK resources for content: posts, comments, media vault, stories, highlights, streams, bookmarks, and labels. - [Growth & promo](https://docs.onlyfanskit.dev/sdk/resources/growth.md): SDK resources for growth: campaigns, trial links, promotions, audience lists, scheduling, following, and social links. - [Messaging](https://docs.onlyfanskit.dev/sdk/resources/messaging.md): SDK resources for messaging: direct and mass messages, chats, and notifications. - [Money](https://docs.onlyfanskit.dev/sdk/resources/money.md): SDK resources for money (creator-only): earnings, payments, payouts, chargebacks, and bulk data exports. - [Support, compliance & metadata](https://docs.onlyfanskit.dev/sdk/resources/support-and-metadata.md): SDK resources for support, compliance, and reference data: tickets, reports, release forms, discovery, ISO lookups, and static pages. ## OpenAPI Specs - [openapi](https://docs.onlyfanskit.dev/api-reference/openapi.json)