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.2022: 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.0.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: suno_api-0.0.2.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.0.2.tar.gz
Algorithm Hash digest
SHA256 379669c1b8d0b19e2d18a5f6e9cb95bb6ff9258f1c7c77ea6947922b8713785c
MD5 f45c192f2a01f58c24a48393a67afd9a
BLAKE2b-256 d734f8c9f22b65b068cc634a324853bb076576c14f1848b62ddca60c457c3819

See more details on using hashes here.

File details

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

File metadata

  • Download URL: suno_api-0.0.2-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.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ac87e70d5fc44a9ddde4bf24eb47a17fd2f6dd8f61942937fd705edbc64b9954
MD5 9cac85309d8dafc53e7bbb82c5c7ab9d
BLAKE2b-256 383663a23fd3329d1fca557fb8ae3677b51f8fecbf416e2c0b6e9abe9a791d7d

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