Music Generation
https://api.oneinfer.ai/v1/ula/generate-musicGenerate music from text prompts and lyrics using Google Lyria or ElevenLabs Music. Supports JSON and multipart/form-data for supported reference uploads.
Request headers
AuthorizationstringrequiredBearer token for authentication. Format: Bearer <YOUR_TOKEN>. Exchange your API key for a token via the Authentication endpoint.
Content-Typestringrequiredapplication/json or multipart/form-data (use multipart when uploading supported reference images).
Request parameters
providerstringLeave it out: OneInfer picks the provider that serves the model, and the response names it.
modelstringrequiredUse google/lyria-3 (MP3 only, no images) or google/lyria-3.5 (MP3/WAV and up to 10 reference images).
promptstringrequiredDescribe the music. Lyrics and instrumental instructions are added to this prompt.
streambooleanMust be false. Google music is non-streaming.
lyricsstringCustom lyrics are added to the generation prompt.
audio_settingobjectformat: mp3 only. Sample-rate and bitrate controls are not forwarded.
is_instrumentalbooleanRequest an instrumental track without vocals.
Example request
{
"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.