### Install Udio Wrapper from GitHub Source: https://github.com/flowese/udiowrapper/blob/main/README.md Install the udio_wrapper package directly from its GitHub repository. ```bash pip install git+https://github.com/flowese/UdioWrapper.git ``` -------------------------------- ### Install Udio Wrapper Source: https://context7.com/flowese/udiowrapper/llms.txt Install the udio_wrapper package from PyPI or directly from GitHub. Use the upgrade command to ensure the latest version. ```bash pip install udio_wrapper ``` ```bash pip install --upgrade --no-cache-dir udio_wrapper ``` ```bash pip install git+https://github.com/flowese/UdioWrapper.git ``` -------------------------------- ### Install Udio Wrapper from PyPI Source: https://github.com/flowese/udiowrapper/blob/main/README.md Use this command to install the udio_wrapper package from the Python Package Index. ```bash pip install udio_wrapper ``` -------------------------------- ### Initialize Udio Wrapper Source: https://github.com/flowese/udiowrapper/blob/main/README.md Import the UdioWrapper class and initialize it with your authentication token. Replace 'your-auth-token-here' with your actual token obtained from Udio. ```python auth_token = "your-auth-token-here" # Replace this with your actual authentication token udio_wrapper = UdioWrapper(auth_token) ``` -------------------------------- ### Create a Complete Song with UdioWrapper Source: https://context7.com/flowese/udiowrapper/llms.txt Orchestrates the entire song pipeline in one call: generates a short opening, runs N extensions, and appends an outro. Returns a structured dict with results from each stage. Ensure `num_extensions` matches or is less than or equal to the length of `extend_prompts`. ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") sequence = udio.create_complete_song( short_prompt="On a full moon night", extend_prompts=[ "the soft sound of the saxophone fills the air", "creating an atmosphere of mystery and romance" ], outro_prompt="Thus ends this melody, leaving an echo of emotions in the heart", seed=7, # Fixed seed for reproducibility across all parts num_extensions=2, # Must match or be <= len(extend_prompts) custom_lyrics_short="Verse 1: Moonlight falls...", custom_lyrics_extend=[ "Verse 2: Saxophone weeps...", "Bridge: Shadows dance..." ], custom_lyrics_outro="Outro: Silence returns..." ) # Returns: # { # "short_song": [{"id": ..., "title": ..., "song_path": ...}], # "extend_songs": [[...], [...]], # one list per extension # "outro_song": [{"id": ..., "title": ..., "song_path": ...}] # } print("Short song ID:", sequence["short_song"][0]["id"]) print("Extension 1 title:", sequence["extend_songs"][0][0]["title"]) print("Outro title:", sequence["outro_song"][0]["title"]) # All track IDs accumulated on the client instance print("All generated IDs:", udio.all_track_ids) ``` -------------------------------- ### Create a Short Song Source: https://context7.com/flowese/udiowrapper/llms.txt Generate a short song using a text prompt, an optional seed for reproducibility, and custom lyrics. The song is downloaded to the `short_songs/` folder. Returns metadata including the track ID and download path. ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") result = udio.create_song( prompt="Relaxing jazz and soulful music", seed=42, # Use -1 for random; fixed seed = reproducible output custom_lyrics="Verse 1: Soft lights, cool breeze..." # Optional; omit for instrumental ) # result is a list of dicts, e.g.: # [{"id": "abc123", "title": "Relaxing Jazz", "song_path": "https://...", "finished": True}] print("Generated track ID:", result[0]["id"]) print("Download path:", result[0]["title"] + ".mp3") # saved under short_songs/ ``` -------------------------------- ### UdioWrapper.__init__(auth_token) Source: https://context7.com/flowese/udiowrapper/llms.txt Initializes the UdioWrapper client with the provided authentication token. This token is used for all subsequent API calls. ```APIDOC ## UdioWrapper.__init__(auth_token) — Initialize the client Instantiates the wrapper with your Udio session token. All subsequent API calls use this token for authentication via the `Cookie` header. ```python from udio_wrapper import UdioWrapper auth_token = "your-sb-api-auth-token-value" udio = UdioWrapper(auth_token) # The client is now ready; all_track_ids accumulates IDs across calls print(udio.all_track_ids) # [] ``` ``` -------------------------------- ### Create a Short Song Source: https://github.com/flowese/udiowrapper/blob/main/README.md Generate a short song using a text prompt, seed, and custom lyrics. The song is generated but not downloaded. ```python short_song_no_download = udio_wrapper.create_song( prompt="Relaxing jazz and soulful music", seed=-1, custom_lyrics="Short song lyrics here" ) print("Short song generated without downloading:", short_song_no_download) ``` -------------------------------- ### Upgrade Udio Wrapper from PyPI Source: https://github.com/flowese/udiowrapper/blob/main/README.md Use this command to upgrade the udio_wrapper package to the latest version from PyPI. ```bash pip install --upgrade --no-cache-dir udio_wrapper ``` -------------------------------- ### extend(prompt, seed, audio_conditioning_path, audio_conditioning_song_id, custom_lyrics) Source: https://context7.com/flowese/udiowrapper/llms.txt Extends an existing song by generating a continuation based on a prompt, seed, custom lyrics, and the audio URL and ID of the previous track. The extended song is downloaded. ```APIDOC ## extend(prompt, seed, audio_conditioning_path, audio_conditioning_song_id, custom_lyrics) — Extend an existing song Generates a continuation of a previously created song by conditioning on its audio URL and track ID. The result is downloaded to an `extend_songs/` folder. ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") # Assume short_song was returned by create_song() short_song = udio.create_song("Upbeat electronic intro", seed=-1) extended = udio.extend( prompt="A dynamic build-up evolving the electronic intro", seed=-1, audio_conditioning_path=short_song[0]["song_path"], # URL of previous track audio_conditioning_song_id=short_song[0]["id"], # ID of previous track custom_lyrics="Chorus: Rising higher, feel the energy..." ) print("Extended track:", extended[0]["title"]) # saved under extend_songs/ ``` ``` -------------------------------- ### Download a Song Manually with UdioWrapper Source: https://context7.com/flowese/udiowrapper/llms.txt Downloads an `.mp3` from a Udio CDN URL to a local folder. Called automatically by `process_songs`, but also usable standalone to re-download or redirect to a custom path. The specified folder will be created automatically if it doesn't exist. ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") udio.download_song( song_url="https://cdn.udio.com/songs/some-track.mp3", song_title="My Jazz Track", folder="my_music_output" # Created automatically if it doesn't exist ) # File saved to: my_music_output/My Jazz Track.mp3 ``` -------------------------------- ### Initialize UdioWrapper Client Source: https://context7.com/flowese/udiowrapper/llms.txt Instantiate the UdioWrapper client with your Udio session token. This token is used for authentication in subsequent API calls. The `all_track_ids` attribute accumulates IDs across calls. ```python from udio_wrapper import UdioWrapper auth_token = "your-sb-api-auth-token-value" udio = UdioWrapper(auth_token) # The client is now ready; all_track_ids accumulates IDs across calls print(udio.all_track_ids) # [] ``` -------------------------------- ### create_complete_song Source: https://context7.com/flowese/udiowrapper/llms.txt Orchestrates the entire song pipeline in one call: generates a short opening, runs N extensions, and appends an outro. Returns a structured dict with results from each stage. ```APIDOC ## `create_complete_song(...)` — Generate a full multi-part sequence Orchestrates the entire song pipeline in one call: generates a short opening, runs N extensions, and appends an outro. Returns a structured dict with results from each stage. ### Parameters - **short_prompt** (string) - Required - A prompt to generate the opening part of the song. - **extend_prompts** (list of strings) - Optional - A list of prompts for extending the song. - **outro_prompt** (string) - Optional - A prompt for generating the outro of the song. - **seed** (integer) - Optional - A fixed seed for reproducibility across all parts. - **num_extensions** (integer) - Optional - The number of extensions to generate. Must match or be less than or equal to the length of `extend_prompts`. - **custom_lyrics_short** (string) - Optional - Custom lyrics for the short opening part. - **custom_lyrics_extend** (list of strings) - Optional - Custom lyrics for the extended parts. - **custom_lyrics_outro** (string) - Optional - Custom lyrics for the outro part. ### Returns A structured dictionary containing results from each stage: ```json { "short_song": [{"id": ..., "title": ..., "song_path": ...}], "extend_songs": [[...], [...]], // one list per extension "outro_song": [{"id": ..., "title": ..., "song_path": ...}] } ``` ### Example ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") sequence = udio.create_complete_song( short_prompt="On a full moon night", extend_prompts=[ "the soft sound of the saxophone fills the air", "creating an atmosphere of mystery and romance" ], outro_prompt="Thus ends this melody, leaving an echo of emotions in the heart", seed=7, num_extensions=2, custom_lyrics_short="Verse 1: Moonlight falls...", custom_lyrics_extend=[ "Verse 2: Saxophone weeps...", "Bridge: Shadows dance..." ], custom_lyrics_outro="Outro: Silence returns..." ) print("Short song ID:", sequence["short_song"][0]["id"]) print("Extension 1 title:", sequence["extend_songs"][0][0]["title"]) print("Outro title:", sequence["outro_song"][0]["title"]) ``` ``` -------------------------------- ### create_song(prompt, seed, custom_lyrics) Source: https://context7.com/flowese/udiowrapper/llms.txt Generates a short song based on a text prompt, an optional seed for reproducibility, and custom lyrics. The generated song is downloaded as an MP3 file. ```APIDOC ## create_song(prompt, seed, custom_lyrics) — Generate a short song Sends a generation request to Udio's `generate-proxy` endpoint and polls until the track is finished, then downloads the `.mp3` to a `short_songs/` folder. Returns a list of song metadata dicts. ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") result = udio.create_song( prompt="Relaxing jazz and soulful music", seed=42, # Use -1 for random; fixed seed = reproducible output custom_lyrics="Verse 1: Soft lights, cool breeze..." # Optional; omit for instrumental ) # result is a list of dicts, e.g.: # [{"id": "abc123", "title": "Relaxing Jazz", "song_path": "https://...", "finished": True}] print("Generated track ID:", result[0]["id"]) print("Download path:", result[0]["title"] + ".mp3") # saved under short_songs/ ``` ``` -------------------------------- ### Create a Complete Song Sequence Source: https://github.com/flowese/udiowrapper/blob/main/README.md Generate a full song sequence, including a short song, multiple extensions, and an outro. This method takes multiple prompts and custom lyrics for each part of the sequence. ```python complete_song_sequence = udio_wrapper.create_complete_song( short_prompt="On a full moon night", extend_prompts=["the soft sound of the saxophone fills the air", "creating an atmosphere of mystery and romance"], outro_prompt="Thus ends this melody, leaving an echo of emotions in the heart", num_extensions=2, custom_lyrics_short="Short song lyrics here", custom_lyrics_extend=["Lyrics for first extension", "Lyrics for second extension"], custom_lyrics_outro="Outro lyrics here" ) print("Complete song sequence generated and downloaded:", complete_song_sequence) ``` -------------------------------- ### add_outro(prompt, seed, audio_conditioning_path, audio_conditioning_song_id, custom_lyrics) Source: https://context7.com/flowese/udiowrapper/llms.txt Appends an outro to a song sequence. It conditions on the last track in the sequence and is downloaded to an `outro_songs/` folder. ```APIDOC ## add_outro(prompt, seed, audio_conditioning_path, audio_conditioning_song_id, custom_lyrics) — Append an outro Generates a closing segment conditioned on the final song in the sequence. Uses `crop_start_time: 0.9` internally so the outro blends from near the end of the source track. Downloaded to `outro_songs/`. ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") last_track = udio.extend( "Melodic bridge section", seed=-1, audio_conditioning_path="https://udio.com/.../track.mp3", audio_conditioning_song_id="track-id-xyz" ) outro = udio.add_outro( prompt="A gentle, fading conclusion to the journey", seed=-1, audio_conditioning_path=last_track[0]["song_path"], audio_conditioning_song_id=last_track[0]["id"], custom_lyrics="Outro: Fading echoes, peaceful end..." ) print("Outro saved:", outro[0]["title"] + ".mp3") ``` ``` -------------------------------- ### download_song Source: https://context7.com/flowese/udiowrapper/llms.txt Download a track manually by downloading an .mp3 from a Udio CDN URL to a local folder. ```APIDOC ## `download_song(song_url, song_title, folder)` — Download a track manually Downloads an `.mp3` from a Udio CDN URL to a local folder. Called automatically by `process_songs`, but also usable standalone to re-download or redirect to a custom path. ### Parameters - **song_url** (string) - Required - The CDN URL of the song to download. - **song_title** (string) - Required - The desired title for the downloaded song file. - **folder** (string) - Optional - The local folder to save the song into. Created automatically if it doesn't exist. ### Example ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") udio.download_song( song_url="https://cdn.udio.com/songs/some-track.mp3", song_title="My Jazz Track", folder="my_music_output" ) # File saved to: my_music_output/My Jazz Track.mp3 ``` ``` -------------------------------- ### Extend an Existing Song Source: https://context7.com/flowese/udiowrapper/llms.txt Create a continuation of a song by conditioning on its audio URL and track ID. This method requires the `song_path` and `id` from a previously generated song. The result is saved to the `extend_songs/` folder. ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") # Assume short_song was returned by create_song() short_song = udio.create_song("Upbeat electronic intro", seed=-1) extended = udio.extend( prompt="A dynamic build-up evolving the electronic intro", seed=-1, audio_conditioning_path=short_song[0]["song_path"], # URL of previous track audio_conditioning_song_id=short_song[0]["id"], # ID of previous track custom_lyrics="Chorus: Rising higher, feel the energy..." ) print("Extended track:", extended[0]["title"]) # saved under extend_songs/ ``` -------------------------------- ### Extend an Existing Song Source: https://github.com/flowese/udiowrapper/blob/main/README.md Extend a previously created song by providing its conditioning path and ID. This allows for lyric customization and generates a new version of the song. ```python extend_song_download = udio_wrapper.extend( prompt="A dynamic version of relaxing jazz and soulful music", seed=-1, audio_conditioning_path="url-generated-song", audio_conditioning_song_id="previous-song-id", custom_lyrics="Extended version lyrics" ) print("Extended song generated and downloaded:", extend_song_download) ``` -------------------------------- ### Add an Outro to a Song Source: https://github.com/flowese/udiowrapper/blob/main/README.md Generate an outro for a music sequence, using the last song as a base for conditioning. Custom lyrics can be provided for the outro. ```python outro_song_download = udio_wrapper.add_outro( prompt="A smooth ending to our jazz session", seed=-1, audio_conditioning_path="url-generated-song", audio_conditioning_song_id="last-extended-song-id", custom_lyrics="Outro lyrics here" ) print("Outro song generated and downloaded:", outro_song_download) ``` -------------------------------- ### Append an Outro to a Song Source: https://context7.com/flowese/udiowrapper/llms.txt Generate a closing segment for a song sequence, conditioned on the last track. The outro blends from near the end of the source track and is downloaded to the `outro_songs/` folder. ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") last_track = udio.extend( "Melodic bridge section", seed=-1, audio_conditioning_path="https://udio.com/.../track.mp3", audio_conditioning_song_id="track-id-xyz" ) outro = udio.add_outro( prompt="A gentle, fading conclusion to the journey", seed=-1, audio_conditioning_path=last_track[0]["song_path"], audio_conditioning_song_id=last_track[0]["id"], custom_lyrics="Outro: Fading echoes, peaceful end..." ) print("Outro saved:", outro[0]["title"] + ".mp3") ``` -------------------------------- ### Check Song Generation Status with UdioWrapper Source: https://context7.com/flowese/udiowrapper/llms.txt Polls the Udio `songs` endpoint for a list of track IDs and reports whether all tracks have finished rendering. Used internally by `process_songs` but can be called directly for custom polling loops. ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") status = udio.check_song_status(["track-id-001", "track-id-002"]) # Returns: {"all_finished": True/False, "data": {"songs": [...]}} if status and status["all_finished"]: for song in status["data"]["songs"]: print(f"Ready: {song['title']} @ {song['song_path']}") else: print("Still generating...") ``` -------------------------------- ### check_song_status Source: https://context7.com/flowese/udiowrapper/llms.txt Poll generation status by querying the Udio `songs` endpoint for a list of track IDs and reporting whether all tracks have finished rendering. ```APIDOC ## `check_song_status(song_ids)` — Poll generation status Queries the Udio `songs` endpoint for a list of track IDs and reports whether all tracks have finished rendering. Used internally by `process_songs` but can be called directly for custom polling loops. ### Parameters - **song_ids** (list of strings) - Required - A list of track IDs to check the status for. ### Returns A dictionary containing the status: ```json {"all_finished": True/False, "data": {"songs": [...]}} ``` ### Example ```python from udio_wrapper import UdioWrapper udio = UdioWrapper("your-auth-token") status = udio.check_song_status(["track-id-001", "track-id-002"]) if status and status["all_finished"]: for song in status["data"]["songs"]: print(f"Ready: {song['title']} @ {song['song_path']}") else: print("Still generating...") ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.