Setup Riffusion
February 17, 2025 (March 31, 2025)
Riffussion API has been decommissioned. Currently we do not have plans to re-release it and recommend switching to Mureka API for music generation.
Table of contents
Approximately 3 minutes to complete setup steps.
Riffusion is a San Francisco-based artificial intelligence startup that enables anyone to create original music using AI. The company’s groundbreaking AI, called Fuzz, generates music through spectrogram images of sound rather than simple audio samples.
Create Riffusion account
We strongly recommend creating a separate Riffusion account specifically for API interaction. Visit https://riffusion.com and use either your Gmail, Discord, or phone number to create an account.
Our initial testing shows that Gmail and phone options are the most stable, we recommend creating API Riffusion accounts using either Gmail or phone.
Locate Riffusion account cookie
Open Chromium-compatible browser (e.g. Google Chrome, Microsoft Edge or Opera) and navigate to https://riffusion.com 1
.
Log out of your account, then log in again. This is an IMPORTANT step. You MUST complete the logout and login process to retrieve a fresh cookie.
Once the page is fully loaded, ensure that you’re logged in with correct Gmail, Discord or phone account.
Open Developer Tools by right-clicking on the page and selecting “Inspect Element”.
Select Developer Tools » Application 2
:
- Locate Storage » Cookies and select
https://www.riffusion.com
3
. - Find cookie(s) named
sb-api-auth-token
(for phone account) orsb-api-auth-token.0
andsb-api-auth-token.1
(for Gmail and Discord accounts)4
. - Copy the value of
sb-api-auth-token
or if you have two cookiessb-api-auth-token.0
andsb-api-auth-token.1
concatenate their values5
.
Note that the value ofsb-api-auth-token
orsb-api-auth-token.0
should start withbase64-…
.
After the cookie is retrieved, DO NOT LOG OUT from the account and simply close the browser. Logging out will terminate your session and prevent the API from using your cookie.
You MUST close the browser tab containing the session used to retrieve the cookie for the API. If you keep it open, the cookie will be refreshed within the browser and will prevent the API from refreshing your cookie properly, resulting in an email with an error message.
If you want to use the account linked to the API from the browser, ensure that you clear all cookies before opening the Riffusion website again.
👉 The cookie obtained above never expires and will be managed and refreshed by the API automatically if you follow the instructions correctly.
Optional script to extract cookie value
If you have basic development knowledge, you can execute the following code snippet from the Developer Tools » Console command line to retrieve the cookie value:
document.cookie.split(';')
.map(s => s.trim().split('='))
.filter(([name]) => /^sb-api-auth-token(?:\.\d+)?$/.test(name))
.map(([, value]) => value)
.join('')
Use the handy script below to clear all session cookies. This will make your browser forget the current session—think of it as a soft logout.
document.cookie.split(';').forEach(cookie => {
const name = cookie.split('=')[0].trim();
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/`;
});
Configure Riffusion API account
Proceed to POST /accounts and configure the Riffusion API account using the cookie
obtained above.