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.
The platform processes files up to 200 MB synchronously and sets the asset status to ready. For files larger than 200 MB, the platform processes the upload asynchronously. Check the asset status until it is ready before using the asset.
Workflow
Upload your file using the assets.create method. You receive the asset ID in the response.
(Optional) For files larger than 200 MB, check the asset status using the assets.retrieve method until status is ready before proceeding.
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: Up to 4 GB.
Additional requirements depend on your workflow:
- Search: Marengo requirements
- Video analysis: Pegasus requirements
- Entity search: Marengo image requirements
- Create embeddings: Marengo requirements
Note
This method is rate-limited. For details, see the Rate limits page.
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
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[AssetDetail] object containing a paginated list of AssetDetail objects. The AssetDetail class extends Asset with additional fields for HLS streaming and thumbnail details. For details about the AssetDetail class, see the Retrieve an asset section below.
The SyncPager[T] class contains the following properties and methods:
API Reference
Retrieve an asset
Description: This method retrieves details about the specified asset.
Function signature and example:
Parameters
Return value
Returns an AssetDetail object containing details about the specified asset.
The AssetDetail class extends Asset (documented in the Create an asset section above) with the following additional properties:
The AssetHls class contains the following properties:
The AssetThumbnail class contains the following properties:
API Reference
Delete an asset
Description: This method deletes the specified asset. This action cannot be undone. By default, the platform checks whether any indexed assets reference the asset. If references exist, the request fails with a 409 Conflict error. Set the force parameter to true to delete the asset regardless.
Function signature and example:
Parameters
Return value
Returns None.