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.
Pick the surface that matches how you want to run. Both reach the same
capabilities.
Nothing to host. Connect an account once, then call any method over HTTP.
Get an API key
Create a key in the dashboard and
send it as a bearer token on every request. export OFK_KEY = "sk_..."
curl https://api.onlyfanskit.dev/v1/me -H "Authorization: Bearer $OFK_KEY "
Connect an account
The fastest path pastes a logged-in session. Other options —
login and a hosted page the creator approves — are in
Connect an account . curl https://api.onlyfanskit.dev/v1/connect/cookie \
-H "Authorization: Bearer $OFK_KEY " \
-H "Content-Type: application/json" \
-d '{ "cookie": "<your-cookie>", "xBc": "<your-x-bc>", "userId": "0" }'
The response includes an account id. Save it.
Make your first calls
Every method is reachable at /v1/accounts/{id}/{resource}/{method}. # Read the connected creator's profile
curl https://api.onlyfanskit.dev/v1/accounts/ $ACCOUNT_ID /users/me \
-H "Authorization: Bearer $OFK_KEY "
# Send a message
curl -X POST https://api.onlyfanskit.dev/v1/accounts/ $ACCOUNT_ID /messages/send \
-H "Authorization: Bearer $OFK_KEY " \
-H "Content-Type: application/json" \
-d '{ "args": [123456, { "text": "Hi!" }] }'
List everything you can call with GET /v1/sdk/methods. Embed a typed client in your own backend.
Create the client
Pass a connected account’s session. See
Connecting the client for where these come from. import { OnlyFans } from "onlyfanskit" ;
const of = new OnlyFans ({
cookie: "<your-cookie>" ,
xBc: "<your-x-bc>" ,
userId: "123456789" ,
userAgent: "<your-user-agent>" ,
});
Make your first calls
const me = await of.users. me ();
const feed = await of.posts. feed ({ limit: 10 });
await of.messages. send ( 123456 , { text: "Hi!" });
Next steps
Core concepts Accounts, connect attempts, and scopes — the nouns you’ll use everywhere.
Connect an account Cookie, login, mobile, and two-factor flows.
Build something Use-case guides for messaging, fans, content, and earnings.
Handle errors Every error is a parseable, agent-ready problem document.