Overview
The API has three main endpoints:POST /v1/video/viral-ads-clone: create a clone projectGET /v1/video/viral-ads-clone/{project_id}: query project status, script, video tasks, and billingPOST /v1/video/viral-ads-clone/{project_id}/videos: create video tasks from a project script
Project Modes
Auto Mode
Usemode: "auto" when you want the system to generate the first batch of videos automatically.
Flow:
- Create a project with
POST /v1/video/viral-ads-cloneandmode: "auto". - The backend stores the input media and creates the project.
- The backend generates the analysis and script.
- Once the script is ready, the backend automatically creates the first video generation task batch.
- Poll
GET /v1/video/viral-ads-clone/{project_id}to check the project status,view_script,task_ids, andtasks.
generating_script: the script is still being preparedgenerating_video: video tasks have been created and are queued or runningscript_ready: the script is available; this may appear when no video task is currently runningfailed: the project failed
Manual Mode
Usemode: "manual" when you want to review the script before creating videos.
Flow:
- Create a project with
POST /v1/video/viral-ads-cloneandmode: "manual". - Poll
GET /v1/video/viral-ads-clone/{project_id}untilview_scriptis returned. - Review or edit the script on your side.
- Call
POST /v1/video/viral-ads-clone/{project_id}/videosto create video tasks. - Poll the project detail endpoint again, or query each returned task ID with the task API.
/videos endpoint.
Recreating Videos From the Same Project
After a project has a generated script, you can call:project_id.
Each call creates a new batch of video tasks and returns new task_ids. This is useful when you want to:
- regenerate videos with the same script
- try a lightly edited script
- create more outputs from the same project
- retry with different video options such as
out_number,resolution, oraspect_ratio
script in the /videos request, that script is used only for the current video batch. It does not overwrite the project original view_script.
The project detail endpoint returns all video tasks created from the project, including:
- the automatic first batch from auto mode
- all later batches created by calling
/videos - queued, running, succeeded, failed, and error tasks
Billing Notes
Creating a project charges API credits for script generation after the media URLs are stored successfully. Creating videos charges API credits for each video task batch. If a video task fails and is refunded or not finally charged, itscredits_cost is returned as 0.
Use the billing object in the project detail response to understand total usage:
script_credits_cost: credits charged for script generationvideo_credits_cost: credits currently charged or reserved for non-failed video taskstotal_credits_cost: script plus video credits