Zum Inhalt springen
DeutschlandGPT

Create music

Generates a music track from a text prompt (ElevenLabs Eleven Music). Returns a binary audio stream in the requested response_format. Billed per minute of generated audio (the requested duration_ms).

POSThttps://api.deutschlandgpt.de/v2/audio/music

Example request

curl https://api.deutschlandgpt.de/v2/audio/music \
  -X POST \
  -H "Authorization: Bearer $DGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "Upbeat lo-fi hip hop with mellow piano and a soft beat",
  "model": "music_v1",
  "duration_ms": 30000,
  "response_format": "mp3"
}'

Request body

promptstringrequired

Description of the music to generate (genre, mood, instruments, tempo, …).

modelstringoptional

Music model to use. Defaults to music_v1.

duration_msintegeroptional

Length of the generated track in milliseconds. Capped at the model's max (300000 = 5 min). Defaults to 30000.

response_formatstringoptional

Audio format. Defaults to mp3.

Response

200audio/mpeg, audio/opus, audio/pcm

Binary audio stream of the generated music.

Response codes

200

Binary audio stream of the generated music.

400

Unsupported format or provider error.

401

Unauthorized.

402

Insufficient credits.

403

API key lacks permission for this model.

404

Model not found.

Was this page helpful?