ofapisv1
solution

OnlyFans Auto Reply Bot

An OnlyFans auto reply bot is a tight loop: an inbound DM arrives, you read enough context to answer, you pick a reply — a canned rule, an away message, or a model completion — and you send it. ofapis gives you the message.received webhook for the trigger and plain REST for the read and the send, so the logic in the middle is entirely yours.

The loop

message.received webhook
      │ (verify HMAC, 200 fast, enqueue)
      ▼
GET  /accounts/{id}/chats/{chatId}/messages   ← recent context
      ▼
   rule match / away-hours / LLM              ← decide
      ▼
POST /accounts/{id}/chats/{chatId}/messages   ← reply (1 credit)

Base URL: https://api.ofapis.com/api/public/v1.

1. Catch the message

Subscribe an HTTPS endpoint to message.received in the dashboard. Every delivery is signed, so verify the X-Ofapis-Signature HMAC against the raw body before doing anything, then return 200 immediately and process in a background job — never block the webhook on model latency. Deduplicate on the event id; delivery is at-least-once. Full contract is on the webhooks page.

2. Decide the reply

Auto-reply bots usually run a rule ladder before falling back to a model:

Pull that context cheaply:

curl "https://api.ofapis.com/api/public/v1/accounts/42/chats/456/messages?limit=15" \
  -H "Authorization: Bearer ofapis_sk_..."

3. Send it

curl -X POST https://api.ofapis.com/api/public/v1/accounts/42/chats/456/messages \
  -H "Authorization: Bearer ofapis_sk_..." -H "Content-Type: application/json" \
  -d '{"text":"hey! I reply to every message here — what are you after? 😊"}'

A 200 means delivered and one credit spent. Expired-session or upstream failures aren't charged, so a retrying bot stays cost-safe.

Build outline

  1. Webhook receiver — verify signature, dedupe on id, enqueue, ack 200.
  2. Rule engine — ordered matchers (away → keyword → first-touch → fallback).
  3. Context fetch — read the last ~15 messages only when the rule needs them.
  4. SenderPOST .../messages; log the outbound for auditing.
  5. Handoff flag — high-value or "talk to a human" intents skip auto-send and route to a chatter.

Gotchas

FAQ

Should the bot use webhooks or polling?

Webhooks. Polling GET /chats spends a credit on every empty check and adds latency equal to the interval. message.received pushes only real inbound DMs, so the bot reacts instantly and cheaply.

How do I stop the bot replying to its own messages?

Check the sender in the webhook payload and ignore events originating from the creator account. Without that guard, each auto-reply can retrigger the loop.

Can I mix canned rules with an LLM?

Yes. Run an ordered rule ladder first (away hours, keywords, first-touch) and fall through to a model only when nothing matches. The send step is identical either way — it's just POST .../messages.

How is the bot billed?

One credit per successful reply sent. Inbound webhook deliveries are free, and failed sends aren't charged, so cost tracks replies actually delivered. See pricing.

Start free · Automate OnlyFans DMs · Messaging API

Related: OnlyFans automation guide

Related guides

All guides
Start free — 250 credits, no card
Generate a token and make your first call in minutes.
Get started