Here's the updated README with the additional information on manual authentication using JSON payload:
# Suno API
This is the Suno API built with FastAPI. The API includes endpoints for generating music, fetching feeds, generating lyrics, and handling user credentials through sessions (cookies) or direct payload.
## Manual Authentication
To manually authenticate using JSON payload, include the following fields:
```json
{
"data": {
"cookie": "string",
"session_id": "string"
},
"model": {
"field": "value"
}
}
```
- Python 3.8+
- FastAPI
- Uvicorn
- Other dependencies listed in
requirements.txt
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
Run the FastAPI application with Uvicorn:
uvicorn main:app --reload
The application will be available at http://127.0.0.1:8000
.
- GET
/
- Returns a welcome message and the current user status.
- GET
/generate
- Parameters:
model: schemas.CustomModeGenerateParam
- Requires session credentials.
- Parameters:
- POST
/generate
- Parameters:
model: schemas.CustomModeGenerateParam
,data: schemas.Credentials
- Accepts credentials in the payload.
- Parameters:
- GET
/generate/description-mode
- Parameters:
model: schemas.DescriptionModeGenerateParam
- Requires session credentials.
- Parameters:
- POST
/generate/description-mode
- Parameters:
model: schemas.DescriptionModeGenerateParam
,data: schemas.Credentials
- Accepts credentials in the payload.
- Parameters:
- GET
/feed/{aid}
- Path Parameter:
aid
(string) - Requires session credentials.
- Path Parameter:
- POST
/feed/{aid}
- Path Parameter:
aid
(string) - Accepts credentials in the payload.
- Path Parameter:
- GET
/generate/lyrics/
- Parameters:
model: schemas.LyricsGenerateParam
- Requires session credentials.
- Parameters:
- POST
/generate/lyrics/
- Parameters:
model: schemas.LyricsGenerateParam
,data: schemas.Credentials
- Accepts credentials in the payload.
- Parameters:
- GET
/lyrics/{lid}
- Path Parameter:
lid
(string) - Requires session credentials.
- Path Parameter:
- POST
/lyrics/{lid}
- Path Parameter:
lid
(string) - Accepts credentials in the payload.
- Path Parameter:
- GET
/get_credits
- Requires session credentials.
- POST
/get_credits
- Accepts credentials in the payload.
- GET
/reset
- Clears the credentials stored in the session.
- GET
/setup
- Displays a form to input cookie and session ID.
- POST
/setup
- Stores the provided credentials into the session.
To use the API, set up the credentials first by navigating to /setup
and filling in the required fields. Alternatively, credentials can be passed directly in the payload for endpoints that support POST requests.
This project is licensed under the MIT License.
Feel free to further customize this README to match the specifics of your project.