Example Request
curl -X POST https://aiplatform.googleapis.com/v1beta1/projects/{project}/locations/global/interactions \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "Api-Revision: 2026-05-20" \
-d '{
"model": "lyria-3-clip-preview",
"input": [
{
"type": "user_input",
"content": [
{
"type": "text",
"text": "Generate a music clip for this image."
},
{
"type": "image",
"data": "BASE64_ENCODED_IMAGE",
"mime_type": "image/png"
}
]
}
]
}'
from google import genai
from google.genai import types
client = genai.Client(vertexai=True, location='global')
interaction = client.interactions.create(
model="lyria-3-clip-preview",
input=[
types.Step(
type="user_input",
content=[
types.Part.from_text(text="Generate a music clip for this image."),
types.Part.from_bytes(
data=b"BASE64_ENCODED_IMAGE",
mime_type="image/png",
),
],
)
],
)
print(interaction.steps[-1].content[0].text)
import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({vertexai: true, location: 'global'});
const interaction = await ai.interactions.create({
model: 'lyria-3-clip-preview',
input: [
{
type: 'user_input',
content: [
{type: 'text', text: 'Generate a music clip for this image.'},
{type: 'image', data: 'BASE64_ENCODED_IMAGE', mime_type: 'image/png'},
],
},
],
});
console.log(interaction.steps.at(-1).content[0].text);