Skip to content
Spend limits

Spend Limits

A spend limit is a per-app monthly cap, in EUR, on transcoding charges. When set, new jobs are refused once the app’s recorded spend for the current billing period reaches the limit, and however many jobs you create at once, spend passes the limit by at most one job. A warning fires at 80% and a breach notice at 100%, each as a webhook and an email. Unset means unlimited — the default, so existing apps are unaffected.

Setting a limit is not a payment operation. It never charges, authorizes, or holds funds — it only gates new job admission and sends notifications.

Manage the limit from the app’s Spend Limit settings in the dashboard, or over the API with AppService.UpdateSpendLimit and AppService.GetSpend.

Defaults

StateMeaning
monthly_spend_limit_eur unsetUnlimited (default). Zero behavior change — nothing is aggregated or gated.
monthly_spend_limit_eur = N (> 0)A cap of €N per billing period.

What counts toward spend

Spend is the job’s billed total as computed by the pricing engine, summed over the current billing period:

  • Terminal jobs (completed, failed, canceled, partial) count their actual billed total. A failed job with no billed cost counts zero.
  • In-flight jobs count their recorded probe-time estimate until they reach a terminal state. This includes awaiting_confirmation (delayed-start) jobs — their estimate counts toward spend until they are confirmed, canceled, or otherwise terminal, so cancel abandoned delayed-start jobs to free budget. Canceling one does not drop it to zero: the probe already ran, so it settles at the flat processing fee.
  • Both totals already fold in the per-job processing fee and any additive fees — nothing is re-derived from outputs.
  • Currency is always EUR.

Jobs are attributed to a period by their creation time, not their completion time — a job created in one period keeps counting against that period even if it finishes in the next. Every job-creating path is covered uniformly, including jobs created from an existing input rather than a fresh upload.

Billing period

The period is the calendar month in UTC: it starts at 00:00:00 UTC on the 1st, e.g. 2026-07-01 … 2026-08-01.

Spend and threshold state from a previous period never carry into the current one.

Enforcement: the bound

With a limit of L, recorded spend for the period never exceeds L by more than the estimate of one job — the last one started while spend was still below L. That holds for a burst of concurrent creates too.

A job’s cost is only known once its input has been read (the probe), so the limit is checked twice, with the same rule — a job may start while recorded spend is below the limit:

  1. When you create the job. If recorded spend has already reached the limit, the create is refused with limit_exceeded (below).
  2. When the job’s input has been read, before it starts encoding. If spend reached the limit while the job waited, the job ends failed with error code limit_exceeded, and a job.failed webhook fires. It never starts encoding and nothing is charged for it.

So a create that returned a job can still end in limit_exceeded before the job runs. Handle limit_exceeded both as a create error and as a job failure code.

What else to know:

  • Jobs already running are never stopped. Only a job that has not started can be refused; a job that started runs to completion, even if the limit is lowered.
  • Failed and canceled jobs give their room back. An in-flight job counts its estimate; once it ends, it counts what it was billed instead (nothing for a failed job, nothing for a job canceled while still queued, the flat processing fee for one canceled after a machine picked it up).
  • “One job” can be a big one. The bound is one job’s cost, whatever that job is: a long, expensive encode started at €9.99 of a €10 limit runs in full. The final bill for a job can also differ from its estimate.
  • Canceled before its input was read, a job a machine already picked up still bills the processing fee, which the limit could not yet see. Canceling many such jobs at once can pass the limit by one processing fee each.

Once recorded spend reaches the limit, JobService.Create — and every path that funnels through it — is refused with Connect code resource_exhausted and the machine-readable error code limit_exceeded:

CodeResourceExhausted
  error-code: limit_exceeded
  message: app app_k1l2m3n4o5 has reached its monthly spend limit of €10.00
           (recorded spend €10.00 this billing period, limit set by override);
           raise this app's spend limit in your dashboard, or wait for the
           billing period to reset on 1 August 2026 (UTC)

limit set by override means the limit you set on the app; a ceiling from your plan reads differently.

A job refused before it starts carries the same sentence in its error_message, prefixed with “This job was not started and nothing was charged:“.

Switch on the limit_exceeded discriminator, not the message text. To restore admission, raise the limit (or clear it) with UpdateSpendLimit, or wait for the billing period to reset. When the binding limit is a ceiling on your plan rather than one you set, the remedy reads “contact support to raise this ceiling” instead.

JobService.Confirm is not gated. Confirming a delayed-start job is a state transition, not a new admission, so a job created before the limit was reached can still be confirmed after a breach — its estimate already counts toward period spend, so this changes nothing about the recorded total.

