Siren Motion Transfer
Siren Motion Transfer estimate API
Price a Siren Motion Transfer video from its resolution and source length. Estimates are free.
https://serastudio.app/api/v1/siren/estimateUsage notes
- An estimate creates nothing and costs nothing.
- The key needs the read permission. Keys created in the console have it.
max_usdis what a generation with the same resolution and length holds from your balance.usd_per_secondis the price your workspace pays: the list price minus your current discount (discount_pct). See Pricing.- A source must be 1 to 15 seconds long. A shorter one returns
source_too_short, and a longer one returnssource_too_long. - The length is rounded up to a whole second. A source shorter than 4 seconds counts as 4 seconds.
- Leave out
source_duration_sto price the longest source this mode accepts, 15 seconds. - The endpoint ignores fields it does not know.
Quick start
curl https://serastudio.app/api/v1/siren/estimate \
-H "Authorization: Bearer $SERA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"resolution": "720p", "source_duration_s": 9.4}'import os, requests
r = requests.post(
"https://serastudio.app/api/v1/siren/estimate",
headers={"Authorization": f"Bearer {os.environ['SERA_API_KEY']}", "Content-Type": "application/json"},
json={"resolution": "720p", "source_duration_s": 9.4},
)
print(r.json())const res = await fetch('https://serastudio.app/api/v1/siren/estimate', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SERA_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ resolution: '720p', source_duration_s: 9.4 }),
});
const estimate = await res.json();
console.log(estimate);Input schema
resolutionstringdefault: "480p"Output resolution to price. Allowed values: "480p", "720p", "1080p". Leave it out, or send null, to price at "480p".
source_duration_snumberLength of the source video in seconds, from 1 to 15. Leave it out, or send null, to price 15 seconds.
Complete JSON schema
{
"type": "object",
"title": "EstimateRequest",
"properties": {
"resolution": {
"type": [
"string",
"null"
],
"enum": [
"480p",
"720p",
"1080p",
null
],
"default": "480p"
},
"source_duration_s": {
"type": [
"number",
"null"
],
"minimum": 1,
"maximum": 15
}
},
"additionalProperties": true
}Response
A successful request returns 200 with the estimate:
{
"model": "siren",
"currency": "usd",
"resolution": "720p",
"usd_per_second": 0.175,
"list_usd_per_second": 0.175,
"discount_pct": 0,
"billable_seconds": 20,
"source_seconds_billed": 10,
"max_usd": 3.5,
"min_source_seconds_billed": 4,
"max_source_seconds": 15,
"note": "Billable seconds = output duration + input video duration. A generation holds max_usd from your balance, then charges the finished length and restores the rest."
}modelstringThe mode, siren.
currencystringAlways usd.
resolutionstringThe resolution that was priced.
usd_per_secondnumberPrice per billable second your workspace pays at that resolution, after discount_pct.
list_usd_per_secondnumberList price per billable second at that resolution.
discount_pctnumberYour workspace's current discount, from funds added in the last 28 days. 0 when none.
billable_secondsnumbersource_seconds_billed times 2.
source_seconds_billednumberSource seconds counted: the length rounded up and never less than 4, or 15 when you leave the length out.
max_usdnumberbillable_seconds times usd_per_second, rounded to the cent. The hold a generation takes.
min_source_seconds_billednumberThe minimum value of source_seconds_billed: 4.
max_source_secondsnumberThe longest source this mode accepts: 15.
notestringA short explanation of billable_seconds and max_usd.
Errors
| Status | Code | When it happens | Retry |
|---|---|---|---|
400 | invalid_json | The body is not a JSON object. An empty body is read as {}. | 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 has the wrong type or value. error.param names the field. | No |
422 | source_too_short | source_duration_s is more than 0 but under 1 second. | No |
422 | source_too_long | source_duration_s is over 15 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 source longer than 15 seconds, for example, returns 422:
{
"error": {
"type": "invalid_request",
"code": "source_too_long",
"message": "The source is 16 s; Siren accepts up to 15 s.",
"fix": "Trim the source to 15 s or less.",
"param": "source_duration_s",
"charged": false,
"retryable": false
},
"request_id": "req_k38ss8hmb36g9308sy351ot3yi"
}See Errors and retries for the error body and when to retry.