Create Client Session
Create a token for the @onlyfansapi/auth popup. Omit account_id to connect a new account. To update credentials on an existing OnlyFans account, send only account_id from your backend and pass data.token to updateOnlyFansCredentials(token, options). Team ownership and API-key account access are required. Update sessions preserve the account identity, permissions, name, and proxy, and prefill an editable login email. They accept new submissions and explicit retries for 30 minutes; an already-started attempt can finish within its authentication deadline. Success prevents further submissions with that token. New authentication attempts are limited to three per account per minute (429 with Retry-After: 60); duplicate submissions resume the same attempt. Closing the popup does not cancel authentication. Submitted credentials remain saved if login fails; retries never delete the account.
Authorization
default Get your API Key from OnlyFansAPI Console - https://app.onlyfansapi.com/api-keys
In: header
Request Body
application/json
Existing OnlyFans account to reconnect (for example acct_XXXXXXXXXX). Cannot be combined with display_name, client_reference_id, proxy_country, scopes, or app_name. Omit to create a new connection.
Display name for a new connection. Required only when account_id is omitted.
Your Internal Reference ID for the connected account.
"us" | "uk" | "gb"Account access scopes. Defaults to ["*"] for full access. account.read is always included in limited access.
App name shown on the access screen. Required when scopes is not ["*"].
Response Body
application/json
curl -X POST "https://app.fansapi.com/api/client-sessions" \ -H "Content-Type: application/json" \ -d '{}'{
"data": {
"token": "ofapi_cs_OriR8Sdocp0f97eFOdbMMZtiz4Aw5FLX",
"display_name": "STRLCxGLVC Agency / Model: Stella",
"client_reference_id": "my_crm_model_12345"
},
"_meta": {
"_credits": {
"used": 0,
"balance": 224907,
"note": "Always"
},
"_cache": {
"is_cached": false,
"note": "Cache disabled for this endpoint"
},
"_rate_limits": {
"limit_minute": 1000,
"limit_day": 50000,
"remaining_minute": 999,
"remaining_day": 49999
}
}
}