Blog/Estimate media API cost with a representative sample
OverviewAll posts
Tutorial

Estimate media API cost with a representative sample

Build a media API cost forecast from measured billable usage, workload cohorts and realistic volume scenarios, without confusing file size with billing.

VTornado API team
Covered in this article
Choose representative workload cohorts
Project measured billable volume
Separate usage forecasts from invoices
7 min reading time
Published October 7, 2026
VProduct guides by Velys Software

To estimate media API cost, measure the billable usage of a representative sample, group similar workloads, and project each group's usage separately. Apply the rate and allowances accepted for your account only after you have a volume estimate. Multiplying the size of one downloaded file by next month's video count can miss both the billing basis and the mix of work your application performs.

This guide turns a sample into a planning worksheet. It complements how Tornado usage is measured; it does not quote a price or reproduce an invoice calculator.

Define the unit you are forecasting

Choose a business item that has a clear boundary: one source video delivered to an editor, for example, or one source prepared for a transcription pipeline. Keep that boundary consistent between the sample and the monthly forecast.

A business item may require several API jobs. Record all attempts associated with it, including their observed usage and outcome. Do not count only the successful last attempt while discarding the usage recorded for earlier work. Conversely, do not assume an unsuccessful attempt incurs a charge: use the actual recorded basis.

Separate API completion from downstream acceptance. If a file cannot be consumed and your application submits another job, that recovery belongs in the cost of completing the business item. The partial-failure workflow helps preserve that association.

Build cohorts that resemble production

Group items by differences likely to affect your workflow: source duration, output mode, clipping strategy and destination. A single average across ten short clips and one long video is useful only if that same mix describes the work you expect to receive.

Use the intended request settings during the sample. Changing from separate clip jobs to a different submission pattern afterward means you are forecasting a workflow you did not measure. Keep rare but consequential cases visible, such as unusually long sources or repeated downstream rejection.

For each item, keep a private record with:

  • A business-item ID and its associated job IDs.
  • Cohort, request settings and final outcomes.
  • Delivered bytes and recorded billable usage as separate columns.
  • Measurement time, account billing basis and any unresolved discrepancy.

Do not put API keys or signed delivery URLs in a shared costing worksheet. IDs and summarized usage are enough for the projection.

Reconcile the sample before scaling it

Tornado's billing reference distinguishes delivered volume from billable volume. Account-specific floors can make a clip or audio file smaller than its billing reference. Use the basis actually applied to the sampled jobs instead of inferring it from file size.

Keep unrelated traffic out of an account-total comparison, or identify it separately. Let job finalization and usage aggregation settle before comparing totals. If a sample is still incomplete, label it incomplete; filling missing measurements with zero understates the projection.

The usage endpoint reference also distinguishes cumulative transferred volume, reservations and billing counters. A reservation for an active job is not a completed item's final measurement. Nor is a quota counter automatically the invoice basis. Resolve unexplained differences with the job IDs and time window before treating the data as a reliable sample.

Project each cohort, then add the results

The following numbers are synthetic arithmetic examples, not Tornado benchmarks or measurements from customers. Bytes and GB use decimal units here: one GB is 1,000,000,000 bytes.

CohortSample itemsTotal recorded billable GB for the samplePlanned monthly itemsProjected GB
Short full videos102.06,0001,200
Long full videos54.01,000800
Audio preparation81.63,000600
Total237.610,0002,600

For each row, divide sample billable volume by sample item count, then multiply by the planned item count. The overall sample average would project about 3,304 GB instead, because the sample's proportions differ from the planned workload. Neither weighting method is universally right; choose the one that represents your expected mix.

This Python function performs only that weighted volume calculation. Each tuple contains sample item count, total recorded billable bytes and projected item count:

from decimal import Decimal


def project_billable_gb(cohorts):
    total_bytes = Decimal(0)
    for sample_items, billable_bytes, planned_items in cohorts:
        values = (sample_items, billable_bytes, planned_items)
        if any(type(value) is not int for value in values):
            raise ValueError("Use integer counts and bytes")
        if sample_items <= 0 or billable_bytes < 0 or planned_items < 0:
            raise ValueError("Invalid count or volume")
        total_bytes += (
            Decimal(billable_bytes) / sample_items * planned_items
        )
    return total_bytes / Decimal(1_000_000_000)


sample = [(10, 2_000_000_000, 6000),
          (5, 4_000_000_000, 1000),
          (8, 1_600_000_000, 3000)]
assert project_billable_gb(sample) == Decimal("2600")

The example and input-validation cases were executed locally. The function uses supplied measurements; it does not query an account, determine billing eligibility, apply allowances or predict an invoice. An empty input returns zero, which is not evidence that an unmeasured workload is free.

Test a different workload mix

Keep the same synthetic per-item averages, but change the forecast to 5,000 short videos, 2,000 long videos and 3,000 audio items. The total becomes 3,200 GB even though the business-item count remains 10,000. That is a 600 GB change caused solely by the mix.

Use this as a scenario exercise, not a confidence interval. A small sample does not establish the probability of a high-usage month. Measure additional cases where within-cohort variation is large, and revisit the forecast when customers change what they submit.

Convert volume into money using your actual plan. Under a simple constant-rate arrangement with no allowance, the usage component would be projected billable GB multiplied by the applicable price per GB. Included volume, commitments, tiers, invoice rounding and taxes require their own treatment. Do not subtract a trial allowance from every future month unless your terms explicitly provide it.

Budget for the complete workflow

Maintain separate lines for media API usage, storage, file retrieval and downstream processing. A transcription service's input unit may differ from Tornado's volume basis; multiplying both by the same GB figure can produce a misleading total.

Track forecast versus observed usage over the same period and cohort definitions. Investigate changes in per-item usage separately from changes in item count. That makes it easier to distinguish growth from a changed request configuration or avoidable resubmission.

Open the dashboard and review Usage and Billing before scaling. Start with the first media workflow, collect a representative sample, and resolve its billing basis before committing to a larger workload.