What is an AI music generation API?

An AI music generation API composes audio from a text description of the style, mood, instruments and tempo, and on some models from lyrics, a reference recording or a video to score. You submit a job, poll until it finishes, and download the generated track.

Model types

What an AI music generation API does

A music generation API creates new audio from a description. A prompt names the genre, mood, instruments and tempo, for example lo-fi hip hop, mellow piano, 90 BPM, and the model returns a finished track. Depending on the model, it can do more:

  • Songs with vocals. You supply lyrics, often marked with section tags such as [Verse] and [Chorus], and the model sings them. An instrumental setting produces a track without vocals.
  • Soundtracks for video. Some models score a video you supply, following its cuts and pacing, or place sound effects on the action.
  • Work from existing audio. Some models transform a reference clip, regenerate one section of it, or build a cover or an arrangement from a song or a vocal recording.
  • Sound effects. Several models also generate sound effects from a description.

How a request works

You send POST /v1/audio/generations with the model ID, the prompt and the settings the model accepts, such as lyrics, duration, seed and the output format (MP3, WAV, FLAC and others). Every request returns a job_id at once. Poll GET /v1/jobs/{job_id} until the status is completed, then download the track from the URL in the result. A model that scores a video can also return the finished video with its new soundtrack, through the video generation endpoint.

What music generation is used for

  • Background music for videos, ads, podcasts, streams and apps.
  • Scores for footage that follow the edit of a specific video.
  • Song drafts to test lyrics, melodies and arrangements.
  • Game and app audio, such as short cues and sound effects.
  • Variations of one theme for tests or for several cuts of a campaign.

What to compare between music models

  • Vocals and lyrics. Whether the model sings, follows section tags and handles the languages you need.
  • Length. The maximum track length differs by model, from short clips to several minutes, and some models choose the length themselves.
  • Audio quality. Stereo output, sample rate, and lossless or uncompressed formats such as FLAC and WAV.
  • Inputs. Text only, or also reference audio and video.
  • Repeatability. On models that accept a seed, the same seed and settings reproduce a result.
  • Price. Many models bill per second of generated audio, some with a minimum length per track, and others bill a flat rate per track whatever its length. With per-second billing, a 3-minute track costs three times as much as a 1-minute track.

Side-by-side model comparisons show two models' capabilities and rates together.

Try and call a music model on EmpirioLabs AI

Browse the audio models and generate a track in the Playground. To call a model from code, create an API key in the dashboard, submit the job to https://api.empiriolabs.ai/v1/audio/generations and poll the jobs endpoint. The music and sound generation reference describes the request and the job flow.

Pay as you go, or choose a plan with weekly allowances. Current rates are on the pricing page.

The models on EmpirioLabs AI

9 models, cheapest first where they share a billing unit. Each model's page has its full rate card, parameters and code.

Endpoints

POST /v1/audio/generations

Priced per second

ModelLowest rateApplies to
ACE-Step 1.5 XL ACE-Step$0.0003$0.00025 per generated secondMusic generation
StepAudio 3 Music StepFun$0.000667 per generated secondText to music
MiniMax Music 3 MiniMax$0.002$0.0018 per generated secondMusic generation
Sonilo Sound Effects 1.0 Sonilo$0.0036 per generated secondText to sound effect
Sonilo v1.1 Sonilo$0.0045 per generated secondText to music

Also available: Stable Audio 2.0, Stable Audio 2.5, Sonilo Video to Video, Stable Audio 3 Medium

Frequently asked questions

Can an AI music API generate songs with vocals?

Yes, on models that sing. You supply lyrics, usually marked with section tags such as [Verse] and [Chorus], and a prompt for the style. Other models generate instrumental music and sound only.

How long can an AI-generated track be?

It depends on the model: limits range from short clips to several minutes per track. Some models let you set the duration, and others choose it themselves.

Can AI generate music that matches a video?

Yes. Some models take a video as input and generate a soundtrack that follows its cuts and pacing, or place sound effects on the action.

How is AI music generation priced?

Many models bill per second of generated audio, so longer tracks cost more, while others bill a flat rate per track. On EmpirioLabs AI you can pay as you go or choose a plan with weekly allowances.

Ready to use better endpoints?

Check out our pricing or reach out if you want your own model deployed on our stack.