SeraStudio FixEstimate fix

SeraStudio Fix

SeraStudio Fix estimate API

Price a fix from its kind, range and the length of the video. Estimates are free.

SeraStudio Fix
POSThttps://serastudio.app/api/v1/fix/estimate

Usage notes

  • An estimate creates nothing and costs nothing.
  • The key needs the read permission. Keys created in the console have it.
  • usd is what a fix with the same kind, range and resolution holds and, when it finishes, charges.
  • usd_per_second is the price your workspace pays: the list price minus your current discount (discount_pct). See Pricing.
  • retry.usd is the price of repeating that fix once it has finished.
  • The endpoint ignores fields it does not know.

Quick start

curl https://serastudio.app/api/v1/fix/estimate \
  -H "Authorization: Bearer $SERA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind": "retouch", "start_s": 8.5, "end_s": 9.9, "source_duration_s": 14, "resolution": "720p"}'

Input schema

kindstringrequired

"retouch", "swap", "fill".

start_snumberrequired

Start of the range in seconds.

end_snumberrequired

End of the range in seconds.

source_duration_snumberrequired

Length of the video in seconds, up to 60.

resolutionstringdefault: "720p"

Resolution to price. Allowed values depend on the kind.

Response

A successful request returns 200 with the estimate:

{
  "model": "fix",
  "kind": "retouch",
  "currency": "usd",
  "resolution": "720p",
  "range": {
    "start_s": 8.5,
    "end_s": 9.9
  },
  "window_seconds": 2,
  "billable_seconds": 4,
  "usd_per_second": 0.175,
  "list_usd_per_second": 0.175,
  "discount_pct": 0,
  "usd": 0.7,
  "retry": {
    "discount_pct": 50,
    "times": 1,
    "usd": 0.35
  },
  "note": "A fix sends whole seconds to the model: the range rounded out to full seconds, at least the minimum for the kind. Only those seconds are billed. The amount is held when the fix is queued and restored in full if it fails."
}
modelstring

Always fix.

kindstring

The kind that was priced.

currencystring

Always usd.

resolutionstring

The resolution that was priced.

rangeobject

start_s and end_s of the range that would be replaced. fill rounds its length to whole seconds.

window_secondsnumber

Whole seconds sent to the model: the range rounded out, at least the minimum for the kind.

billable_secondsnumber

window_seconds times the billable seconds per second of the kind.

usd_per_secondnumber

Price per billable second your workspace pays, after discount_pct.

list_usd_per_secondnumber

List price per billable second.

discount_pctnumber

Your workspace's current discount, from funds added in the last 28 days. 0 when none.

usdnumber

billable_seconds times usd_per_second, rounded to the cent. The amount a fix holds and charges.

retryobject

discount_pct, times and usd: the price of repeating the same fix after it finished.

notestring

A short explanation of the seconds sent.

Errors

StatusCodeWhen it happensRetry
400invalid_jsonThe body is not a JSON object.No
401api_key_missingNo Bearer key was sent in the Authorization header.No
401api_key_invalidThe key is malformed or unknown.No
401api_key_revokedThe key was deleted in the console.No
401api_key_disabledThe key is disabled in the console.No
401api_key_expiredThe key is past its expiration date.No
403insufficient_scopeThe key lacks the read permission. Keys created in the console have it.No
403workspace_forbiddenThe account that owns the workspace is suspended or scheduled for deletion.No
422invalid_parameterA field is missing or has the wrong type or value. error.param names the field.No
422invalid_parameterend_s is past the end of the source, the range is empty, or it is longer than the kind remakes at a time.No
422source_too_shortThe whole source is shorter than the seconds this kind sends to the model.No
422source_too_longThe source is over 60 seconds.No
503temporarily_unavailableThe request could not be completed just now.Yes
500internal_errorSomething failed on our side. The request_id identifies the request.Yes
503api_unavailableThe API is turned off.No

A range past the end of the video, for example, returns 422:

{
  "error": {
    "type": "invalid_request",
    "code": "invalid_parameter",
    "message": "end_s is 9 but the source is 8 s long.",
    "param": "end_s",
    "charged": false,
    "retryable": false
  },
  "request_id": "req_k38ss8hmb36g9308sy351ot3yi"
}