SeraStudio Fix
SeraStudio Fix estimate API
Price a fix from its kind, range and the length of the video. Estimates are free.
https://serastudio.app/api/v1/fix/estimateUsage notes
- An estimate creates nothing and costs nothing.
- The key needs the read permission. Keys created in the console have it.
usdis what a fix with the same kind, range and resolution holds and, when it finishes, charges.usd_per_secondis the price your workspace pays: the list price minus your current discount (discount_pct). See Pricing.retry.usdis 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"}'import os, requests
r = requests.post(
"https://serastudio.app/api/v1/fix/estimate",
headers={"Authorization": f"Bearer {os.environ['SERA_API_KEY']}", "Content-Type": "application/json"},
json={"kind": "retouch", "start_s": 8.5, "end_s": 9.9, "source_duration_s": 14, "resolution": "720p"},
)
print(r.json())const res = await fetch('https://serastudio.app/api/v1/fix/estimate', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SERA_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({"kind": "retouch", "start_s": 8.5, "end_s": 9.9, "source_duration_s": 14, "resolution": "720p"}),
});
console.log(await res.json());Input schema
kindstringrequired"retouch", "swap", "fill".
start_snumberrequiredStart of the range in seconds.
end_snumberrequiredEnd of the range in seconds.
source_duration_snumberrequiredLength 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."
}modelstringAlways fix.
kindstringThe kind that was priced.
currencystringAlways usd.
resolutionstringThe resolution that was priced.
rangeobjectstart_s and end_s of the range that would be replaced. fill rounds its length to whole seconds.
window_secondsnumberWhole seconds sent to the model: the range rounded out, at least the minimum for the kind.
billable_secondsnumberwindow_seconds times the billable seconds per second of the kind.
usd_per_secondnumberPrice per billable second your workspace pays, after discount_pct.
list_usd_per_secondnumberList price per billable second.
discount_pctnumberYour workspace's current discount, from funds added in the last 28 days. 0 when none.
usdnumberbillable_seconds times usd_per_second, rounded to the cent. The amount a fix holds and charges.
retryobjectdiscount_pct, times and usd: the price of repeating the same fix after it finished.
notestringA short explanation of the seconds sent.
Errors
| Status | Code | When it happens | Retry |
|---|---|---|---|
400 | invalid_json | The body is not a JSON object. | No |
401 | api_key_missing | No Bearer key was sent in the Authorization header. | No |
401 | api_key_invalid | The key is malformed or unknown. | No |
401 | api_key_revoked | The key was deleted in the console. | No |
401 | api_key_disabled | The key is disabled in the console. | No |
401 | api_key_expired | The key is past its expiration date. | No |
403 | insufficient_scope | The key lacks the read permission. Keys created in the console have it. | No |
403 | workspace_forbidden | The account that owns the workspace is suspended or scheduled for deletion. | No |
422 | invalid_parameter | A field is missing or has the wrong type or value. error.param names the field. | No |
422 | invalid_parameter | end_s is past the end of the source, the range is empty, or it is longer than the kind remakes at a time. | No |
422 | source_too_short | The whole source is shorter than the seconds this kind sends to the model. | No |
422 | source_too_long | The source is over 60 seconds. | No |
503 | temporarily_unavailable | The request could not be completed just now. | Yes |
500 | internal_error | Something failed on our side. The request_id identifies the request. | Yes |
503 | api_unavailable | The 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"
}