Musik
Musikgenerierung
Musik mit Suno erstellen: Stil, Lyrics, Struktur und Iterationen.
Musik wird steuerbar, wenn Stil, Stimmung, Instrumente, Tempo und Struktur getrennt beschrieben werden. Verwenden Sie dafür die vorgesehenen Felder für Lyrics und Musik-Anweisungen.
Praktische Grundlagen
Wählen Sie das Modell nach der wichtigsten Eigenschaft — Tempo, Genauigkeit, Auflösung oder Kontrolle — und speichern Sie Parameter und Version jedes Ergebnisses. suno — Music generation.
Ändern Sie pro Versuch nur eine Sache. Gute Ausgaben werden zu Referenzen und damit zum zuverlässigsten Ausgangspunkt der nächsten Iteration.
Behandeln Sie finished und failed als Endzustände. Nutzen Sie Polling oder Webhooks, bewahren Sie Rohfehler serverseitig auf und zeigen Sie Nutzerinnen und Nutzern nur sichere Meldungen.
Prompts und API-Beispiele
indie folk, fingerpicked acoustic guitar, brushed drums, warm upright bass,soft female vocal, 90 bpm, nostalgic and unhurried
Organic downtempo psybient, 95 BPM, didgeridoo and tabla loops, soft analogpads, forest field recordings, fretless bass, kalimba textures, meditativedorian A minor, 8 minute slow development, warm earthy production, no vocalsinstrumental
{"custom": true,"tags": "upbeat indie pop, jangly electric guitar, handclaps, group vocals, 128 bpm, bright and cheerful","title": "Ship It Friday","prompt": "[Verse]\nWe wrote it down on Monday morning\nHalf a plan and too much coffee\n\n[Chorus]\nShip it Friday, ship it Friday\nNothing's perfect anyway"}
Three-second audio logo: a single bright marimba motif of four notes rising,one soft synth swell underneath, clean modern, no vocals, ends cleanly
A heavy wooden door closing in a stone corridor, with a short natural reverbtail
{"action": "cover","sourceTaskId": "019ca881-9503-7270-a560-f00fc2b15785","tags": "slow piano ballad, string section, intimate male vocal, 70 bpm","title": "Ship It Friday (Ballad)"}
About these samples. Ready-made examples are copied to our own storage only when their source permits reuse. The exact prompt appears above each result, and the original source and license are linked below the media.
curl -X POST https://api.api-stock.com/api/v1/generation/create \-H "Authorization: Bearer sk-your-key" \-H "Content-Type: application/json" \-d '{"model": "suno","input": {"action": "music","gptDescriptionPrompt": "A slow indie folk song about leaving a harbour town at dawn, brushed drums, female vocal"}}'
{"model": "suno","input": {"action": "music","custom": true,"mv": "v5.0","title": "Harbour Lights","tags": "indie folk, brushed drums, warm analog","prompt": "[Verse]\nThe gulls come down before the sun does\n[Chorus]\nAnd the harbour lights go out one by one","makeInstrumental": false}}
{"code": 200,"data": {"taskId": "019ca8d7-6b02-7f31-a1c4-8e5d90b7f2aa","status": "finished","files": [{"fileUrl": "https://storage.api-stock.com/generated/suno-4c81-a.mp3","fileType": "music"},{"fileUrl": "https://storage.api-stock.com/generated/suno-4c81-b.mp3","fileType": "music"}],"output": {"tracks": [{"audioId": "b3d1f0a2-77ac-4e19-9c0e-1d2b3f4a5c6d","title": "Harbour Lights","duration": 184.6,"tags": "indie folk, brushed drums","imageUrl": "https://cdn.example.com/cover-a.jpeg"},{"audioId": "c7e2a941-08bd-4f52-b3aa-9e01c2d3e4f5","title": "Harbour Lights","duration": 191.2,"tags": "indie folk, brushed drums","imageUrl": "https://cdn.example.com/cover-b.jpeg"}]},"createdTime": "2026-02-28T13:52:19.000Z"}}
{"model": "suno","input": {"action": "extend","sourceTaskId": "019ca8d7-6b02-7f31-a1c4-8e5d90b7f2aa","audioId": "b3d1f0a2-77ac-4e19-9c0e-1d2b3f4a5c6d","continueAt": 120,"custom": true,"prompt": "[Bridge]\nThe tide turns over in the dark","tags": "indie folk, brushed drums"}}
{"model": "suno","input": {"action": "cover","sourceTaskId": "019ca8d7-6b02-7f31-a1c4-8e5d90b7f2aa","audioId": "b3d1f0a2-77ac-4e19-9c0e-1d2b3f4a5c6d","tags": "synthwave, gated reverb, 1984","title": "Harbour Lights (Synth)"}}
{"model": "suno","input": {"action": "stems","sourceTaskId": "019ca8d7-6b02-7f31-a1c4-8e5d90b7f2aa","audioId": "b3d1f0a2-77ac-4e19-9c0e-1d2b3f4a5c6d","stemType": "drum_kit"}}
{"model": "suno","input": {"action": "lyrics","prompt": "A song about leaving a harbour town at dawn","mv": "remi-v1"}}
{"code": 200,"data": {"taskId": "019ca8e0-91c3-7d48-b6f0-2a7c4e19d503","status": "finished","output": {"a": {"title": "Harbour Lights","text": "[Verse]\nThe gulls come down before the sun does","tags": ["indie folk", "folk"]},"b": {"title": "Leaving Line","text": "[Verse]\nSalt on the rope and the morning still cold","tags": ["indie folk", "acoustic"]}},"createdTime": "2026-02-28T14:02:07.000Z"}}
{"model": "suno","input": {"action": "voice","sourceTaskId": "019ca8d7-6b02-7f31-a1c4-8e5d90b7f2aa","name": "Harbour Alto"}}
const BASE = "https://api.api-stock.com/api/v1";const KEY = process.env.API_STOCK_KEY!;async function submit(input: Record<string, unknown>): Promise<string> {const res = await fetch(`${BASE}/generation/create`, {method: "POST",headers: {Authorization: `Bearer ${KEY}`,"Content-Type": "application/json",},body: JSON.stringify({ model: "suno", input }),});const body = await res.json();if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);return body.data.taskId;}async function wait(taskId: string) {const deadline = Date.now() + 15 * 60_000;while (Date.now() < deadline) {await new Promise((r) => setTimeout(r, 8_000));const res = await fetch(`${BASE}/task/status/${taskId}`, {headers: { Authorization: `Bearer ${KEY}` },});const body = await res.json().catch(() => null);if (!res.ok) {if (res.status === 429) {const retryAfter = Number(res.headers.get("Retry-After") ?? 8);await new Promise((r) => setTimeout(r, retryAfter * 1000));continue;}const message = body?.error?.message ?? `${res.status} ${res.statusText}`;throw new Error(message);}const { data } = body;if (data.status === "finished") return data;if (data.status === "failed") throw new Error(data.errorMessage);}throw new Error(`timed out waiting for ${taskId}`);}const songId = await submit({action: "music",custom: true,mv: "v5.0",title: "Harbour Lights",tags: "indie folk, brushed drums, warm analog",prompt: "[Verse]\nThe gulls come down before the sun does",});const song = await wait(songId);console.log(song.files.length); // → 2const tracks = (song.output?.tracks ?? []) as { audioId: string }[];const extendedId = await submit({action: "extend",sourceTaskId: songId,audioId: tracks[0]?.audioId,continueAt: 120,custom: true,prompt: "[Bridge]\nThe tide turns over in the dark",tags: "indie folk, brushed drums",});const extended = await wait(extendedId);console.log(extended.files[0].fileUrl); // → https://storage.api-stock.com/...
{"code": 400,"error": {"message": "action \"extend\" requires continueAt","type": "BadRequest","code": "invalid_input"}}
Mit dem eigenen Schlüssel ausführen
Jedes Modell aus diesem Leitfaden ist im API Stock-Katalog verfügbar — ein API-Schlüssel, ein Prepaid-Guthaben, keine separate Anmeldung pro Anbieter.