We're an AI video research company making personalized video possible at scale. Generate videos of yourself, and never record again! Available via web app & developer APIs.
import { Tavus } from "tavus-typescript-sdk";
const tavus = new Tavus({
// Defining the base path is optional and defaults to https://tavusapi.com
// basePath: "https://tavusapi.com",
apiKey: "API_KEY",
});
const createNewReplicaResponse = await tavus.replicas.createNewReplica({
train_video_url: "train_video_url_example",
});
console.log(createNewReplicaResponse);
This endpoint creates a new Replica that can be used to generate personalized videos.
The only required body parameter is train_video_url
. This url must be a download link such as a presigned S3 url. Please ensure you pass in a video that meets the requirements for training.
Replica training will fail without the following consent statement being present at the beginning of the video:
I, [FULL NAME], am currently speaking and consent Tavus to create an AI clone of me by using the audio and video samples I provide. I understand that this AI clone can be used to create videos that look and sound like me.
Learn more about the consent statement here.
Learn more about training a personal Replica here.
const createNewReplicaResponse = await tavus.replicas.createNewReplica({
train_video_url: "train_video_url_example",
});
A direct link to a publicly accessible storage location such as an S3 bucket. This video will be used for replica training.
A url that will receive a callback on completion of replica training or on error.
A name for the replica.
ReplicasCreateNewReplicaResponse
/v2/replicas
POST
π Back to Table of Contents
This endpoint deletes a single Replica by its unique identifier. Once deleted, this Replica can not be used to generate videos.
const deleteByReplicaIdResponse = await tavus.replicas.deleteByReplicaId({});
/v2/replicas/{replica_id}
DELETE
π Back to Table of Contents
This endpoint returns a single Replica by its unique identifier.
Included in the response body is a training_progress
string that represents the progress of the Replica training. If there are any errors during training, the status
will be error
and the error_message
will be populated.
const getReplicaByIdResponse = await tavus.replicas.getReplicaById({});
ReplicasGetReplicaByIdResponse
/v2/replicas/{replica_id}
GET
π Back to Table of Contents
This endpoint returns a list of all replicas that have been created by the API Key in use. In the response, a root level data
key will contain the list of Replicas.
const listResponse = await tavus.replicas.list();
/v2/replicas
GET
π Back to Table of Contents
This endpoint renames a single Replica by its unique identifier.
const renameReplicaByIdResponse = await tavus.replicas.renameReplicaById({
replica_name: "replica_name_example",
});
/v2/replicas/{replica_id}/name
PATCH
π Back to Table of Contents
This endpoint generates a new video using a Replica and a script.
The only required body parameters are replica_id
and script
. The replica_id
is a unique identifier for the Replica that will be used to generate the video. The script
is the text that will be spoken by the Replica in the video.
If a background_url
is provided, Tavus will record a video of the website and use it as the background for the video. If a background_source_url
is provided, where the URL points to a download link such as a presigned S3 URL, Tavus will use the video as the background for the video. If neither are provided, the video will consist of a full screen Replica.
To learn more about generating videos with Replicas, see here.
To learn more about writing an effective script for your video, see Scripting prompting.
const createVideoFromReplicaAndScriptResponse =
await tavus.videos.createVideoFromReplicaAndScript({
replica_id: "r783537ef5",
script: "Hello from Tavus! Enjoy your new replica",
video_name: "My First Video",
});
A unique identifier for the replica that will be used to generate the video.
A script to be used for the video.
A direct link to a video that is publicly accessible via a storage location such as an S3 bucket. This will be used as the background for the video. The video must be publicly accessible.
A link to a website. This will be used as the background for the video. The website must be publicly accessible and properly formed.
A name for the video.
VideosCreateVideoFromReplicaAndScriptResponse
/v2/videos
POST
π Back to Table of Contents
This endpoint deletes a single video by its unique identifier.
const deleteByVideoIdResponse = await tavus.videos.deleteByVideoId({});
/v2/videos/{video_id}
DELETE
π Back to Table of Contents
This endpoint returns a list of all videos that have been generated by the API Key in use.
const getAllResponse = await tavus.videos.getAll();
/v2/videos
GET
π Back to Table of Contents
This endpoint returns a single video by its unique identifier.
The response body will contain a status
string that represents the status of the video. If the video is ready, the response body will also contain a download_url
, stream_url
, and hosted_url
that can be used to download, stream, and view the video respectively.
const getByVideoIdResponse = await tavus.videos.getByVideoId({});
/v2/videos/{video_id}
GET
π Back to Table of Contents
This endpoint renames a single video by its unique identifier.
const updateNameResponse = await tavus.videos.updateName({
video_name: "video_name_example",
});
/v2/videos/{video_id}/name
PATCH
π Back to Table of Contents
This TypeScript package is automatically generated by Konfig