Generate Music
POST/music-generation/generate
Generate music based on style and parameters. NOTE: This is a Premium-only feature. Requires Premium subscription.
Authentication
Authorization: Bearer vm_sk_… with the media.write permission (or all.write). See Authentication. SDK: client.music.generate (Python), client.music.generate (Node).
Request body
application/json
| Field | Type | Description |
|---|---|---|
duration_seconds | integer | Duration in seconds |
instruments | InstrumentType[] | Instruments to include |
key_signature | string | Musical key (e.g., 'C major', 'A minor') |
loop | boolean | Make the track loopable |
mood | MusicMood | Desired mood |
parameters | object | Style-specific parameters |
reference_track_id | string | Reference track for style matching |
style* | MusicStyleone of electronic, ambient, pop, rock, jazz, classical, hip-hop, country, blues, reggae, folk, metal, r&b, latin, world, experimental | Music style |
tempo_bpm | integer | Tempo in BPM |
time_signature | string | Time signature (e.g., '4/4', '3/4') |
variation_amount | number | Amount of variation |
Response
200 application/json
| Field | Type | Description |
|---|---|---|
audio_url* | string | URL to download generated audio |
created_at* | string | |
credits_used* | integer | |
duration_seconds* | number | |
generation_time_ms* | integer | |
metadata* | TrackMetadata | Metadata for a generated track. |
midi_url | string | URL to MIDI file if available |
preview_url* | string | URL for streaming preview |
style* | MusicStyleone of electronic, ambient, pop, rock, jazz, classical, hip-hop, country, blues, reggae, folk, metal, r&b, latin, world, experimental | |
track_id* | string | Unique track ID |
waveform_url | string | URL to waveform visualization |
{
"audio_url": "string",
"created_at": "2026-12-05T10:00:00Z",
"credits_used": 0,
"duration_seconds": 0,
"generation_time_ms": 0,
"metadata": {
"complexity": 0,
"danceability": 0,
"duration_seconds": 0,
"energy_level": 0,
"instruments_detected": [
"string"
],
"key_signature": "string",
"mood_analysis": {},
"tempo_bpm": 0,
"time_signature": "string"
},
"preview_url": "string",
"style": "electronic",
"track_id": "string"
}Errors
401 | Missing, wrong, revoked or expired key. |
403 | The key lacks media.write, the route is not available to keys, or the key's IP allow-list refuses this client. |
402 | Not enough credits, or the key reached its spending cap. |
422 | The request failed validation; `detail` lists the fields. |
429 | Over a rate limit; retry after `Retry-After` seconds. |
All statuses: Errors.
Example
curl -X POST "https://api.voicemint.io/api/v1/music-generation/generate" \
-H "Authorization: Bearer $VOICEMINT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"style": "electronic"
}'