Skip to main content
API responses include media.ofauth.com URLs for all media. These URLs automatically route to either edge cache or persistent storage (Vault Cache), and trigger auto-caching based on your configuration.
Media ProxyVault Cache
What it doesEdge-cached URLsPersistent storage with access by ID
SetupAutomaticEnable per connection
Best forDisplaying contentMedia libraries, PPV features

Displaying Media

Use media.ofauth.com URLs directly in your app:
<img src="https://media.ofauth.com/abc123..." />
<video src="https://media.ofauth.com/xyz789..." controls />
When requested:
  1. If cached in Vault Cache → serves from persistent storage
  2. Otherwise → fetches from OnlyFans, caches at edge

Setting Up Vault Cache

Enable for a Connection

curl -X PATCH 'https://api.ofauth.com/v2/settings/:connectionId' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ "vaultCache": { "enabled": true } }'

Configure Auto-Caching (Organization Defaults)

curl -X PATCH 'https://api.ofauth.com/v2/settings' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "vaultCache": {
      "autoEnableForNewConnections": true,
      "defaultSettings": {
        "autoCacheVault": true,
        "autoCacheMessages": false,
        "autoCachePosts": false
      }
    }
  }'
When autoCacheVault (or similar) is enabled, media is automatically queued for persistent storage when accessed via media.ofauth.com.

Triggering Caching

Via Media Proxy URL

POST to any media.ofauth.com URL to immediately queue for persistent storage:
curl -X POST 'https://media.ofauth.com/abc123...'

Cache an Entire Vault List

curl -X POST 'https://api.ofauth.com/v2/vault/cache/list/:listId' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'x-connection-id: conn_xxx'

Accessing Cached Media

Get by Media ID

curl -X GET 'https://api.ofauth.com/v2/vault/:mediaId' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'x-connection-id: conn_xxx'
Response:
{
  "mediaId": "12345",
  "presignedUrl": "https://...",
  "expiresAt": 1234567890,
  "status": "cached"
}

Batch Get URLs (up to 100)

curl -X POST 'https://api.ofauth.com/v2/vault/urls' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'x-connection-id: conn_xxx' \
  -H 'Content-Type: application/json' \
  -d '{ "mediaIds": ["12345", "12346", "12347"] }'

List Cached Media

curl -X GET 'https://api.ofauth.com/v2/vault/list?status=cached' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'x-connection-id: conn_xxx'

Purging Cached Media

Via Media Proxy URL

curl -X DELETE 'https://media.ofauth.com/abc123...'

Via API

curl -X DELETE 'https://api.ofauth.com/v2/vault/:mediaId' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'x-connection-id: conn_xxx'

Purge All for a Connection

curl -X DELETE 'https://api.ofauth.com/v2/vault/purge' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'x-connection-id: conn_xxx'