Concepts
A library isolates its assets. Searches only return assets within that library.
When to use it
A library agents understand: store, find, generate and edit images, video, audio.
Use it when
- Generate or edit visuals, find assets by meaning, follow a live stream.
Not for, use instead
- An original file only →
file - Editing video →
cut - Video for signed-in viewers →
content
How it behaves
- Generation is a job; poll about every 10 s; keep
asset_id, not signed URLs.
Combines with
- Fills canvas frames and cut tracks.
Entry: praxis.media.* · docs developers/media/concepts · recipes cookbook/scenarios/works-series
Libraries and assets
An asset has a stable asset_id. Its public_id names it in delivery URLs and may contain path segments. The asset_folder organizes assets; moving folders does not change public_id. Listing assets by asset_folder matches that level only, not its subfolders; an empty string is the root. The display_name is a label and does not determine delivery URLs. One type axis: material_type. Audio has material_type audio, and audio_role tells speech, music and sound effects apart; a file whose specific kind cannot be identified is file.
Library names are at most 64 characters and may repeat; libraries are identified by library_id. Updating an asset’s tags or context, or a library’s labels, replaces the whole value: what you send becomes the complete new content, and (or [] for tags) clears it.
A zero-byte upload returns 400 FILE_EMPTY. A file declared or detected as an image whose dimensions cannot be read (for example, a truncated file) returns 400 Invalid image file. Any other file is stored as raw.
Material types
Every asset has a material_type: image, video, audio, voice, sticker, font, text_style, text_template, animation_preset, lut, transition_map or file (a file whose specific kind cannot be identified). It is the only type axis: you do not specify a type on upload, and the service detects it from the content. Sending resource_type or is_audio returns 400 INVALID_PARAMS; use material_type instead.
To filter by type, list with the query parameter material_type=audio, or search with the expression material_type:audio (for example material_type:audio AND tags=docs). An audio asset’s audio_role (voice, music or sfx) appears in the asset output and tells speech, music and sound effects apart; it is also an expression field, filtered with audio_role:music (voice, music or sfx; carried only by audio materials, so an unclassified audio asset matches no role), while the list parameters have no such dimension. The library is Praxis’s own interface; call it with the Praxis SDK or over HTTP.
Access and public delivery
New uploads and File/HTTPS imports default to organization-private type=authenticated. Explicit type=upload permits anonymous access to originals and derivatives; the private default is deliberate. Omitted type preserves the current mode on overwrite. Rename source lookup still defaults to upload; omitted to_type preserves the source type. Existing assets are not converted by the new default.
Use the returned secure_url for the original. A private asset’s secure_url carries a single-file token that expires after 15 minutes, so do not store it: keep the asset reference (library id and asset_id) and read or resolve the link when you need it. Transformations, posters, storyboards and proxies need a delivery token. Do not edit signed paths to make thumbnails. Call POST /media/v1/libraries/LIBRARY_ID/delivery_tokens with your API key and append token as the cld_token query parameter; see Quickstart. The private type is unsupported.
Delivery tokens default to 900 seconds and frame links last 300 seconds. Resolve a fresh link from the asset reference after expiry. Persist library_id, asset_id, version and the representation, never tokens or token-bearing URLs; keep them out of logs and share them only with intended readers.
Understanding
Understanding produces captions, tags, recognized image text, transcripts, and video-frame content. Segments include start and end times. Records are immutable; newer versions can supersede older records, excluded by default.
Overall states are pending, processing, ready, partial, and failed. Individual kinds use pending, running, ready, failed, unsupported, or skipped. Disabled understanding or unsupported content does not prevent original-file access.
Audio and videos with an audio track produce an audio understanding during audio_profile. models.audio defaults to qwen3.8-omni-flash. data.segments[] contains source-media seconds start_s, end_s and type (speech, music, ambient or silence). Other data fields are has_music, nullable genre, mood and bpm_estimate, bpm_is_estimate=true, and analyzed_ranges[] in seconds. Only the first 120 seconds are analyzed, in windows of at most 40 seconds and at most three model calls per asset, billed by actual model usage. BPM is an estimate; has_music=false only means no music was detected in the sampled ranges, not the entire source. Expression example: has_music:true AND audio_genre:jazz AND audio_mood:calm. What an audio material is used for is audio_role (voice, music or sfx; carried only by audio materials), an expression field too: material_type:audio AND audio_role:music.
In Console, use “重试失败项” in “理解进度与失败原因” to queue batch retries. To inspect full-video summaries by output kind, REST uses kind=overview for one asset, or GET /media/v1/libraries/{library_id}/understandings?kinds=overview across a library. The latter accepts folder (including descendants) and cursor; limit defaults to and cannot exceed 100. Here overview filters output kinds; batch reprocess task kinds remain visual, frames, transcript and embedding.
Transcription defaults to fun-asr, falling back to whisper-large-v3-turbo on failure. A transcript record’s data[] keeps text, start_ms, end_ms, and optional speaker (a voice label, not a verified identity) and words[] (each with text, start_ms, end_ms). All times are source-media milliseconds. A segment’s producer identifies its actual model when different from the record producer. Unsupported speaker or word fields are omitted.
Set hotwords: ["Praxis", "Console"] when updating a library: at most 200 nonblank terms of 32 Unicode characters each. Omission derives vocabulary from the library and folder names; [] disables inference. Changes affect subsequent understanding and explicit reprocessing. Transcription, reference transcription, correction and other understanding model calls incur model usage charges.
Video overview records return the full-video summary in content. data.chapters[] contains first_shot (starting shot index), title, summary, start_ms and end_ms (millisecond boundaries). data.iab[] contains tier1, optional tier2, and confidence from 0 to 1. data.location is an unverified place guess or null without evidence. Verify model guesses before relying on them.
Media generates a proxy before understanding for videos of 25 MB or more and audio-only assets of 100 MB or more; duration is limited to 10 minutes.
Extract frames by time
Obtain asset_id from upload or listing and read the video’s duration in seconds before requesting JPEG links:
POST /media/v1/libraries/{library_id}/assets/{asset_id}/framesContent-Type: application/json
{"at_micros":[0,1000000],"width":640}Supply 1–20 nonnegative integer microseconds in at_micros, strictly below duration. The returned frames[] preserves order and duplicates; each entry contains at_micros, url, expires_at. Fetch url to obtain the image. Optional width accepts 160, 320 or 640 and defaults to 640. Only video is supported: audio, images, invalid times and invalid widths return INVALID_PARAMS; correct the input before retrying. Missing or foreign assets return 404.
Authenticated links expire after 300 seconds; request new links after expiry. Upload asset links remain public and permanent regardless of expires_at. Frame requests do not create assets or rerun understanding; delivery usage follows media pricing. Share authenticated links only with intended readers.
Folder writes reject segments containing U+FFFD (�) or consisting entirely of question marks, returning INVALID_PARAMS with UTF-8 guidance. Existing affected folders remain readable, renamable and removable; batch move rescues their assets into a valid destination.
Semantic search
Vectorization is off by default: pass understanding: { embedding: true } when creating the library, or turn on semantic search in the library settings, and assets uploaded afterwards are vectorized. While it is off, the default hybrid search matches keywords only, and semantic and visual search answer LIBRARY_INVALID_STATE with the reason.
Assets become searchable when semantic is ready. Default hybrid search combines keywords and semantics; semantic-only search is also available. Hits include matching content and millisecond timestamps for audio/video segments. Assets that have never completed understanding are excluded; an asset being reprocessed keeps its previous results in search until the new ones are ready.
Documents and other files (raw)
Raw files such as PDF and text are stored without understanding. Their semantic state is unavailable, they are not part of semantic search, and expression search can match only their metadata (public_id, display_name, tags, context, and so on). To search document text, use Knowledge.
Deletion and recovery
Deletion makes content immediately invisible. Libraries can be restored within 7 days; recovery is unavailable afterward. Individual assets have no restore endpoint.
File Library compared
File Library stores files. Media Library additionally organizes, understands, and searches content. Importing a File creates an independent copy, organization-private by default (type=authenticated); set type=upload explicitly for anonymous delivery. Deleting the source File does not delete the copy. Overwrite preserves asset_id but only the latest version is deliverable: old version URLs return 404 at the service; readers may retain cached bytes. Use a new public_id to retain old deliveries before switching references.
Filter by business context: send expression context.sku=KETTLE-RED AND context.revision=2 and with_field: [“context”] to include context.