Introduction
OnlyFans API Documentation
Docs for the OFManager OnlyFans API. Get your API key, install the typed TypeScript SDK, and work with chats, messages, fans, vault and earnings.
OnlyFans has no public API. OFManager gives you one: an API key from your OFManager account and a fully typed TypeScript SDK that can read and act on every creator you've linked. Chats, messages, mass messages, fans, vault media and earnings, all from your own code.
How it works
- Link your creators in OFManager. A key can only act as OnlyFans accounts linked to your OFManager account.
- Create an API key. Open API Keys in platform.ofmanager.com and create a key for your whole agency or for specific creators.
- Install the SDK and build. Download the SDK from the same page, pass your key to the client, and call any route with full type checking.
Start with Get API access, then make your first request in the Quickstart.
Every creator from one key
One API key reaches every creator your agency has linked. Scope the client to a creator with client.for() and call any route. Routes, parameters and responses are all typed, so your editor autocompletes chats.list and everything in it.
import { OfApiClient } from "@betterfans/link-sdk"
const client = new OfApiClient({ apiKey: process.env.OFM_API_KEY })
// Your creators' OnlyFans user IDs, listed on the API Keys page
const creators = ["111111111", "222222222"]
for (const creatorId of creators) {
const account = client.for(creatorId)
// The 10 most recent chats, newest first
const [error, chats] = await account.request("GET /chats", {
query: { limit: 10, offset: 0, order: "recent", skip_users: "all" },
})
if (error) {
console.error(creatorId, error.code, error.message)
continue
}
for (const chat of chats.list) {
console.log(`${creatorId} ${chat.withUser.name}: ${chat.lastMessage?.text ?? "(media)"}`)
}
}What's in these docs
- Quickstart: fetch a profile, list chats, send a message and listen to live events.
- Chatbot tutorial: auto-reply to new fans across every creator from one WebSocket.
- Core capabilities: upload photos and videos in one call.
- HTTP client: making requests, scoped clients, batching and error handling.
- Live events: new messages, subscribers, online fans and more for each creator, the moment they happen.
- API reference: every route by area, from chats and messages to vault and earnings.
- Revenue: pull transactions from a REST endpoint or receive them as signed webhooks.
- Types and utilities: the entity types and helpers the SDK exports.
Built for AI coding tools
Every route string, parameter and response is typed, so tools like Cursor, Claude Code and Replit autocomplete the whole API and catch mistakes before anything runs. Describe what you want to build, point your AI tool at these docs, and let it write the integration.
Need something the API doesn't cover yet? Message us on Telegram.