Skip to content
VoiceMint Developers

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

FieldTypeDescription
duration_secondsintegerDuration in seconds
instrumentsInstrumentType[]Instruments to include
key_signaturestringMusical key (e.g., 'C major', 'A minor')
loopbooleanMake the track loopable
moodMusicMoodDesired mood
parametersobjectStyle-specific parameters
reference_track_idstringReference track for style matching
style*MusicStyle
one of electronic, ambient, pop, rock, jazz, classical, hip-hop, country, blues, reggae, folk, metal, r&b, latin, world, experimental
Music style
tempo_bpmintegerTempo in BPM
time_signaturestringTime signature (e.g., '4/4', '3/4')
variation_amountnumberAmount of variation

Response

200 application/json

FieldTypeDescription
audio_url*stringURL to download generated audio
created_at*string
credits_used*integer
duration_seconds*number
generation_time_ms*integer
metadata*TrackMetadataMetadata for a generated track.
midi_urlstringURL to MIDI file if available
preview_url*stringURL for streaming preview
style*MusicStyle
one of electronic, ambient, pop, rock, jazz, classical, hip-hop, country, blues, reggae, folk, metal, r&b, latin, world, experimental
track_id*stringUnique track ID
waveform_urlstringURL 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

401Missing, wrong, revoked or expired key.
403The key lacks media.write, the route is not available to keys, or the key's IP allow-list refuses this client.
402Not enough credits, or the key reached its spending cap.
422The request failed validation; `detail` lists the fields.
429Over 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"
}'