Music API (Music Generation)
The Music API provides AI music creation capabilities, supporting generation of original music compositions from text descriptions.
Endpoint
POST https://aiapi.services/vertex/v1/audio/generationsAuthentication
Authorization: Bearer YOUR_API_KEYSupported Models
Music Generation
lyria-002- Lyria 2nd generation, AI music composition and generation model
See Available Models for complete model list.
Request Parameters
Required Parameters
| Parameter | Type | Description |
|---|---|---|
prompt | string | Music description, including style, rhythm, instruments, mood, etc. |
model | string | Model ID, e.g., lyria-002 |
Optional Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
duration | number | 30 | Music duration (seconds), range: 10-120 |
temperature | number | 0.7 | Creative randomness (0-1) |
response_format | string | mp3 | Audio format: mp3, wav, flac |
Code Examples
cURL
curl https://aiapi.services/vertex/v1/audio/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "lyria-002",
"prompt": "Soothing piano jazz, lazy afternoon, warm sunshine",
"duration": 60
}'Related Resources
- Authentication - Learn how to get and use API keys
- Available Models - View all supported models and pricing
- Audio API - Speech recognition and text-to-speech
Last updated on