Skip to main content

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 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 schema
  • riff_api/examples/prompt - Examples for creating a song via the client, requests, and curl
  • riff_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)

Source distribution for riff-api 0.4.2
File Size Uploaded
riff_api-0.4.2.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for riff-api 0.4.2
File Interpreter ABI Platform
riff_api-0.4.2-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page