OP Inference

Music

Generate music from a description, with or without lyrics.

POST /v1/audio/music submits a music job. It answers 202 with a job; see How media jobs work for polling and output.

curl https://api.opinference.com/v1/audio/music \
  -H "Authorization: Bearer $OP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "ace-step/ace-step-v1-3.5b",
    "prompt": "Calm lo-fi piano loop",
    "duration_seconds": 30
  }'

Inputs

InputMeaning
promptStyle, mood and instruments
lyricsWords to sing, where the model can
duration_secondsLength of the track

The model's page at opinference.com/models lists its inputs and ranges.

Output

One audio file in output[]. Music is usually priced per second of audio, and usage.units.audio_seconds counts them.

On this page