Threshold webhooks

Two events fire once per (app, billing period), even when many jobs cross the threshold at the same moment.

Event typeFires when
app.spend_limit_warningRecorded period spend first reaches 80% of the limit.
app.spend_limit_exceededRecorded period spend first reaches 100% of the limit. A single jump that crosses both thresholds fires both, once each.

Fire-once is not re-armed by a mid-period limit change: raising or lowering the limit after a threshold event has fired for the current period does not re-fire it. Both reset when the next period starts.

Each crossing also emails your organization’s billing address. The 80% warning can be turned off under Email Notifications; the 100% notice cannot.

Delivery reaches only endpoints subscribed at crossing time. A threshold event is emitted to the webhook endpoints subscribed to it when the crossing is recorded — so subscribe before setting a limit to receive it. Because the crossing is fire-once per period, subscribing afterward does not backfill a missed notification.

Both events carry the same small notification object inside the standard webhook envelope’s data field (this is a notification payload, not an API resource snapshot):

{
  "app_id": "app_default000",
  "period_start": "2026-07-01",
  "period_end": "2026-08-01",
  "limit_eur": 100.0,
  "spent_eur": 85.5,
  "threshold_pct": 80,
  "currency": "EUR"
}

threshold_pct is 80 for the warning and 100 for the breach. period_start / period_end are RFC 3339 full-dates (UTC). Subscribe to these events like any other on the Webhooks page.

Set or clear the limit

Provide monthly_spend_limit_eur (must be > 0 and finite — NaN/Inf are rejected) to set the cap; omit it to clear the cap back to unlimited. A portal user must be an organization Owner or Admin. An API key may set, change, or clear its own app’s limit — a mismatched app_id is rejected — so a leaked key can lift its own app’s cap; rotate compromised keys promptly.

# Set a €500/month cap
curl -X POST https://api.transcodely.com/transcodely.v1.AppService/UpdateSpendLimit 
  -H "Authorization: Bearer ak_your_api_key" 
  -H "Content-Type: application/json" 
  -d '{"app_id": "app_k1l2m3n4o5", "monthly_spend_limit_eur": 500}'

# Clear the cap (omit the field) — back to unlimited
curl -X POST https://api.transcodely.com/transcodely.v1.AppService/UpdateSpendLimit 
  -H "Authorization: Bearer ak_your_api_key" 
  -H "Content-Type: application/json" 
  -d '{"app_id": "app_k1l2m3n4o5"}'
// Set a €500/month cap
const app = await client.apps.setSpendLimit("app_k1l2m3n4o5", 500);

// Clear the cap — back to unlimited
await client.apps.clearSpendLimit("app_k1l2m3n4o5");
# Set a €500/month cap
app = client.apps.set_spend_limit("app_k1l2m3n4o5", 500)

# Clear the cap — back to unlimited
client.apps.clear_spend_limit("app_k1l2m3n4o5")
// Set a €500/month cap
app, err := client.Apps.SetSpendLimit(ctx, "app_k1l2m3n4o5", 500)

// Clear the cap — back to unlimited
app, err = client.Apps.ClearSpendLimit(ctx, "app_k1l2m3n4o5")

See Set the spend limit in the API reference for the full request and response shape.

Read current spend

Any organization member can read an app’s current-period spend. warning_triggered and limit_reached report whether the fire-once threshold crossings have been recorded and their notifications enqueued this period — not that any webhook was successfully delivered (a period with no subscribed endpoint still flips these booleans). Once set, they stay set for the rest of the period.

curl -X POST https://api.transcodely.com/transcodely.v1.AppService/GetSpend 
  -H "Authorization: Bearer ak_your_api_key" 
  -H "Content-Type: application/json" 
  -d '{"app_id": "app_k1l2m3n4o5"}'
const spend = await client.apps.getSpend("app_k1l2m3n4o5");
spend = client.apps.get_spend("app_k1l2m3n4o5")
spend, err := client.Apps.GetSpend(ctx, "app_k1l2m3n4o5")
{
  "period_start": "2026-07-01T00:00:00Z",
  "period_end": "2026-08-01T00:00:00Z",
  "spent_eur": 85.5,
  "monthly_spend_limit_eur": 100,
  "currency": "EUR",
  "warning_triggered": true,
  "limit_reached": false
}

monthly_spend_limit_eur is omitted from the response when the app is unlimited.

Run this against your own file

A free account runs standard-quality encodes up to 2 minutes, one at a time (a longer upload is shortened to its first 2 minutes), so the Quickstart runs with nothing set up but an API key.