Media

Generate Media Asset

Changed on

Starts an AI media generation job billed from the account's balance. Generation is asynchronous — poll GET /media/{id} until the asset is ready, then use file.id anywhere attachments are accepted.

post/media/generate

Request

  • Base URL
    https://api.whop.com/api/v1
  • Auth
    HTTP bearer

Headers

Idempotency-Key, string
Example:d9105228-4a08-46b1-8b91-42fed586d383

A unique key that makes this request safe to retry. See Idempotent requests.

Request body

object required
account_id, string

Account ID, prefixed biz_. Defaults to the account the API key belongs to.

ad_video, object

Makes a video ad: Whop writes the prompt, picks product photos, and adds a voiceover with captions. The video is 15 seconds at 720p in 9:16. Video only. Can't be combined with prompt, reference_media, duration_seconds or resolution.

duration_seconds, 5 | 10 | 15

Video length in seconds. Video only; defaults to 5.

prompt, string

What to generate. Up to 2,000 characters. Required unless ad_video is set.

reference_media, string[]

Optional reference file IDs (file_ prefixed), up to 4. Images guide the output: for video, a single image seeds the opening frame; multiple images guide subject and style instead. Include one video to remake it: its motion and scene are kept and the images are swapped in. Video only; needs an image and can't be combined with duration_seconds. The output matches the video's length, up to 30 seconds, and is billed on it.

resolution, '480p' | '720p' | '1080p' | '4k'

Video resolution. Video only; defaults to 1080p. 1080p is not supported by Seedance 2.0 Fast or Mini; 4k is only supported by Seedance 2.0.

type, 'video' | 'image' required

The kind of media to generate.

Example request

{
  "account_id": "biz_xxxxxxxxxxxxxx",
  "duration_seconds": 5,
  "prompt": "A 9:16 product showcase of a cordless power scrubber",
  "reference_media": [
    "file_xxxxxxxxxxxxxx"
  ],
  "resolution": "1080p",
  "type": "video"
}

Response

Generation started.

MediaAsset required
amount_charged, number nullable required

USD amount charged to the account's balance for this generation. null if the generation wasn't billed.

completed_at, string nullable required

ISO 8601 timestamp when the asset reached a terminal state. null while processing.

created_at, string required

ISO 8601 timestamp when the generation was requested.

currency, string required

Currency of amount_charged. Always usd.

error_message, string nullable required

Why generation failed. null unless status is failed.

file, MediaAssetFile nullable required
generation, MediaAssetGeneration required

The inputs the asset was generated from.

id, string required

Media asset ID, prefixed media_.

media_type, 'video' | 'image' required

The kind of media this asset holds.

source, 'generated' required

How the asset was created. Always generated.

status, 'processing' | 'ready' | 'failed' required

Lifecycle state: processing while generation runs, ready when the file is available, failed when generation failed and the charge was refunded.

Example response

{
  "amount_charged": 2.5,
  "completed_at": "2026-01-01T12:00:00.000Z",
  "created_at": "2026-01-01T12:00:00.000Z",
  "currency": "usd",
  "error_message": "The generation provider rejected the prompt. The charge was refunded.",
  "file": {
    "id": "file_xxxxxxxxxxxxxx",
    "url": "https://whop-assets-example.s3.amazonaws.com/uploads/image/2026-01-01/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  },
  "generation": {
    "duration_seconds": 5,
    "prompt": "A 9:16 product showcase of a cordless power scrubber",
    "reference_media": [
      "file_xxxxxxxxxxxxxx"
    ],
    "resolution": "1080p"
  },
  "id": "media_xxxxxxxxxxxxxx",
  "media_type": "video",
  "source": "generated",
  "status": "ready"
}

Changes

    • info

      added the new optional request property ad_video

    • info

      the request property prompt became optional

    • info

      added the required property generation/ad_video to the response with the status