Skip to main content

Unofficial Suno Python API

Project description

Suno API

GitHub PyPI

Unofficial Suno Python API

Installation

pip install suno-api

Quickstart

Sign in to Suno at https://app.suno.ai/, and get your cookie

You can find your cookie from the browser's Developer Tools -> Network tab

Screenshot

Create an instance of class Suno with your cookie

import suno

client = suno.Suno(cookie="your-cookie-here")

Create your clips

clips = client.songs.generate(
    "your-song-description-here", 
    instrumental=False,
)

or start with custom mode

clips = client.songs.generate(
    "your-lyrics-here", 
    cutomized=True,
    tags="your-music-style-here",
    instrumental=False,
)

Review the newly created clip.

clip = client.songs.get("your-clip-id-here")

Review all your created clips in the library.

clips = client.songs.list()

Check your remaining credits

credits = client.get_credits()

Here is a sample clip/song JSON object:

{
  "id":"0e42f167-17ab-4004-941b-d549b24dce76",
  "video_url":"https://cdn1.suno.ai/0e42f167-17ab-4004-941b-d549b24dce76.mp4",
  "audio_url":"https://cdn1.suno.ai/0e42f167-17ab-4004-941b-d549b24dce76.mp3",
  "image_url":"https://cdn1.suno.ai/image_75b03116-0aa2-4367-bdf6-8556dde4df9f.png",
  "image_large_url":"https://cdn1.suno.ai/image_large_75b03116-0aa2-4367-bdf6-8556dde4df9f.png",
  "major_model_version":"v3",
  "model_name":"chirp-v3",
  "metadata":{
    "tags":"Rap\nJapanese rock\nPop\nVocaloid style\nEnergetic\nUpbeat\nCatchy\nCulinary\nCooking\nRecipe-focused",
    "prompt":"[Chorus]\nIn der Weihnachtsbäckerei\nGibt es manche Leckerei\nZwischen Mehl und Milch\nMacht so mancher Knilch\nEine riesengroße Kleckerei\nIn der Weihnachtsbäckerei\nIn der Weihnachtsbäckerei\n\n[Verse 1]\nWo ist das Rezept geblieben\nVon den Plätzchen, die wir lieben?\nWer hat das Rezept verschleppt?\n\"Ich nicht\"\n\"Du vielleicht?\"\n\"Ich auch nicht\"\n\nNa, dann müssen wir es packen\nEinfach frei nach Schnauze backen\nSchmeißt den Ofen an (oh ja)\nUnd ran\n\n[Chorus]\nIn der Weihnachtsbäckerei\nGibt es manche Leckerei\nZwischen Mehl und Milch\nMacht so mancher Knilch\nEine riesengroße Kleckerei\nIn der Weihnachtsbäckerei\nIn der Weihnachtsbäckerei\n\n[Verse 2]\nBrauchen wir nicht Schokolade\nHonig, Nüsse und Succade\nUnd ein bischen Zimt?\nDas stimmt\n\nButter, Mehl und Milch verrühren\nZwischendurch einmal probieren\nUnd dann kommt das Ei (pass auf)\nVorbei\n\n[Chorus]\nIn der Weihnachtsbäckerei\nGibt es manche Leckerei\nZwischen Mehl und Milch\nMacht so mancher Knilch\nEine riesengroße Kleckerei\nIn der Weihnachtsbäckerei\nIn der Weihnachtsbäckerei\n\n[Verse 3]\nBitte mal zur Seite treten\nDenn wir brauchen Platz zum kneten\nSind die Finger rein?\nDu Schwein\n\n\nSind die Plätzchen, die wir stechen\nErstmal auf den Ofenblechen\nWarten wir gespannt\nVerbrannt\n\n[Chorus]\nIn der Weihnachtsbäckerei\nGibt es manche Leckerei\nZwischen Mehl und Milch\nMacht so mancher Knilch\nEine riesengroße Kleckerei\nIn der Weihnachtsbäckerei\nIn der Weihnachtsbäckerei\n\n[Outro]",
    "gpt_description_prompt":"None",
    "audio_prompt_id":"None",
    "history":"None",
    "concat_history":[
      {
        "id":"7b9cfa43-d231-44e8-b69a-d9c0627b016d",
        "continue_at":107.0
      },
      {
        "id":"75b03116-0aa2-4367-bdf6-8556dde4df9f",
        "continue_at":"None"
      }
    ],
    "type":"concat",
    "duration":158.83997916666667,
    "refund_credits":"None",
    "stream":"None",
    "error_type":"None",
    "error_message":"None"
  },
  "is_liked":false,
  "user_id":"cb7486d0-238e-409e-9ff9-e69db325fa84",
  "is_trashed":false,
  "reaction":"None",
  "created_at":"2024-03-24T13:46:25.916Z",
  "status":"complete",
  "title":"In der Weihnachtsbäckerei ",
  "play_count":0,
  "upvote_count":724,
  "is_public":true
}

License

Suno API has a BSD-3-Clause license, as found in the LICENSE file.

Contributing

Changelog

25.04.2024: Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

suno_api-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

suno_api-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file suno_api-0.1.0.tar.gz.

File metadata

  • Download URL: suno_api-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.0 Darwin/21.6.0

File hashes

Hashes for suno_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4157fc9827b7cdbae9be9e7776c0a46b83ee9b875cd412985830847d24cefee
MD5 11e2af1fabbed0e615583636494d5d4d
BLAKE2b-256 f262b3bf054368e3eb5b77b0eea812dc1759bd51d43d93c649a18ce0c41bb9ac

See more details on using hashes here.

File details

Details for the file suno_api-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: suno_api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.0 Darwin/21.6.0

File hashes

Hashes for suno_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e036b932981ed9a87add895b19aad7679681ba8ae0eea74f940135aa24809b7
MD5 131bb099e6e1330e6e7f113181c54ed5
BLAKE2b-256 b97f28648e16c6d51f2b967754de941497ffc38ff5dcdc0ffc502a31427ef967

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page