> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onlyfansapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload media to the OnlyFans CDN (/api-reference/media/upload-media-to-the-only-fans-cdn)

The response can be used **only once** to manually include media in a post or message. This endpoint does not upload media to the Vault. You must provide either `file` or `file_url`.

## OpenAPI

````yaml https://app.onlyfansapi.com/scribe-docs/openapi.yaml post /api/{account}/media/upload
openapi: 3.0.3
info:
  title: OnlyFans API
  description: ""
  version: 1.0.0
servers:
  - url: https://app.onlyfansapi.com
security:
  - default: []
tags:
  - name: API Keys
    description: ""
  - name: Account
    description: Endpoints for your linked accounts
  - name: Analytics - Financial
    description: APIs for retrieving financial analytics data
  - name: Analytics - Summary
    description: APIs for retrieving summary analytics data
  - name: Banking
    description: Operations related to user banking details, payout methods, legal
      and tax information, and account country settings.
  - name: Chargebacks
    description: ""
  - name: Chat Messages
    description: ""
  - name: Chats
    description: ""
  - name: Client Sessions
    description: ""
  - name: Connect OnlyFans Account
    description: ""
  - name: Data Exports
    description: APIs for managing data exports
  - name: Engagement / Messages
    description: ""
  - name: Fans
    description: APIs for managing OnlyFans fans (subscribers)
  - name: Fans - AI Summary
    description: APIs for generating and retrieving AI-powered fan profile summaries
  - name: Following
    description: APIs for managing OnlyFans followings (people you're subscribed to)
  - name: Free Trial Links
    description: APIs for managing Free Trial Links
  - name: Giphy
    description: ""
  - name: Link Tags
    description: APIs for managing tags on free trial links and tracking links
  - name: Mass Messaging
    description: ""
  - name: Media
    description: ""
  - name: Media Vault
    description: ""
  - name: Media Vault Lists
    description: ""
  - name: Notifications
    description: Endpoints for managingr account notifications
  - name: Payouts
    description: ""
  - name: Post Comments
    description: ""
  - name: Post Labels
    description: APIs for managing your post labels
  - name: Posts
    description: APIs for managing OnlyFans posts
  - name: Promotions
    description: ""
  - name: Public Profiles
    description: ""
  - name: Queue
    description: ""
  - name: Release Forms
    description: APIs for managing OnlyFans release forms
  - name: Saved For Later (Messages)
    description: ""
  - name: Saved For Later (Posts)
    description: ""
  - name: Settings
    description: ""
  - name: Shared Free Trial Links
    description: APIs for Free Trial Links that other OF creators have shared with
      this account. Revenue, cost, and spender data are not available for shared
      links.
  - name: Shared Tracking Links
    description: APIs for Tracking Links (campaigns) that other OF creators have
      shared with this account. Revenue, cost, and spender data are not
      available for shared campaigns.
  - name: Smart Link Postbacks
    description: APIs for managing Smart Link postback destinations
  - name: Smart Links
    description: APIs for managing Smart Links (Free Trial Links and Tracking Links
      with pooled inventory)
  - name: Statistics
    description: ""
  - name: Stored Free Trial Links
    description: Instant APIs for retrieving stored free trial links from the
      OnlyFansAPI Cache (free, no credits used)
  - name: Stored Shared Free Trial Links
    description: Instant APIs for retrieving stored shared Free Trial Links from the
      OnlyFansAPI Cache (free, no credits used)
  - name: Stored Shared Tracking Links
    description: Instant APIs for retrieving stored shared Tracking Links
      (campaigns) from the OnlyFansAPI Cache (free, no credits used)
  - name: Stored Tracking Links
    description: Instant APIs for retrieving stored tracking links from the
      OnlyFansAPI Cache (free, no credits used)
  - name: Stories
    description: APIs for managing OnlyFans stories
  - name: Story Highlights
    description: APIs for managing OnlyFans story highlights
  - name: Subscription Bundles
    description: ""
  - name: Tracking Links
    description: APIs for managing tracking links
  - name: Transactions
    description: APIs for managing OnlyFans transactions
  - name: User List Collections
    description: ""
  - name: Users
    description: APIs for fetching OnlyFans users
  - name: Webhooks
    description: ""
paths:
  /api/{account}/media/upload:
    parameters:
      - in: path
        name: account
        description: The Account ID
        example: acct_XXXXXXXXXXXXXXX
        required: true
        schema:
          type: string
    post:
      summary: Upload media to the OnlyFans CDN
      operationId: uploadMediaToTheOnlyFansCDN
      description: The response can be used **only once** to manually include media in
        a post or message. This endpoint does not upload media to the Vault. You
        must provide either `file` or `file_url`.
      parameters: []
      responses:
        "200":
          description: Synchronous upload (default)
          content:
            application/json:
              schema:
                type: object
                example:
                  prefixed_id: ofapi_media_abc123def456abc123def456abc123de
                  file_name: photo.jpg
                  processId: abc123def456abc123de
                  host: convert3.onlyfans.com
                  sourceUrl: https://of2transcoder.s3.amazonaws.com/upload/00000000-0000-0000-0000-000000000000/000000000000/photo.jpg
                  extra: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
                  additional:
                    user: "123456789"
                  thumbs:
                    - id: 1
                      url: https://cdn2.onlyfans.com/files/0/00/00000000000000000000000000000000/300x544_00000000000000000000000000000000.jpg
                  note: Maximum file size is 1 GB. Need higher limits? Contact us for enterprise
                    options.
                properties:
                  prefixed_id:
                    type: string
                    example: ofapi_media_abc123def456abc123def456abc123de
                  file_name:
                    type: string
                    example: photo.jpg
                  processId:
                    type: string
                    example: abc123def456abc123de
                  host:
                    type: string
                    example: convert3.onlyfans.com
                  sourceUrl:
                    type: string
                    example: https://of2transcoder.s3.amazonaws.com/upload/00000000-0000-0000-0000-000000000000/000000000000/photo.jpg
                  extra:
                    type: string
                    example: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
                  additional:
                    type: object
                    properties:
                      user:
                        type: string
                        example: "123456789"
                  thumbs:
                    type: array
                    example:
                      - id: 1
                        url: https://cdn2.onlyfans.com/files/0/00/00000000000000000000000000000000/300x544_00000000000000000000000000000000.jpg
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        url:
                          type: string
                          example: https://cdn2.onlyfans.com/files/0/00/00000000000000000000000000000000/300x544_00000000000000000000000000000000.jpg
                  note:
                    type: string
                    example: Maximum file size is 1 GB. Need higher limits? Contact us for
                      enterprise options.
        "202":
          description: Async upload (async=true)
          content:
            application/json:
              schema:
                type: object
                example:
                  status: pending
                  prefixed_id: ofapi_media_abc123def456abc123def456abc123de
                  polling_url: https://app.onlyfansapi.com/api/acct_abc123def456/media/uploads/ofapi_media_abc123def456abc123def456abc123de/status
                properties:
                  status:
                    type: string
                    example: pending
                  prefixed_id:
                    type: string
                    example: ofapi_media_abc123def456abc123def456abc123de
                  polling_url:
                    type: string
                    example: https://app.onlyfansapi.com/api/acct_abc123def456/media/uploads/ofapi_media_abc123def456abc123def456abc123de/status
      tags:
        - Media
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: "The file to upload. Required if `file_url` is not provided.
                    Maximum file size: 100 MB (limited by Cloudflare)."
                file_url:
                  type: string
                  description: A URL to download the file from. Required if `file` is not
                    provided. Maximum file size depends on the subscription
                    configuration.
                  example: https://example.com/media/photo.jpg
                async:
                  type: boolean
                  description: Set to `true` to process uploads in the background. Returns a
                    `polling_url` to check status. Recommended for large files.
                  example: true
                type:
                  type: string
                  description: Set to `avatar` if this file will be used as a profile picture,
                    `header` for a profile banner, or keep empty if this file
                    will be for anything else.
                  example: avatar
                  enum:
                    - default
                    - avatar
                    - header
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: Get your API Key from OnlyFansAPI Console -
        https://app.onlyfansapi.com/api-keys
````