How Environments Work
The environment is determined by your API key prefix:| Key Prefix | Environment | Purpose |
|---|---|---|
sk_live_... | Live | Production - real OnlyFans requests |
sk_sandbox_... | Sandbox | Testing - deterministic fixtures |
Creating API Keys
- Go to OFAuth Dashboard > Developers > API Keys
- Create keys for both environments:
- Sandbox key for development and testing
- Live key for production
Sandbox Test Credentials
Use these test accounts to complete Link authentication flows:| Scenario | Email format | Password | OTP |
|---|---|---|---|
| Creator (no 2FA) | {identifier}@creator.sandbox.com | good-password | — |
| Creator (with OTP) | {identifier}@creator-otp.sandbox.com | good-password | 123456 |
| Fan (no 2FA) | {identifier}@fan.sandbox.com | good-password | — |
| Fan (with OTP) | {identifier}@fan-otp.sandbox.com | good-password | 123456 |
Any identifier works (e.g.,
demo, user123, test). The domain controls the behavior.What You Can Test
| Feature | Sandbox Behavior |
|---|---|
| Link | Full auth flows with test credentials |
| Access API | Returns realistic fixture data |
| Webhooks | Simulated events mirror production payloads |
| SDK | Identical behavior to production |
Environment Differences
| Aspect | Sandbox | Live |
|---|---|---|
| Data source | Deterministic fixtures | Real OnlyFans data |
| Billing | Free | Pay per usage |
| Rate limits | Same as production | Same |
| API behavior | Identical | Identical |
Switching Environments
Simply change your API key—no code changes required:Common Troubleshooting
Wrong password error
Wrong password error
Use
good-password for all sandbox test accounts.OTP required but not expected
OTP required but not expected
Only
*-otp.sandbox.com accounts require OTP. The code is always 123456.Invalid email error
Invalid email error
Verify the domain format:
creator.sandbox.com, creator-otp.sandbox.com, fan.sandbox.com, or fan-otp.sandbox.com.Data doesn't persist
Data doesn't persist
Sandbox data is deterministic fixtures, not persistent storage. Treat responses as test fixtures.