Lyria Music Generation
curl --request POST \
--url https://api.mixroute.ai/v1/models/lyria-3.5:generateContentimport requests
url = "https://api.mixroute.ai/v1/models/lyria-3.5:generateContent"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.mixroute.ai/v1/models/lyria-3.5:generateContent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixroute.ai/v1/models/lyria-3.5:generateContent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mixroute.ai/v1/models/lyria-3.5:generateContent"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixroute.ai/v1/models/lyria-3.5:generateContent")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/v1/models/lyria-3.5:generateContent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyAudio and Realtime
Lyria Music Generation
Lyria accepts a music prompt, not speech synthesis instructions. For this model put lyria-3.5 in the URL and submit contents[].parts[].text. Describe instruments, vocals, style and desired duration in the prompt; duration is not a fixed seconds field.
Lyria Music Generation
curl --request POST \
--url https://api.mixroute.ai/v1/models/lyria-3.5:generateContentimport requests
url = "https://api.mixroute.ai/v1/models/lyria-3.5:generateContent"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.mixroute.ai/v1/models/lyria-3.5:generateContent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixroute.ai/v1/models/lyria-3.5:generateContent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mixroute.ai/v1/models/lyria-3.5:generateContent"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixroute.ai/v1/models/lyria-3.5:generateContent")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/v1/models/lyria-3.5:generateContent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyUse a MixRoute API key and the exact model ID in the request path. This guide describes MixRoute’s GenerateContent request format.
Read
POST /v1/models/lyria-3.5:generateContent
Model ID
lyria-3.5
Request and response
Lyria accepts a music prompt, not speech synthesis instructions. For this model putlyria-3.5 in the URL and submit contents[].parts[].text. Describe instruments, vocals, style and desired duration in the prompt; duration is not a fixed seconds field.
curl --request POST 'https://api.mixroute.ai/v1/models/lyria-3.5:generateContent' \
--header "Authorization: Bearer $MIXROUTE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"text": "Create a short instrumental piano track. No vocals."
}
],
"role": "user"
}
]
}'
candidates[].content.parts[].inlineData.data for Base64 audio and inspect mimeType before saving. A response without audio is not a successfully generated track.
Availability and supported fields depend on your MixRoute route. Check the model page before assuming that streaming or a different request format is available.
Interactions API
POST /v1beta/interactions
Use the Interactions payload below, not the GenerateContent contents body. Check that the response contains audio data before saving it.
curl --request POST 'https://api.mixroute.ai/v1beta/interactions' \
--header "Authorization: Bearer $MIXROUTE_API_KEY" \
--header 'Content-Type: application/json' \
--header 'Api-Revision: 2026-05-20' \
--data '{"model":"lyria-3.5","input":"A short solo piano jingle. No vocals."}'