Skip to main content

Riffusion API

Project description

Riffusion API

Banner

Code for API access to Riffusion's frontier models to make incredible music

This API is in a private beta and subject to change. Contact api@riffusion.com for inquiries and access.

Usage

Set your API key:

export RIFFUSION_API_KEY="<your-api-key>"

Install the Python client:

pip install riff-api

Make some music:

from riff_api import RiffAPIClient

client = RiffAPIClient()

response = client.prompt(
    "Explain the concept of time in French, piano chill",
    save_to="chill.m4a",
)

This will generate a full song with lyrics and music. Run multiple times for variations.

Endpoints

/prompt

This endpoint creates a song from a single natural language description the desired lyrical content and/or musical style. It's the simplest way to create.

The API will generate lyrics based on your topic, as well as pick specific sound prompts. If you don't describe a musical style or lyrics content, it will choose for you.

Get creative with your topics! Here are a few ideas:

  • "Rap fun facts about Alaskan history"
  • "Explain the concept of time in French"
  • "My nephew Remi is a superhero with laser eyes. Make him a theme song with a rock orchestra"

Currently the API only supports returning base64 encoded bytes of an m4a file.

Both /prompt and /compose accept an optional model argument to select between "FUZZ 1.0" and "FUZZ 1.1". The default is "FUZZ 1.1".

/compose

This endpoint provides a more powerful capability for music lovers to craft the exact sound they want. You can specify custom lyrics and multiple sound prompts with individually controllable strengths for deeper control.

The returned output contains detailed timestamps for each word in the lyrics.

Repo

  • riff_api/types.py - API schema
  • riff_api/examples/prompt - Examples for creating a song via the client, requests, and curl
  • riff_api/examples/compose - Examples for custom creation

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

riff_api-0.4.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

riff_api-0.4.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file riff_api-0.4.0.tar.gz.

File metadata

  • Download URL: riff_api-0.4.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for riff_api-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2a9d7c7525c2e33a685099ead1d7657d671d9e81d30d4a8d57de007901fa0de5
MD5 36e5f78891961ec3474564d5b4376397
BLAKE2b-256 dbdb6362cce35775d79c605c0f0179f3392d540045aa2fea62786d35949897b9

See more details on using hashes here.

File details

Details for the file riff_api-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: riff_api-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for riff_api-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58b791e376f73bbade45811b6d30bdc3ca59602eaae1b1a0cb33f1a4cd9f9506
MD5 0bca54f6a5ebda3838cf6d0509340030
BLAKE2b-256 3db1b673e2eafa232d847dba7698bcf161229f10c01acfc46da4f1e70b84e441

See more details on using hashes here.

Supported by

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