The TwelveLabs class is the main entry point for the SDK. It initializes the client and provides access to all the resources.

Properties

NameTypeDescription
indexResources.IndexUse this object to manage your indexes.
taskResources.TaskUse this object to upload videos.
searchResources.SearchUse this object to perform search requests.
generateResources.GenerateUse this object to generate text from videos.
embedResources.EmbedUse this object to create embeddings.

Methods

The constructor

Description: The constructor creates a new instance of the TwelveLabs class.

Function signature and example:

constructor({ apiKey, version = DEFAULT_API_VERSION }: ClientOptions) 
const client = new TwelveLabs({ apiKey: '<YOUR_API_KEY>' });

Parameters:

NameTypeRequiredDescription
apiKeystringYesYour Twelve Labs API key.
versionstringNoThe API version to use. Defaults to the latest version.

Return value: Implicitly returns the newly created instance.