Developer API v1.1
Build with the SoundGen API. Generation, stems, voices, MIDI, and collaboration — one RESTful API.
Integrate AI-powered music generation, stem separation, voice cloning, MIDI export, and real-time collaboration into your applications.
Sound Library
1000+ AI sounds
AI Generation
Text to music
Stem Separation
Isolate tracks
Voice Cloning
Custom voices
Overview
The SoundGen API (v1.1) provides programmatic access to our AI music generation platform. Use it to generate custom music, access our sound library, separate stems from audio files, create custom voice clones, import/export MIDI, and manage collaborative projects with version branching, track locking, and timeline comments.
API Endpoints
Max Sample Rate
Separable Stems
Import/Export
https://soundgen.ai/api/api-v1Authentication
Most endpoints require authentication using an API key. Include your API key in theAuthorizationheader.
Request Header
Authorization: Bearer YOUR_API_KEYKeep your API key secure
Never expose your API key in client-side code. Use environment variables and server-side requests. Create keys in Settings → Integrations → API Keys (it asks for your current password, and every new key is announced by email): a key is shown once, when it is created, because SoundGen stores only its SHA-256. If one leaks or is lost, delete it there (that revokes it at once) and create another.
Public Endpoints
No authentication required:
- • GET /sounds
- • GET /genres
- • GET /stats
- • GET /projects
- • GET /voices
Protected Endpoints
API key required:
- • POST /generate
- • POST /stems
- • POST /clone
- • POST /synthesize
- • GET /generations
Sounds
/soundsRetrieve a paginated list of publicly published sounds. Private sounds are never returned, even to their owner — this endpoint serves the public catalogue only.
Parameters
limitnumberNumber of sounds to return (max 100)(default: 20)offsetnumberPagination offset(default: 0)genrestringFilter by genre (e.g., 'electronic', 'ambient')featuredbooleanReturn only featured soundssearchstringSearch in title, artist, and descriptionExample Request
curl "https://soundgen.ai/api/api-v1/sounds?limit=10&genre=electronic"Response
{
"success": true,
"data": {
"sounds": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Cosmic Wave",
"artist": "AI Producer",
"genre": "electronic",
"bpm": 128,
"key": "Am",
"duration": 180,
"file_url": "https://...",
"thumbnail_url": "https://...",
"tags": ["synth", "ambient"],
"like_count": 42,
"download_count": 156,
"is_featured": true,
"is_free": true,
"created_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"limit": 10,
"offset": 0,
"total": 150
}
}
}/sounds/{id}Retrieve a single publicly published sound by its ID. Private sounds return 404.
Parameters
iduuidThe unique sound identifierExample Request
curl "https://soundgen.ai/api/api-v1/sounds/550e8400-e29b-41d4-a716-446655440000"Response
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Cosmic Wave",
"artist": "AI Producer",
"genre": "electronic",
"bpm": 128,
"key": "Am",
"duration": 180,
"file_url": "https://...",
"thumbnail_url": "https://...",
"waveform_url": "https://...",
"description": "An atmospheric electronic track...",
"tags": ["synth", "ambient"],
"like_count": 42,
"download_count": 156,
"is_featured": true,
"is_free": true,
"created_at": "2024-01-15T10:30:00Z"
}
}/genresGet a list of all available genres
Example Request
curl "https://soundgen.ai/api/api-v1/genres"Response
{
"success": true,
"data": {
"genres": ["ambient", "cinematic", "electronic", "hip-hop", "jazz", "rock"],
"count": 6
}
}/statsGet platform statistics
Example Request
curl "https://soundgen.ai/api/api-v1/stats"Response
{
"success": true,
"data": {
"total_sounds": 1250,
"total_projects": 450,
"top_genres": [
{ "genre": "electronic", "count": 320 },
{ "genre": "ambient", "count": 180 }
],
"api_version": "v1",
"last_updated": "2024-01-15T10:30:00Z"
}
}AI Generation
Generate music or sound effects from text prompts. A generation runs to completion and the call answers with the finished track; send your own request_id so a dropped connection can be recovered with the same id instead of generating (and paying) twice.
/generateGenerate music (ElevenLabs Music) or a sound effect from a text prompt, as the API key's owner — the same run as the generate_audio MCP tool. Runs to completion (one to three minutes) and answers with the finished track (status "completed"; or "not_stored" with a warning and no audio_url when it generated but could not be saved, which is not charged). Music costs about 38 credits per minute (20 for 30 s, tapering with length); a sound effect 5. Charged only when audio comes back. Every request has a request_id (send your own UUID, in the body or an Idempotency-Key header, to make retries safe): re-sending the same id never generates or charges twice — it returns the first result (recovered: true). If the outcome is unknown (your connection dropped, or the id is still running) the answer is 202 with status "unresolved" and a poll_url; read that rather than starting a new request. There are no webhooks: webhook_url is refused with 400 WEBHOOKS_UNSUPPORTED.
Parameters
promptstringThe sound: style, genre, mood, instrumentation. Not the lyricskindstring"music" or "sound-effects"(default: music)durationnumberSeconds: music 3-300, sound effects 0.5-22; outside the range is 400 INVALID_DURATION(default: 30 (music), 5 (sound effects))bpmnumberTempo, 20-400, written into the briefkeystringMusical key, e.g. "A minor"genrestringGenre, written into the briefmoodstringMood, written into the brieflyricsstringExact words to sing; omit to let the model write its owninstrumentalbooleanForce no vocals (ignored when lyrics are given)titlestringTitle for the track (defaults to the prompt's start)request_idstringUUID identifying this request (or send it as the Idempotency-Key header); generated and returned when omittedmusiciansstring[]Up to 4 AI musician ids (GET /musicians): their style, feel and skills are briefed into the take — never their names — and they are credited on it. Your own, published, or shared with your team.Example Request
curl -X POST "https://soundgen.ai/api/api-v1/generate" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"prompt": "upbeat electronic track with synth arpeggios",
"duration": 60,
"bpm": 128,
"genre": "electronic"
}'Response
{
"success": true,
"data": {
"generation_id": "7d0f3c1e-…",
"request_id": "0b6c2f9a-…",
"status": "completed",
"audio_url": "https://…",
"duration": 60,
"title": "upbeat electronic track with synth arpeggios",
"credits_charged": 38
}
}
// A retry with the same request_id returns this same result with
// "recovered": true and "credits_charged": 0 (the first call was charged).
// 202 — outcome unknown; poll, do not start a new request
{
"success": true,
"data": {
"request_id": "0b6c2f9a-…",
"status": "unresolved",
"poll_url": "https://soundgen.ai/api/api-v1/generations?request_id=0b6c2f9a-…",
"message": "…"
}
}
// 402 — too few credits; nothing charged
{
"success": false,
"error": { "code": "INSUFFICIENT_CREDITS", "message": "…", "request_id": "0b6c2f9a-…" }
}/tools/edit_songExtend one of your finished ElevenLabs songs, or rewrite one section of it, keeping the rest note-for-note. The result is a new generation; the original is unchanged. Priced on the song's length plus the result's, each at the music rate (about 38 credits per minute, tapering with length; results up to 10 minutes). Charged only when audio comes back; a refusal before work starts (bad range, not editable, too few credits) charges nothing. Stable Audio songs and uploads cannot be edited. Runs to completion; if the connection drops, read get_generation with the same request_id rather than retrying under a new one. Also the edit_song MCP tool.
Parameters
generation_idstringThe song to edit (from generate_audio or list_generations)modestring"extend" or "replace" (rewrite a section)extend_secondsnumberextend: seconds of new music (3-120)positionstringextend: "start" or "end"(default: end)start_secondsnumberreplace: section start, seconds from the song's startend_secondsnumberreplace: section end; the span must be 3-120 spromptstringWhat the new part should sound like; defaults to the song's own stylelyricsstringOptional words for the new partrequest_idstringUUID; generated when omitted. Reuse it to recover, never to start a second editExample Request
curl -X POST "https://soundgen.ai/api/api-v1/tools/edit_song" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{ "generation_id": "GENERATION_UUID", "mode": "extend", "extend_seconds": 30, "prompt": "an outro that fades on the hook" }'Response
{
"success": true,
"data": {
"generation_id": "7d0f3c1e-…",
"source_generation_id": "GENERATION_UUID",
"request_id": "0b6c2f9a-…",
"status": "completed",
"audio_url": "https://…",
"duration": 150,
"credits_charged": 151
}
}/generationsYour generation history, newest first — only the API key owner's rows. With request_id, the one generation started with that id (the way to recover a POST /generate whose connection dropped); 404 there means it never reached the server, so re-sending it with the same request_id is safe. status "pending" means claimed with no recorded outcome yet: not a failure, and not known to be charged or free.
Parameters
limitnumberResults per page (1-100)(default: 20)offsetnumberPagination offset(default: 0)statusstringFilter: pending, completed or failedrequest_idstringReturn the one generation started with this UUIDExample Request
curl "https://soundgen.ai/api/api-v1/generations?limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"success": true,
"data": {
"generations": [
{
"id": "7d0f3c1e-…",
"request_id": "0b6c2f9a-…",
"type": "music",
"model": "elevenlabs-music",
"status": "completed",
"prompt": "upbeat electronic track",
"title": "upbeat electronic track",
"audio_url": "https://…",
"duration": 60,
"parameters": { "genre": "electronic", "bpm": 128, "instrumental": false, "has_lyrics": false },
"credits_charged": 38,
"error": null,
"created_at": "2026-11-07T10:30:00Z",
"updated_at": "2026-11-07T10:31:12Z"
}
],
"pagination": { "limit": 10, "offset": 0, "total": 25 }
}
}/generations/{id}One of your generations by its generation_id, in the same shape as the list. audio_url is set only when status is completed; error only when failed; credits_charged is null while pending. Another user's id is 404.
Parameters
idstringThe generation_id (a UUID)Example Request
curl "https://soundgen.ai/api/api-v1/generations/GENERATION_UUID" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"success": true,
"data": {
"id": "GENERATION_UUID",
"request_id": "0b6c2f9a-…",
"type": "music",
"model": "elevenlabs-music",
"status": "failed",
"prompt": "upbeat electronic track",
"title": "upbeat electronic track",
"audio_url": null,
"duration": 60,
"parameters": { "genre": "electronic" },
"credits_charged": 0,
"error": "…",
"created_at": "2026-11-07T10:30:00Z",
"updated_at": "2026-11-07T10:30:40Z"
}
}Stem Separation
Separate audio files into individual stems: vocals, drums, bass, and more. Powered by AI-based source separation technology.
Available Stems
/stemsSeparate an audio file into stems with Demucs. Synchronous: the reply carries the finished stems (a long song can take a few minutes). Asking for piano or guitar runs the deep six-source model. The drum parts (kick, snare, toms, hihat, cymbals) are accepted, but the drum split is not switched on: they come back as the whole drums stem, with deepCascadeApplied false. Costs 6 credits (deep 9), charged only when stems come back; the balance is checked first (402 INSUFFICIENT_CREDITS, nothing run). creditsCharged in the reply is what was taken; creditChargeError means the debit did not go through and is collected later — do not pay it another way. Send an Idempotency-Key header (a UUID) to make a retry safe: the same key returns the first result without running or charging again, and answers 409 REQUEST_IN_PROGRESS while the first attempt is still running.
Parameters
audio_urlstringPublic http(s) URL of the audio file to processrequest_idstringYour id for this request (a UUID; or send it as the Idempotency-Key header). A retry with the same id returns the first stemsstemsarrayWhich stems to extract: vocals, drums, bass, other, piano, guitar (kick, snare, toms, hihat and cymbals are accepted and return the whole drums stem)(default: ["vocals", "drums", "bass", "other"])qualitystringfast, standard or high(default: "standard")Example Request
curl -X POST "https://soundgen.ai/api/api-v1/stems" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"audio_url": "https://example.com/song.mp3",
"stems": ["vocals", "drums", "bass", "other"]
}'Response
{
"success": true,
"data": {
"success": true,
"jobId": "6f1c2a9e-1b2d-4c5e-9f3a-7d8e9f0a1b2c",
"status": "completed",
"stems": {
"vocals": { "url": "https://…/vocals.wav", "duration": null },
"drums": { "url": "https://…/drums.wav", "duration": null },
"bass": { "url": "https://…/bass.wav", "duration": null },
"other": { "url": "https://…/other.wav", "duration": null }
},
"message": "AI-powered stem separation completed using Demucs.",
"processingTime": 41.2,
"isDemo": false,
"mode": "standard",
"deepCascadeApplied": false,
"persisted": true,
"billing": "server",
"creditsCharged": 6
}
}/tools/transcribe_speechSpeech or sung lyrics to text (ElevenLabs Scribe), with timed lines and words. Billed by length, about 2 credits per minute (1 minimum), only when a transcript comes back. Up to 60 minutes. Also the transcribe_speech MCP tool.
Parameters
audio_urlstringHosted URL of the audioduration_secnumberLength in seconds (quotes the charge); measured when omittedlanguage_codestringISO 639-1/3 code; omitted = auto-detectdiarizebooleanLabel speakers(default: false)tag_audio_eventsbooleanInclude (laughter)-style event tags in the text(default: false)request_idstringUUID; reuse it on retry so the charge is not taken twiceExample Request
curl -X POST "https://soundgen.ai/api/api-v1/tools/transcribe_speech" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{ "audio_url": "https://example.com/vocal.wav" }'Response
{
"success": true,
"data": {
"text": "Hold on to me. Never let go",
"languageCode": "en",
"durationSec": 180,
"lines": [
{ "text": "Hold on to me.", "start": 0.5, "end": 1.6 },
{ "text": "Never let go", "start": 3.2, "end": 4.2 }
],
"words": [
{ "text": "Hold", "start": 0.5, "end": 0.8 }
],
"creditsCharged": 6,
"billing": "server"
}
}Voice Cloning
Create custom AI voices from audio samples, or use our pre-built voices for text-to-speech synthesis.
/voicesList the voices you can synthesize with: ElevenLabs' stock voices plus the ones you cloned. Free.
Example Request
curl "https://soundgen.ai/api/api-v1/voices" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"success": true,
"data": {
"voices": [
{ "voice_id": "21m00Tcm4TlvDq8ikWAM", "name": "Rachel", "category": "premade", "description": null, "preview_url": "https://…/preview.mp3", "labels": {} },
{ "voice_id": "Xb7hH8MSUJpSbSDYk0k2", "name": "My Voice", "category": "cloned", "description": "Custom voice for narration", "preview_url": null, "labels": { "soundgen_owner": "your-user-id" } }
],
"count": 2
}
}/cloneClone a voice (ElevenLabs instant voice clone) from audio you stored with SoundGen. Synchronous: the voice is ready when the reply arrives. Costs 30 credits, charged only when the voice is created; the balance is checked first (402 INSUFFICIENT_CREDITS). Send an Idempotency-Key header (a UUID) to make a retry safe: the same key returns the first result without running or charging again, and answers 409 REQUEST_IN_PROGRESS while the first attempt is still running.
Parameters
namestringName for the cloned voiceaudio_urlsarray1-25 URLs of audio stored with SoundGen (your uploads or recordings, or published sounds)descriptionstringOptional descriptionlabelsobjectOptional string labels kept on the voiceExample Request
curl -X POST "https://soundgen.ai/api/api-v1/clone" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"name": "My Voice",
"audio_urls": ["https://…/sounds/voice-samples/your-user-id/take-1.webm"],
"description": "Custom voice for narration"
}'Response
{
"success": true,
"data": {
"voice_id": "Xb7hH8MSUJpSbSDYk0k2",
"name": "My Voice",
"description": "Custom voice for narration",
"status": "ready",
"sample_count": 1,
"credits_charged": 30
}
}/synthesizeSpeak text in a stock voice or one you cloned. Synchronous: the reply carries the finished MP3 as audio_url, a signed link (about an hour) to the copy stored in your SoundGen storage. Costs 6 credits per request, charged only when audio comes back; the balance is checked first (402 INSUFFICIENT_CREDITS). credit_charge_error means the debit did not go through and is collected later. Send an Idempotency-Key header (a UUID) to make a retry safe: the same key returns the first result without running or charging again, and answers 409 REQUEST_IN_PROGRESS while the first attempt is still running.
Parameters
textstringText to synthesize (max 5000 chars)voice_idstringA voice_id from GET /voicesspeednumber0.7-1.2 (clamped)(default: 1)stabilitynumber0-1(default: 0.5)similarity_boostnumber0-1(default: 0.75)output_formatstringmp3 only(default: mp3)Example Request
curl -X POST "https://soundgen.ai/api/api-v1/synthesize" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"text": "Welcome to SoundGen, your AI music creation platform.",
"voice_id": "21m00Tcm4TlvDq8ikWAM"
}'Response
{
"success": true,
"data": {
"synthesis_id": "4b7e1f0c-2a3d-4e5f-8a9b-0c1d2e3f4a5b",
"status": "completed",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"text_length": 52,
"output_format": "mp3",
"content_type": "audio/mpeg",
"bytes": 61440,
"audio_url": "https://…/audio/voice/your-user-id/4b7e1f0c-….mp3?…",
"credits_charged": 6
}
}Projects
Access public projects created on SoundGen, including their tracks, settings, and metadata.
/projectsList public projects
Parameters
limitnumberNumber of results(default: 20)offsetnumberPagination offset(default: 0)Example Request
curl "https://soundgen.ai/api/api-v1/projects?limit=10"Response
{
"success": true,
"data": {
"projects": [
{
"id": "proj_abc123",
"name": "Summer Vibes EP",
"description": "A collection of summer-themed tracks",
"bpm": 120,
"key": "C",
"duration": 180,
"tags": ["summer", "electronic"],
"thumbnail_url": "https://...",
"is_public": true,
"created_at": "2024-01-15T10:30:00Z"
}
],
"pagination": { "limit": 10, "offset": 0, "total": 25 }
}
}/projects/{id}Get details of a public project
Parameters
iduuidThe project IDExample Request
curl "https://soundgen.ai/api/api-v1/projects/550e8400-e29b-41d4-a716-446655440000"Response
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Summer Vibes EP",
"description": "A collection of summer-themed tracks",
"bpm": 120,
"key": "C",
"duration": 180,
"tags": ["summer", "electronic"],
"thumbnail_url": "https://...",
"tracks": [...],
"settings": {...},
"is_public": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T12:00:00Z"
}
}AI Audio Processing
One endpoint fronts every AI audio operation — mixing, mastering, chord and tempo detection, stem work, sound design and more. Pick the operation with theactionfield.
/ai-processRun one of the AI audio operations over a track. The `action` field selects which; everything else in the body is forwarded to that operation. Removed actions (`audio-upscale`, `reference-match`) answer 410 with code ACTION_REMOVED and what replaced them.
Parameters
actionstringOne of: auto-mix, mastering, chord-detection, melody-extraction, melody-continuation, lyrics-generation, vocal-tuning, noise-removal, beat-match, arrangement-suggest, fill-generation, sound-design, vocal-harmonize, prompt-to-loop, text-to-sfx, instrument-separation, tempo-key-detectionaudio_urlstringSource audio for operations that transform a fileExample Request
curl -X POST "https://soundgen.ai/api/api-v1/ai-process" \
-H "Authorization: Bearer $SOUNDGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action":"mastering","audio_url":"https://..."}'Response
{
"success": true,
"data": {
"action": "mastering",
"output_url": "https://...",
"credits_charged": 4
}
}AI Musicians
Persistent AI performer profiles — a drummer with a feel, a bassist with a style — that you can reuse across projects. Every request is scoped to the authenticated caller.
/musiciansList your AI musicians. Always scoped to the authenticated caller — a user_id in the request is ignored.
Example Request
curl "https://soundgen.ai/api/api-v1/musicians" -H "Authorization: Bearer $SOUNDGEN_API_KEY"Response
{
"success": true,
"data": {
"musicians": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Session Drummer",
"role": "drummer",
"style": "neo-soul",
"personality": "laid back, behind the beat",
"skills": ["ghost notes", "brushes"],
"profile": { "groove": "swung", "swing": 62 },
"is_active": true,
"collaborations": 4,
"brief": "Drums: neo-soul style; swung groove; plays behind the beat, relaxed; ghost notes; brushes.",
"created_at": "2024-01-15T10:30:00Z"
}
]
}
}/musiciansCreate an AI musician. Only `name` and `role` are required; every other field shapes what it plays. The response includes `brief` — the text it adds to a generation (pass its id in POST /generate `musicians`). At most 50 per account, 30 created per hour.
Parameters
namestringDisplay namerolestringsinger, drummer, bassist, guitarist, synth, producer, mixer or mastering ("Vocalist", "Sound designer" and similar map to the nearest)descriptionstringFree-text briefstylestringGenre or stylistic leaningpersonalitystringHow they play — feel, dynamics, tendenciesskillsstring[]Specific techniques (up to 20)profileobjectMusical settings: traits[], genres[] (genre ids), tempoMin/tempoMax, keys[], swing (MPC % 50–75), complexity 1–5, humanize 0–1, groove, bassStyle, voicing, synthRecipe, lyricThemes, rhyme, vocabulary, mixTemplate, masterLufs, masterTone, arrangement, avoid. Unknown keys are dropped; values are clamped.is_activebooleanOn stage: offered in the app's Generate picker(default: true)Example Request
curl -X POST "https://soundgen.ai/api/api-v1/musicians" \
-H "Authorization: Bearer $SOUNDGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Session Drummer","role":"drummer","style":"neo-soul"}'Response
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Session Drummer",
"role": "drummer",
"style": "neo-soul",
"is_active": true,
"created_at": "2024-01-15T10:30:00Z"
}
}/musicians/{id}Fetch one AI musician. Returns 404 if it exists but belongs to someone else.
Parameters
idstringMusician UUIDExample Request
curl "https://soundgen.ai/api/api-v1/musicians/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer $SOUNDGEN_API_KEY"Response
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Session Drummer",
"role": "drummer",
"style": "neo-soul",
"is_active": true,
"created_at": "2024-01-15T10:30:00Z"
}
}/musicians/{id}Update an AI musician (PATCH or PUT). Ownership is verified first — editing someone else's musician returns 403. `id`, `user_id` and the use counters in the body are ignored. Each content edit keeps the previous version in the musician's history.
Parameters
idstringMusician UUID (in the path)namestringDisplay namerolestringOne of the eight rolesstylestringGenre or stylistic leaningpersonalitystringFeel, dynamics, tendenciesskillsstring[]Specific techniquesprofileobjectMerged into the existing profileis_activebooleanOn stageis_publicbooleanfalse unpublishes. To publish use POST /musicians/{id}/publish (reviewed first) — true here answers 409 REVIEW_REQUIRED. Editing a published musician takes it down until it is reviewed again.team_idstring | nullShare with a team you are in; null stopsExample Request
curl -X PATCH "https://soundgen.ai/api/api-v1/musicians/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer $SOUNDGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"style":"hard bop"}'Response
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Session Drummer",
"style": "hard bop",
"is_active": true
}
}/musicians/{id}Delete an AI musician (DELETE). Ownership is verified first; 403 if it isn't yours. Soft: `POST /musicians/{id}/restore` brings it back.
Parameters
idstringMusician UUID (in the path)Example Request
curl -X DELETE "https://soundgen.ai/api/api-v1/musicians/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer $SOUNDGEN_API_KEY"Response
{
"success": true,
"data": { "id": "550e8400-e29b-41d4-a716-446655440000", "restore": "/musicians/550e8400-e29b-41d4-a716-446655440000/restore" }
}/musicians/{id}/restoreBring back a musician you deleted. Refused when your band is already at 50.
Parameters
idstringMusician UUID (in the path)Example Request
curl -X POST "https://soundgen.ai/api/api-v1/musicians/550e8400-e29b-41d4-a716-446655440000/restore" \
-H "Authorization: Bearer $SOUNDGEN_API_KEY"Response
{
"success": true,
"data": { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Session Drummer", "deleted_at": null }
}/musicians/{id}/publishPublish a musician to the community, or unpublish it with public: false. Publishing is reviewed first (impersonating a real person, hate, sexual content, personal data, spam); a refusal is a 200 with approved: false and the reason. 503 REVIEW_UNAVAILABLE when the review can't run — nothing is published. 20 reviews per 10 minutes. Editing a published musician takes it down until it is published again.
Parameters
idstringMusician UUID (in the path)publicbooleantrue to publish (reviewed), false to unpublishExample Request
curl -X POST "https://soundgen.ai/api/api-v1/musicians/550e8400-e29b-41d4-a716-446655440000/publish" \
-H "Authorization: Bearer $SOUNDGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"public":true}'Response
{
"success": true,
"data": {
"approved": false,
"reason": "Presents itself as a real, named artist.",
"musician": { "id": "550e8400-e29b-41d4-a716-446655440000", "is_public": false, "moderation_status": "rejected" }
}
}Account & Credits
Check the credit balance an API key draws against before running a paid operation.
/creditsRead the authenticated caller's credit balance and lifetime usage.
Example Request
curl "https://soundgen.ai/api/api-v1/credits" -H "Authorization: Bearer $SOUNDGEN_API_KEY"Response
{
"success": true,
"data": {
"balance": 250,
"lifetime_used": 1310
}
}Studio Tools — make music over HTTP
Every MCP tool is also a REST call: tracks and instruments, measured audio clips, MIDI clips in bars and beats, notes, AI-composed parts, inserts one at a time, the master bus and automation. GET /toolslists each with its JSON schema; batch many edits into one atomic save withPOST /projects/{id}/edits.
/toolsEvery studio/MCP tool with its description and JSON input schema — the same operations the MCP server offers. GET /tools/{name} returns one.
Example Request
curl "https://soundgen.ai/api/api-v1/tools" -H "Authorization: Bearer $SOUNDGEN_API_KEY"Response
{
"success": true,
"data": {
"count": 82,
"tools": [
{ "name": "add_track", "description": "Append a track to a project…", "inputSchema": { "type": "object", "properties": { … } } }
]
}
}/tools/{name}Run one tool as the key's owner; the body is the tool's arguments. Audio placed with add_clip is measured by the server (WAV/MP3), so clips are exactly as long as their files. A refusal answers 422 with the tool's explanation; 409 when the project changed since it was read.
Parameters
namestringTool name, e.g. add_track, add_midi_clip, add_effectExample Request
curl -X POST "https://soundgen.ai/api/api-v1/tools/add_midi_clip" \
-H "Authorization: Bearer $SOUNDGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"project_id":"…","track":"Bass","start_bar":1,"length_bars":4,
"notes":[{"pitch":40,"start_beat":0,"duration_beats":1}]}'Response
{
"success": true,
"data": {
"added": { "id": "clip_…", "startTime": 0, "duration": 8, "startBeat": 0, "lengthBeats": 16, "noteCount": 1 },
"track": "Bass",
"tempo": { "bpm": 120, "timeSignature": [4, 4] }
}
}/projects/{id}/editsMany tool steps as ONE atomic save: every step applies or nothing is written. A string argument "$N.path" takes a value from step N's result. Optional expected_version refuses a stale write; dry_run reports without writing. Billed tools cannot run in a batch.
Parameters
stepsarray[{ tool, args }] — tool arguments as for /tools/{name}expected_versionnumberThe version your read returneddry_runbooleanRun and report, write nothing(default: false)Example Request
curl -X POST "https://soundgen.ai/api/api-v1/projects/$PROJECT_ID/edits" \
-H "Authorization: Bearer $SOUNDGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"steps":[
{"tool":"add_track","args":{"name":"Keys","type":"midi","instrument":"epiano"}},
{"tool":"add_midi_clip","args":{"track":"$0.added.id","start_bar":1,"length_bars":4}},
{"tool":"add_notes","args":{"clip_id":"$1.added.id","notes":[{"pitch":60,"start_beat":0,"duration_beats":4}]}},
{"tool":"add_effect","args":{"track":"master","type":"limiter"}}
]}'Response
{
"success": true,
"data": { "applied": 4, "changed": ["tracks", "settings"], "version": 8, "results": [ … ] }
}Webhooks
SoundGen does not send webhooks. Calls run to completion and answer with their result:POST /generate returns the finished track (one to three minutes, so allow a long client timeout). A webhook_url field is refused with400 WEBHOOKS_UNSUPPORTED rather than silently ignored.
If the connection drops
Send your own request_id (or an Idempotency-Key header) with every generation. If the reply is lost, or the answer is 202 with statusunresolved, readGET /generations?request_id=… — or send the same request again with the same id, which returns the first result and is never generated or charged twice. Never retry under a new id.
Error Handling
All API responses include a successboolean. When an error occurs, the response includes an errorobject with a code and message.
Error Response Format
{
"success": false,
"error": {
"code": "INVALID_PROMPT",
"message": "prompt is required (a non-empty string)"
}
}| Code | Status | Description |
|---|---|---|
INVALID_PROMPT | 400 | The prompt is missing or blank |
INVALID_DURATION | 400 | Duration is outside the range (music 3-300 s, sound effects 0.5-22 s) |
INVALID_BPM | 400 | BPM is outside the range (20-400) |
INVALID_REQUEST_ID | 400 | request_id / Idempotency-Key is not a UUID, or the two differ |
SAFETY_REJECTION | 400 | The provider's safety filter blocked the prompt; nothing was charged |
WEBHOOKS_UNSUPPORTED | 400 | webhook_url was sent; there are no webhooks — POST /generate answers with the result |
MISSING_AUDIO_URL | 400 | Required audio_url field is missing |
INVALID_STEMS | 400 | Invalid stem types requested |
INVALID_REQUEST | 400 | Request body is malformed |
TEXT_TOO_LONG | 400 | Text exceeds maximum length |
INVALID_ACTION | 400 | POST /ai/process: action is not one of the listed actions |
QUERY_FAILED | 400 | A list or read was refused by the database; the message says why |
INSERT_FAILED | 400 | A create was refused by the database (a field out of range, a duplicate); the message says why |
UPDATE_FAILED | 400 | An update was refused by the database; the message says why |
DELETE_FAILED | 400 | A delete was refused by the database; the message says why |
UNAUTHORIZED | 401 | Missing or invalid API key |
INVALID_API_KEY | 401 | The sgk_ key is unknown or was deleted; create a new one in Settings → Integrations → API Keys |
FORBIDDEN | 403 | API key lacks required permissions |
INSUFFICIENT_CREDITS | 402 | Your balance is below the price — or, with creditsHeld in the body, another of your requests still running is already using those credits (a paid request reserves its price until it ends); nothing was charged. A song priced by its length also names the longest length the balance covers, in the message and as affordableSeconds and affordableCredits |
NOT_FOUND | 404 | Requested resource not found |
REQUEST_ALREADY_FAILED | 409 | This request_id already holds a failed outcome; start again with a new id |
REQUEST_IN_PROGRESS | 409 | The same request_id is still running; retry with it in a minute to get its result — it will not run or charge twice |
REVIEW_REQUIRED | 409 | An AI musician is made public through POST /musicians/{id}/publish, which reviews it first, not by an update |
ACTION_REMOVED | 410 | POST /ai/process: that action was retired; the message names what replaced it |
RATE_LIMITED | 429 | Too many requests, slow down |
INTERNAL_ERROR | 500 | Unexpected server error |
GENERATION_FAILED | 502 | The provider failed; the generation's row records the failure |
BALANCE_UNCONFIRMED | 503 | Your credit balance could not be read; nothing was charged — try again |
CREDITS_UNAVAILABLE | 503 | GET /credits: the credits service could not be reached; nothing changed — try again |
MCP Server
SoundGen exposes a Model Context Protocol (MCP) server, allowing AI agents and LLM-powered tools (like Claude Desktop, Cursor, or custom agents) to interact with your sounds, projects, AI musicians, and audio generation programmatically.
https://soundgen.ai/api/mcp-serverUses the MCP Streamable HTTP transport — compatible with any MCP-compliant client. Clients that support MCP sign-in (OAuth 2.1 with PKCE, such as claude.ai, Claude Desktop and Claude Code) connect with just the URL and ask you to sign in; the connection then shows under Settings → Integrations, where you can revoke it. Any other client sends Authorization: Bearer sgk_… with an API key from Settings → Integrations.
Use SoundGen in Claude
- claude.ai and Claude Desktop: Settings → Connectors → Add custom connector, URL
https://soundgen.ai/api/mcp-server, then Connect and sign in with your SoundGen account. - The SoundGen skill teaches Claude the prices, licensing and request-id rules: download soundgen-skill.zip and upload it under Settings → Capabilities → Skills.
- Claude Code:
/plugin marketplace add aw3-technology/soundgen-claude, then/plugin install soundgen@soundgenand/mcpto sign in.
Paid actions spend your SoundGen credits; Claude states the price before it runs one.
Editing only: https://soundgen.ai/api/mcp-studio serves just the Studio tools (projects, tracks, MIDI, effects, automation, your sound library and help). It generates nothing and spends no credits; it is the one submitted for Claude's connector directory.
Available Tools (82)
Arrangement
Build a song step by step — tracks, instruments, measured audio clips, MIDI clips in bars — or many edits as one atomic save.
- • get_arrangement
- • get_track
- • list_clips
- • add_track
- • update_track
- • delete_track
- • list_instruments
- • add_clip
- • add_midi_clip
- • update_clip
- • delete_clip
- • set_tempo
- • apply_edits
- • list_markers
- • add_marker
- • delete_marker
MIDI & Automation
Notes in beats, AI-composed parts, automation curves, warp markers and comping.
- • list_notes
- • set_notes
- • add_notes
- • delete_notes
- • transpose_notes
- • quantize_notes
- • generate_midi_part
- • list_automation
- • set_automation
- • set_warp_markers
- • list_takes
- • select_take
Mixing
Inserts one at a time on any track or the master bus, sends, modulators and master level.
- • list_effect_types
- • add_effect
- • update_effect
- • remove_effect
- • set_track_effects
- • set_track_sends
- • set_track_modulators
- • set_master
Projects
Create, read and manage projects, their versions and collaborators.
- • list_projects
- • get_project
- • create_project
- • update_project
- • delete_project
- • list_project_versions
- • create_project_version
- • list_project_collaborators
- • invite_collaborator
Sounds
The sound library: upload, search, tag and delete audio.
- • list_sounds
- • get_sound
- • create_sound
- • update_sound
- • delete_sound
- • list_genres
AI Generation
Generate audio from a prompt, extend or rewrite a section of a song, and track generation jobs.
- • generate_audio
- • edit_song
- • list_generations
- • get_generation
Audio Processing
Stem separation, speech and lyrics to text, and the AI audio pipeline (mixing, mastering, cleanup). Paid work is charged server-side, only when it delivers.
- • separate_stems
- • transcribe_speech
- • ai_audio_process
Voice
Clone a voice from a sample and synthesise speech with it; synthesis returns a link to the stored MP3. Clone and synthesis are charged server-side, only when they deliver.
- • list_voices
- • clone_voice
- • synthesize_voice
- • delete_voice
AI Musicians
Performer and engineer personas. Pass their ids as generate_audio `musicians` and their style, feel and skills are briefed into the take (never the name); get_ai_musician returns the brief, mix/master plan and part hints. Delete is soft (restore_ai_musician); update can publish or share with a team.
- • list_ai_musicians
- • get_ai_musician
- • create_ai_musician
- • update_ai_musician
- • publish_ai_musician
- • delete_ai_musician
- • restore_ai_musician
Model Training
Train custom models on your own audio and follow the job.
- • list_training_jobs
- • get_training_job
- • create_training_job
- • cancel_training_job
Video
A link that opens the free Audio Visualizer with a look and one of your songs; the video is made in the browser, nothing renders server-side.
- • visualizer_link
Product Knowledge
Search SoundGen's own documentation — what a feature does and how to reach it.
- • search_help
- • get_help_topic
- • list_help_topics
Account
Profile, credit balance, your invite link and platform statistics.
- • get_user_profile
- • update_user_profile
- • get_user_credits
- • get_referral_link
- • get_platform_stats
Connect from Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"soundgen": {
"transport": "streamable-http",
"url": "https://soundgen.ai/api/mcp-server",
"headers": { "Authorization": "Bearer sgk_YOUR_API_KEY" }
}
}
}Connect from Codex
# ~/.codex/config.toml
[mcp_servers.soundgen]
url = "https://soundgen.ai/api/mcp-server"
bearer_token_env_var = "SOUNDGEN_API_KEY"
# then set the env var, e.g. PowerShell:
# $env:SOUNDGEN_API_KEY = "sgk_YOUR_API_KEY"Test with MCP Inspector
npx @modelcontextprotocol/inspectorEnter the MCP endpoint URL above to browse and test all available tools interactively.
SDKs & Libraries
JavaScript SDK
npm install soundgen-js
Python SDK
pip install soundgen
Go Client
go get soundgen
Credits & Pricing
API requests draw from the same credit balance as the SoundGen app — there are no separate API plans or subscriptions. New accounts start with 100 free credits, and one-time credit packs are available on the pricing page.
| Action | Credits |
|---|---|
| Music generation | 20per 30s (billed per second) |
| Stem separation | 6per job |
| Stem separation (deep) | 9per job |
| Voice clone | 30one-time per voice |
| Voice synthesis (TTS) | 6per request |
| Track recreation (AI Cover) | 45per track |
Lightweight AI actions (auto-mix, mastering, chord detection, and similar) cost 1–2 credits; vocal tuning and noise removal are free. Charges apply only when a job succeeds.
Ready
to build?
Get your API key and start integrating SoundGen into your application today.