Direct uploads
The AssetsClient class provides methods to upload your media files to the platform. This method creates an asset that you can use in different workflows.
Workflow
Upload your file using the assets.create method. You receive the asset ID in the response.
Monitor the indexing status using the assets.retrieve method until it’s ready.
What you do next depends on your use case:
- For creating embeddings (videos, audio, images): Use the asset ID with the Embed API v2.
- For entity search (images): Use the asset ID to create entities.
- For search and analysis (videos): Index your asset using the asset ID.
Methods
Create an asset
Description: This method creates an asset by uploading a file to the platform. Assets are media files that you can use in downstream workflows, including indexing, analyzing video content, and creating entities.
Supported content: Video, audio, and images.
Upload methods:
- Local file: Set the
methodparameter todirectand use thefileparameter to specify the file. - Publicly accessible URL: Set the
methodparameter tourland use theurlparameter to specify the URL of your file.
File size: 200MB maximum for local file uploads, 4GB maximum for URL uploads.
Additional requirements depend on your workflow:
- Search: Marengo requirements
- Video analysis: Pegasus requirements
- Entity search: Marengo image requirements
- Create embeddings: Marengo requirements
Function signature and example:
Parameters:
Return value: Returns an object of type Asset representing the created asset.
The Asset class contains the following properties:
API Reference: Create an asset
List assets
Description: This method returns a list of assets in your account.
The platform returns your assets sorted by creation date, with the newest at the top of the list.
Function signature and example:
Parameters:
Return value: Returns a SyncPager[Asset] object containing a paginated list of Asset objects, representing the assets that match the specified criteria. For details about the Asset class see the Create an asset section above.
The SyncPager[T] class contains the following properties and methods:
API Reference: List assets
Retrieve an asset
Description: This method retrieves details about the specified asset.
Function signature and example:
Parameters:
Return value: Returns an Asset object containing details about the specified asset. For details about the Asset class, see the Create an asset section above.
API Reference: Retrieve an asset
Delete an asset
Description: This method deletes the specified asset. This action cannot be undone.
Function signature and example:
Parameters:
Return value: Returns None.
API Reference: Delete asset