Riffusion API
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
the model to use. The default is "FUZZ 2.0".
/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.
/models
This endpoint returns the list of available models based on your API key.
Repo
riff_api/types.py- API schemariff_api/examples/prompt- Examples for creating a song via the client, requests, and curlriff_api/examples/compose- Examples for custom creation
Metadata
Release files for riff-api 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| riff_api-0.4.2.tar.gz | 8.2 kB | Without provenance | Details for riff_api-0.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| riff_api-0.4.2-py3-none-any.whl | Python 3 | none | any | Details for riff_api-0.4.2-py3-none-any.whl |
Total release size: 17.2 kB
Release files / riff_api-0.4.2.tar.gz
| Download URL | riff_api-0.4.2.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05f401d2bcd515665e372a1f8a49109d5715e66b9f3c920130bebf98032c45de
|
|
BLAKE2b-256 checksum How to use checksums |
0a7e1ff35852b1855bf21accce18fd6f20fedb253fa3115353b2f0e708d5da49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Release files / riff_api-0.4.2-py3-none-any.whl
| Download URL | riff_api-0.4.2-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4431fc6ac42fbf7954a36ca4a9e278e8c609ef0469d4ce3aa2b04fb0872c508f
|
|
BLAKE2b-256 checksum How to use checksums |
1dfe94f50d9891849ba20e2bdeaf42207e378da450aa910edec88757f28e8342
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Security for riff-api 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.