pub struct Clip {Show 45 fields
pub id: String,
pub title: String,
pub audio_url: String,
pub media_urls: Vec<MediaUrl>,
pub image_url: String,
pub image_large_url: String,
pub video_url: String,
pub video_cover_url: String,
pub tags: String,
pub duration: f64,
pub play_count: u64,
pub status: String,
pub created_at: String,
pub display_name: String,
pub handle: String,
pub user_id: String,
pub batch_index: Option<i64>,
pub avatar_image_url: String,
pub is_liked: bool,
pub is_trashed: bool,
pub has_vocal: bool,
pub has_stem: bool,
pub stem_from_id: String,
pub stem_task: String,
pub stem_type_id: Option<i64>,
pub stem_type_group_name: String,
pub clip_type: String,
pub prompt: String,
pub gpt_description_prompt: String,
pub lyrics: String,
pub model_name: String,
pub major_model_version: String,
pub edited_clip_id: String,
pub task: String,
pub is_remix: bool,
pub cover_clip_id: String,
pub upsample_clip_id: String,
pub remaster_clip_id: String,
pub speed_clip_id: String,
pub override_history_clip_id: String,
pub override_future_clip_id: String,
pub history: Vec<HistoryEntry>,
pub concat_history: Vec<HistoryEntry>,
pub clip_roots: Vec<ClipRoot>,
pub clip_attribution_type: String,
}Expand description
One finished Suno track, flattened from the API’s nested response shape.
Fields§
§id: String§title: String§audio_url: String§media_urls: Vec<MediaUrl>Every audio asset Suno lists for the clip (an mp3 plus, usually, an
m4a-opus). Empty when the API omits media_urls, so a clip with no
listed assets falls back to audio_url (then synthesis) exactly as
before. The mp3 entry is the authoritative, non-expiring source.
image_url: String§image_large_url: String§video_url: String§video_cover_url: String§duration: f64§play_count: u64§status: String§created_at: String§display_name: String§handle: String§user_id: StringThe clip owner’s account id (top-level user_id). Feeds the
foreign-owner attribution check and cross-account dedup; empty when the
API omits it.
batch_index: Option<i64>Index within a generation batch (paired gens), for sibling
disambiguation in naming and dedup. None when batch_index is absent.
avatar_image_url: StringThe clip owner’s avatar image URL (avatar_image_url, or the
user_-prefixed form on a parent-shaped clip). Empty when absent.
is_liked: bool§is_trashed: bool§has_vocal: bool§has_stem: boolWhether Suno reports this clip already has separated stems, from
metadata.has_stem. The stems mirror uses it as a precondition: a clip
whose has_stem is false or absent is never queried for stems.
stem_from_id: Stringmetadata.stem_from_id: the clip this one was separated from, when it is
a stem child. Empty when absent. Structured stem lineage, carried on an
ordinary feed clip independently of the /stems listing.
stem_task: Stringmetadata.stem_task: the separation-run id grouping one set of stems.
Empty when absent.
stem_type_id: Option<i64>metadata.stem_type_id: the numeric separation-type id. Tolerates both
the integer and the float (91.0) forms Suno has used; None when
absent or non-numeric.
stem_type_group_name: Stringmetadata.stem_type_group_name: the canonical stem group in underscore
form (e.g. Backing_Vocals). Empty when absent. Preferred, normalised,
over a title parenthetical as the stem label.
clip_type: String§prompt: String§gpt_description_prompt: String§lyrics: String§model_name: String§major_model_version: String§edited_clip_id: String§task: String§is_remix: bool§cover_clip_id: String§upsample_clip_id: String§remaster_clip_id: String§speed_clip_id: String§override_history_clip_id: String§override_future_clip_id: String§history: Vec<HistoryEntry>§concat_history: Vec<HistoryEntry>§clip_roots: Vec<ClipRoot>The remix/attribution origins Suno lists under the nested clip_roots
object (clip_roots.clips[]). Empty when the key is absent. These feed
attribution edges and a same-owner gap-fill seed only; they are never
read by structural root resolution.
clip_attribution_type: StringThe attribution kind for clip_roots (clip_roots.clip_attribution_type,
e.g. "remix"). Open string, empty when absent.
Implementations§
Source§impl Clip
impl Clip
Sourcepub fn from_json(raw: &Value) -> Clip
pub fn from_json(raw: &Value) -> Clip
Build a Clip from one raw API clip object.
Clip-level fields and lineage live at the top level; content fields like
tags and duration live under metadata. Temporary audiopipe audio URLs
expire, so they are rewritten to the permanent CDN URL.
Sourcepub fn mp3_url(&self) -> String
pub fn mp3_url(&self) -> String
The MP3 source URL, in priority order: the API-listed media_urls mp3
asset (authoritative and non-expiring), then the clip’s audio_url, then
the deterministic CDN URL synthesised from the id.
When media_urls is absent the behaviour is unchanged: a present
audio_url is returned verbatim, and an empty one synthesises the CDN
URL.
Sourcepub fn cover_candidates(&self) -> Vec<&str>
pub fn cover_candidates(&self) -> Vec<&str>
Cover-art URLs in preference order (large image, image, video cover), dropping any that are empty.
Sourcepub fn selected_image_url(&self) -> Option<&str>
pub fn selected_image_url(&self) -> Option<&str>
The preferred cover-art URL, or None when the clip carries no art.