AI Video Montage API

November 26, 2026

AI Video Montage API

Submit one or more videos and receive one finished video. AI selects and cuts the best parts.

AI Video Montage requires a paid WayinVideo plan. The total length of the sources is limited by the plan.

Supported Sources

Each item in sources has a type. Types can be mixed in one request.

typeFieldsDescription
urlvalueA platform video link (YouTube, TikTok, Vimeo, and the other sources listed in the Introduction).
filevalueThe identity returned by the Upload API. Local upload requires a Starter plan or above.
clipproject_id, clip_indexA clip from a AI Clipping or Find Moments project. clip_index is the clip's idx in that project's results. Only the clip's own range is used.

Workflow

  1. Submit a montage with one or more sources
  2. Poll the results until status is DONE or ERROR
  3. When status is DONE, export the montage to render it as a video file
  4. Poll the export results until status is SUCCEEDED, then read the clip's export_link

Endpoints

MethodPathDescription
POST/api/v2/montageSubmit a montage task
GET/api/v2/montage/results/{id}Retrieve the task result
POST/api/v2/montage/exportRender a finished montage as a video file
GET/api/v2/clips/export/{taskId}Retrieve the export result

All requests require:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
x-wayinvideo-api-version: v2

Submit Montage Task

POST https://wayinvideo-api.wayin.ai/api/v2/montage

Request Body

ParameterTypeRequiredDefaultDescription
sourcesobject[]Yes—One or more sources. See Supported Sources.
promptstringNo—What the montage should focus on.
ratiostringYes—Output aspect ratio: RATIO_16_9, RATIO_9_16, RATIO_1_1, RATIO_4_5. To keep the original framing, use the ratio closest to the sources with enable_ai_reframe set to false.
target_durationstringNoAutoLength range of the montage: DURATION_0_30, DURATION_0_90, DURATION_30_60, DURATION_60_90, DURATION_90_180, DURATION_180_300 (in seconds, e.g. DURATION_30_60 is 30–60 seconds). Omit to let the length be chosen automatically.
main_video_speednumberNo1.0Playback speed of the main video clips in the editable montage (0.5–10). At 1.5×, 30 seconds of source footage plays in 20 seconds.
outrastringNo—Video identity returned by Upload. After uploading the file, pass its identity here to append the full video after the montage at its original speed.
target_langstringYes—Lowercase language code the montage is made in (captions and AI text), for example en or zh-cn. When it differs from the language spoken in the sources, captions are translated into it. See Supported Languages.
caption_displaystringNo—original, translation, or both. Used when target_lang differs from the language spoken in the sources.
enable_captionbooleanNo—Burn captions into the montage.
cc_style_tplstringNo—Caption style. See Subtitles Style. When caption_display is both, only temp-static-1 to temp-static-6 are allowed.
enable_ai_reframebooleanNotrueTrack the subject and reframe to ratio. Set to false to fit the video into ratio without tracking.
reframe_layoutstringNoAutoLayout used when reframing to ratio. Default Auto: the model picks the best layout. Allowed values depend on ratio; see Reframe layout values.
enable_ai_hookbooleanNo—Add an AI text hook. Uses extra API units.
ai_hook_script_stylestringNoseriousTone of the hook when enable_ai_hook is true.
ai_hook_positionstringNobeginningbeginning or end.
ai_hook_keywordsstringNo—Instructions for writing the hook text.
ai_hook_prompt_with_video_infobooleanNofalseWith enable_ai_hook=true and nonblank ai_hook_keywords, set to true to use metadata from the first video in sources, including its original title.
ai_hook_text_durationintegerNo—How long the hook text stays on screen, in milliseconds (1–60000).
enable_brollbooleanNo—Insert B-roll. Uses extra API units.
broll_resource_typestringWith enable_broll—RESOURCE_VIDEO_AI_BROLL or RESOURCE_VIDEO_STOCK_BROLL.
enable_bgmbooleanNo—Add background music. Requires a paid plan and uses extra API units.
bgm_placementstringNoentireentire or parts.
bgm_stylestringNoAutoMusic style.
bgm_promptstringNo—Short description of the music.

