Suno API Unofficial Suno AI Client

shiyiAI tools470

This is an unofficial Suno API client based on Python and Streamlit, currently supporting functionalities such as music generation and fetching music information.


Features:

- Automatic maintenance and keep-alive of tokens.

- Ability to save information for multiple accounts.

- Simple codebase, easy to maintain, and suitable for further development.


Usage:

To run:

1. Install dependencies:


   ```

   pip3 install -r requirements.txt

   ```


2. Start the project. For Streamlit, refer to Streamlit documentation:


   ```

   streamlit run main.py

   ```


Docker:

```

docker compose build && docker compose up

```


Configuration:

- Log in to your account from the browser and obtain your session and cookie while logged in.

- Fill in the session information in the settings; it will be automatically kept alive. You can save information for multiple accounts.

- Save the information after filling it in. You can change or modify account information by inputting 'identity'.

- After completion, access http://localhost:8501/ from your browser to use the application.


Documentation:

If the page continually prompts: "Please set information to save first, and then refresh the page to use it normally! Please add your account information to save it first, and then delete other invalid account information from the sunoapi.db database, including the test account information I provided. Then you can use it normally."


Music Generation Task Submission:

After successfully submitting a music generation task, pull the status from the generation task queue. It returns successfully when the status is "complete". By default, it waits for 15 seconds for the official generation file. The official API directly returns the media file URL. In most cases, the page can display these media files correctly. Sometimes, although the API has returned the media file URL, the actual file cannot be accessed from the URL immediately. At this time, the media file may not be loaded on the page. You can right-click on the media player and copy the media file address, then open it separately in the browser, or directly right-click and "save as" to download it.


Security of Saving Account Session and Cookie Information:

As long as your account is not recharged, there is no need to worry about the security of saving account session and cookie information. If your account is active elsewhere or logged out from the official website, the saved session and cookie information will become invalid. Also, the session and cookie will change the next time you log in to the official website.


Communication:

For discussions, refer to the following resources:

- Suno.com Official Website: https://suno.com

- Suno-API: https://github.com/SunoAI-API/Suno-API


Disclaimer:

SunoApi is an unofficial open-source project intended for learning and research purposes only. Users voluntarily input free account information to generate music. Each account can generate five songs for free every day, and we won't use them for other purposes. Please use it with confidence! If there are 10,000 users, the system can generate 50,000 songs for free every day. Please try to save usage because each account can only generate five songs for free every day. If everyone creates more than five songs a day, it's still not enough. The ultimate goal is to be able to generate songs for free anytime when needed.


Write a comment    

◎ Welcome to participate in the discussion. Please express your opinions and exchange your views here.