Access Stable Audio 2 for absolutely free using this reverse engineered API!
In order to use this API, you need to first make sure you have Node.JS installed on your machine. Alternatively, you may use an online IDE like Repl.it to run the code.
Then, follow the steps below:
-
Obtaining your Stable Audio token. Scroll down to view how
-
Once you have your token, set it in the token.json file accordingly.
-
The
stable_audio.js
file contains the core functionality in the form of a function which has been exported. You may access it like this:const { generateAudio } = require('./stable_audio'); const main = async () => { await generateAudio('electronic dance music', 180, 123); // Prompt (required) | Length (optional) | Seed (optional) }; main();
-
Run the file using
node index.js
. -
There you have it! Once you run the file, it will download to audio_file.mp3 in the same directory for you to listen to. You may adjust the function if you would like to download it in another location.
- Visit https://stableaudio.com/generate and register for an account.
- Open up your browser developer tools (Chrome -
Ctrl
+Shift
+I
) - Navigate to the "Application" tab.
- Under
Local Storage
->https://stableaudio.com
there should be something that looks like this:@@auth0spajs@@::XxXxX12345::@@user@@
. - Copy the value under
id_token
. - Then set it in the token.json file accordingly.