Skip to main content

⏳ TTL (Time to Live)

In this section, we detail the concept of Time to Live (TTL) for videos and their associated generated artifacts in the ZapCap API. TTL is a parameter used for managing the lifecycle of your videos and generated artifacts, optimizing your storage costs.

Overview

TTL (Time to Live) specifies the duration for which a video task or its associated resources (such as transcripts or rendered videos) are stored before they are automatically deleted. This allows you to manage storage efficiently and control costs.

TTL Configuration

Using TTL in API Requests

TTL can be passed as a query parameter in various API endpoints where video tasks are created. The available TTL options are 1d, 7d, and 30d, representing 1 day, 7 days, and 30 days, respectively. If no TTL is specified, the files are kept indefinitely and will have additional costs.

Supported API Operations with TTL

Here are the operations that accept a TTL query parameter:

  • uploadVideo
  • uploadVideoByUrl
  • createUpload
  • createVideoTask

The first three operations (uploadVideo, uploadVideoByUrl, and createUpload) are for uploading videos. Supplying a TTL in these operations will set the TTL for the video but not for the generated artifacts. To set the TTL for generated artifacts, you must pass the TTL parameter to the createVideoTask operation as well.

Handling Deleted Files

Attempting to access videos or artifacts that have been deleted after their TTL has expired will result in HTTP status codes 410 (Gone) or 404 (Not Found), depending on the API called and whether the download link is being accessed.

Billing

Users will be charged for storage based on the TTL selected at a rate of $0.015 per GB of storage upfront based on the TTL selected. If no TTL is selected, users will be charged for 12 months of storage while uploaded videos and generated artifacts will be kept indefinitely.

Example Billing Scenarios

File Size (MB)TTLTotal Cost for the period
501$0.000025
507$0.000175
5030$0.00075
500$0.009
10001$0.0005
10007$0.0035
100030$0.015
10000$0.18

Note: Costs for periods less than a month are prorated based on the number of days. The table includes calculations for 50 MB and 1 GB files under different TTL settings, including indefinite storage (None).

The storage cost applies to uploaded videos as well as generated artifacts. The storage cost of generated artifacts will be applied at the size of the lesser size of the generated artifact and the original uploaded video.