BetterFans Link SDK — OnlyFans APIBetterFans Link SDK
API Reference

OnlyFans API Reference

Complete OnlyFans API route reference — chats, messages, posts, users, subscriptions, vault, stories, earnings. Every route is fully typed in the BetterFans Link SDK, the infrastructure behind OFManager.

Every route on the OnlyFans API is available through the SDK with full type safety. Route strings, query parameters, request bodies, and responses are all typed at compile time.

How routes work

Routes follow the "VERB /path" format. TypeScript uses the route string to infer the exact parameter and response types:

// TypeScript knows this route returns a UserFull
const [err, me] = await account.request("GET /users/me", {})
me.name // ✓ autocomplete works

// TypeScript knows this route needs pathParams.id and a body
const [err, msg] = await account.request("POST /chats/:id/messages", {
  pathParams: { id: "12345" },
  body: { text: markdownToHtml("Hello!") },
})

If you mistype a route, TypeScript catches it at compile time:

// ✗ Type error — no such route
await account.request("GET /chat", {})

Route domains

Extracting types

You can extract the input and output types for any route:

import type { ApiRoutes } from "@betterfans/link-sdk"

// Response type for a specific route
type ChatList = ApiRoutes["GET /chats"]["response"]

// Query parameters for a route
type ChatQuery = ApiRoutes["GET /chats"]["query"]

// Path parameters for a route (when applicable)
type MessagePath = ApiRoutes["POST /chats/:id/messages"]["pathParams"]
// { id: string }

// Request body for a write route
type SendBody = ApiRoutes["POST /chats/:id/messages"]["body"]

On this page