Skip to main content

What You Can Build

  • Media Management: Upload, organize, and manage content libraries
  • Content Embedding: Display OnlyFans media on your platform
  • Backup Tools: Download and archive creator content
  • Cross-Platform Sync: Manage media across multiple accounts

Quick Example

List media from the vault:
const response = await fetch("https://api.ofauth.com/v2/access/vault/media", {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const { list, hasMore } = await response.json()
console.log(`Found ${list.length} media items`)

Common Operations

List Vault Media

Get media from the vault with optional filters:
const response = await fetch("https://api.ofauth.com/v2/access/vault/media?" + new URLSearchParams({
  limit: "24",
  offset: "0",
  sortBy: "recent",         // "recent" | "most-liked" | "highest-tips"
  sortDirection: "desc",    // "asc" | "desc"
  mediaType: "photo"        // "photo" | "video" | "audio" | "gif"
}), {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const { list, hasMore } = await response.json()

Get Vault Lists (Folders)

OnlyFans organizes vault media into lists/folders:
const response = await fetch("https://api.ofauth.com/v2/access/vault/lists", {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const { list, all, hasMore } = await response.json()
// list: array of vault folders
// all: summary with total counts by type

Get Media in a Specific List

const response = await fetch("https://api.ofauth.com/v2/access/vault/lists/LIST_ID/media", {
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123"
  }
})

const { list, hasMore } = await response.json()

Create a Vault List

const response = await fetch("https://api.ofauth.com/v2/access/vault/lists", {
  method: "POST",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    name: "My Custom Folder"
  })
})

const newList = await response.json()

Add Media to a List

const response = await fetch("https://api.ofauth.com/v2/access/vault/lists/LIST_ID/media", {
  method: "POST",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    mediaIds: [123, 456, 789]
  })
})

Uploading Media

Media uploads use a multi-step process:
1

Initialize Upload

Call /uploads/init to get an upload session
2

Upload File

Upload the file using the returned session info
3

Complete Upload

Call /uploads/complete to finalize and process the media
// Step 1: Initialize upload
const initResponse = await fetch("https://api.ofauth.com/v2/access/uploads/init", {
  method: "POST",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    filename: "photo.jpg",
    filesize: 1024000,  // File size in bytes
    mimeType: "image/jpeg"
  })
})

const { mediaUploadId } = await initResponse.json()
// Check x-ofauth-upload-total-parts header for chunking info

// Step 2: Upload file (single part for small files)
await fetch(`https://api.ofauth.com/v2/access/uploads/${mediaUploadId}`, {
  method: "PUT",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "image/jpeg"
  },
  body: fileBuffer
})

// For multi-part uploads, use /uploads/:mediaUploadId/parts/:partNumber

// Step 3: Complete upload (if using chunked upload)
const completeResponse = await fetch("https://api.ofauth.com/v2/access/uploads/complete", {
  method: "POST",
  headers: {
    apikey: "YOUR_API_KEY",
    "x-connection-id": "conn_abc123",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ mediaUploadId })
})

const { media } = await completeResponse.json()
console.log("Uploaded media ID:", media.id)

Media Proxy

OFAuth automatically proxies OnlyFans CDN URLs, making media embeddable on your platform.
Automatic: API responses already contain proxied media.ofauth.com URLs. No extra configuration needed.

Why Media Proxy?

OnlyFans CDNOFAuth Media Proxy
URLs expire quicklyExtended validity
CORS blockedCORS enabled
No caching controlEdge-cached globally
Cannot embedEmbeddable in <img> / <video>

Using Proxied URLs

// API responses automatically include proxied URLs in files.full.url
const media = list[0]

// Use directly in HTML
const imgUrl = media.files.full.url
// https://media.ofauth.com/v1/abc123/photo.jpg
<!-- Embed in your app -->
<img src="https://media.ofauth.com/v1/abc123/photo.jpg" alt="Content" />
<video src="https://media.ofauth.com/v1/xyz789/video.mp4" controls />

Billing

Media proxy usage is billed per KB of bandwidth. Cache hits (up to 7 days) are free. See your dashboard for usage details.

API Endpoints

EndpointMethodDescription
/v2/access/vault/mediaGETList all vault media
/v2/access/vault/listsGETGet vault lists/folders
/v2/access/vault/listsPOSTCreate a vault list
/v2/access/vault/lists/{listId}PATCHUpdate a vault list
/v2/access/vault/lists/{listId}DELETEDelete a vault list
/v2/access/vault/lists/{listId}/mediaGETGet media in a list
/v2/access/vault/lists/{listId}/mediaPOSTAdd media to a list
/v2/access/uploads/initPOSTInitialize media upload
/v2/access/uploads/{mediaUploadId}PUTUpload single-part file
/v2/access/uploads/{mediaUploadId}/parts/{partNumber}PUTUpload chunk
/v2/access/uploads/completePOSTComplete upload

Full API Reference

See complete endpoint documentation

Query Parameters

Vault Media Query

ParameterTypeDefaultDescription
limitnumber24Results per page (1-40)
offsetnumber0Pagination offset
sortBystring”recent”Sort by: recent, most-liked, highest-tips
sortDirectionstring”desc”Sort direction: asc, desc
mediaTypestring-Filter by type: photo, video, audio, gif
querystring-Search query

Media Data Structure

Each media item includes:
{
  "id": 123456,
  "type": "photo",
  "canView": true,
  "hasError": false,
  "isReady": true,
  "createdAt": "2024-01-15T10:30:00Z",
  "files": {
    "full": {
      "url": "https://media.ofauth.com/v1/abc123/photo.jpg",
      "width": 1920,
      "height": 1080,
      "size": 245000
    },
    "thumb": {
      "url": "https://media.ofauth.com/v1/abc123/thumb.jpg",
      "width": 200,
      "height": 200
    },
    "preview": {
      "url": "https://media.ofauth.com/v1/abc123/preview.jpg",
      "width": 480,
      "height": 480
    }
  },
  "counters": {
    "likesCount": 42,
    "tipsSumm": 25.00
  }
}
For videos, additional fields:
{
  "type": "video",
  "duration": 120,
  "videoSources": {
    "240": "https://media.ofauth.com/v1/xyz789/240p.mp4",
    "720": "https://media.ofauth.com/v1/xyz789/720p.mp4"
  }
}

Vault List Structure

{
  "id": 12345,
  "type": "custom",
  "name": "My Photos",
  "hasMedia": true,
  "canUpdate": true,
  "canDelete": true,
  "medias": [
    { "type": "photo", "url": "https://..." }
  ]
}
List types: custom, messages, posts, stories, streams, media_stickers

Tips & Best Practices

Upload First: Always upload media to the vault before referencing it in posts or messages. You can’t upload inline.
Supported Formats: Images (JPEG, PNG, GIF, WebP), Videos (MP4, MOV), Audio (MP3, M4A). Check OnlyFans’ guidelines for size limits.
Bandwidth Costs: Frequently accessed media (profile pictures, popular posts) may generate significant bandwidth charges. Monitor usage in your dashboard.