Music Generation

POSThttps://api.oneinfer.ai/v1/ula/generate-music

Generate music from text prompts and lyrics using Google Lyria or ElevenLabs Music. Supports JSON and multipart/form-data for supported reference uploads.

Request headers

Authorizationstringrequired

Bearer token for authentication. Format: Bearer <YOUR_TOKEN>. Exchange your API key for a token via the Authentication endpoint.

Content-Typestringrequired

application/json or multipart/form-data (use multipart when uploading supported reference images).

Request parameters

providerstring

Leave it out: OneInfer picks the provider that serves the model, and the response names it.

modelstringrequired

Use google/lyria-3 (MP3 only, no images) or google/lyria-3.5 (MP3/WAV and up to 10 reference images).

promptstringrequired

Describe the music. Lyrics and instrumental instructions are added to this prompt.

streamboolean

Must be false. Google music is non-streaming.

lyricsstring

Custom lyrics are added to the generation prompt.

audio_settingobject

format: mp3 only. Sample-rate and bitrate controls are not forwarded.

is_instrumentalboolean

Request an instrumental track without vocals.

Example request

JSON
{
  "model": "google/lyria-3",
  "stream": false,
  "prompt": "A calm piano track with soft strings",
  "is_instrumental": true,
  "audio_setting": {
    "format": "mp3"
  }
}

Multipart input

Send scalar fields as form values and composition_plan, images, or audio_setting as JSON strings. Alternatively put the full request JSON in music_request_json and append files. endpoint_id is unsupported for music.

Response

Non-streaming requests return the standard API envelope with data.audios, usage and optional provider_metadata. Streaming returns audio bytes; detailed ElevenLabs streaming returns newline-delimited JSON events with audio_base64 and metadata. Invalid model-specific combinations return HTTP 422. Only enabled models with configured pricing can execute; listing a model here does not enable it.

Response

202 - application/json