Create an asset
Create an asset and open its TUS-resumable upload. The response body is
the asset (in pending_upload); the Location header is the transfer URL
— PATCH chunks there until the file is fully uploaded.
Authorizations
Pass your API key as Authorization: Bearer sk_…. Mint a key from your dashboard's API-keys page.
Body
Asset to create — opens a TUS-resumable source upload.
Project that will own the new asset.
Total file size in bytes.
Optional ISO 639-1 hint for the spoken language of the media (e.g. de, en). Normalised to lowercase; must be a 2-letter code. Omit / null to auto-detect. Set once at create and immutable thereafter.
Response
Asset created; the upload transfer URL is in the Location header.
Asset metadata.
Stable unique identifier for the asset.
Identifier of the project that owns this asset.
What kind of media this asset holds: audio or video, derived from the uploaded bytes once the first chunk is received. null before then.
audio, video Lifecycle state: pending_upload while bytes are uploading, processing while Roughy prepares the asset (the per-minute charge settles here, once preparation finishes), pending_payment if your balance didn't cover the charge (bytes kept; auto-activates on your next top-up), ready once prepared and paid for (cuttable and renderable), and failed if preparation permanently failed (see error_code / error_message; nothing is charged on a failure).
pending_upload, processing, pending_payment, ready, failed File extension without the leading dot (e.g. mp3, mp4), derived from the uploaded bytes once the first chunk is received. null before then.
Total stored size in bytes. null while in pending_upload.
MIME type of the stored bytes (e.g. audio/mpeg, video/mp4), derived from the uploaded bytes once the first chunk is received. null before then.
Duration in seconds, measured while the asset is processing. null while pending_upload or processing (before it is measured) and on a failed asset; always present once ready or pending_payment.
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Optional ISO 639-1 hint for the spoken language of the media, set at create and immutable. null means auto-detect.
When the asset row was created.
Machine-readable failure reason. Set only when state is failed; null otherwise.
Human-readable failure detail. Set only when state is failed.
TUS transfer URL for resuming this asset's source upload. Present only while state is pending_upload; null once the upload finalises. Hand it to a TUS client (tus-js-client / tus-py-client) as the upload URL — the client issues a HEAD against it to read the authoritative Upload-Offset, then resumes. While pending_upload, this is the same transfer URL the create response carries in its Location header.