Example Request

curl -X POST https://wayinvideo-api.wayin.ai/api/v2/montage \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2" \
  -d '{
    "sources": [
      { "type": "url", "value": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
      { "type": "file", "value": "EF_up_06wguq1afbwg1" },
      { "type": "clip", "project_id": "proj_01HQ2X8J3K4L5M6N7O8P9Q0A", "clip_index": 2 }
    ],
    "prompt": "product demo highlights",
    "ratio": "RATIO_9_16",
    "target_duration": "DURATION_30_60",
    "main_video_speed": 1.5,
    "outra": "EF_up_your_uploaded_outro",
    "target_lang": "en",
    "enable_ai_hook": true,
    "ai_hook_keywords": "Include the original title of the first source video.",
    "ai_hook_prompt_with_video_info": true
  }'

Response

A newly submitted task is START or WAIT_ASYNC while it is still running.

{
  "data": {
    "id": "proj_01HQ2X8J3K4L5M6N7O8P9Q0R",
    "status": "START"
  }
}
FieldTypeDescription
idstringProject id. Pass it in the results path and to the export endpoint.
statusstringSTART or WAIT_ASYNC means still running. DONE means the montage is ready to export. ERROR means failed.

Retrieve Montage Result

Poll with the id from the submit response until status is DONE or ERROR. Montage can take longer than clipping. Wait at least 60 seconds between checks.

GET https://wayinvideo-api.wayin.ai/api/v2/montage/results/{id}

Example Request

curl -X GET https://wayinvideo-api.wayin.ai/api/v2/montage/results/proj_01HQ2X8J3K4L5M6N7O8P9Q0R \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2"

Response

{
  "data": {
    "id": "proj_01HQ2X8J3K4L5M6N7O8P9Q0R",
    "status": "DONE"
  }
}

DONE means the montage has been made. It is not a video file yet: call the export endpoint to render it.


Export Montage

Renders a montage whose status is DONE as a downloadable video file. The montage is exported as it was made; no edits are applied again.

POST https://wayinvideo-api.wayin.ai/api/v2/montage/export

Request Body

ParameterTypeRequiredDefaultDescription
project_idstringYes—The id returned when the montage was submitted.
resolutionstringNoSD_480Output resolution: SD_480, HD_720, FHD_1080, QHD_2K, UHD_4K.

Example Request

curl -X POST https://wayinvideo-api.wayin.ai/api/v2/montage/export \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2" \
  -d '{
    "project_id": "proj_01HQ2X8J3K4L5M6N7O8P9Q0R",
    "resolution": "FHD_1080"
  }'

Response

{
  "data": {
    "export_task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "status": "CREATED"
  }
}

Poll GET /api/v2/clips/export/{export_task_id} until status is SUCCEEDED or FAILED, as described in the Clips Export API. On SUCCEEDED, clips contains one item, and its export_link is the montage video. Calling the export endpoint before the montage is DONE returns an error.


Billing

Montage consumes 2 API Units per minute of the total length of the sources (4 on older plans); a clip counts only its own length, rounded up to the next whole minute. A total shorter than 1 minute is billed as 1 minute.

The following are charged on top, per minute of the finished video, rounded up:

ItemAPI UnitsWhen
Captions0.5 per minuteEvery montage
Caption translation0.5 per minuteWhen target_lang differs from the language spoken in the sources
AI Reframe0.5 per minuteOn by default; not charged when enable_ai_reframe is false

AI hook, B-roll and background music consume additional API units when enabled. Exporting the finished montage is free. If the account does not have enough API units, the task is not created. Failed tasks are refunded. See Billing and Status Codes.


Errors

Failed requests use the standard status codes and response formats. See Status Codes.