Zum Inhalt springen
DeutschlandGPT

Create speech

Generates audio from a text prompt. Compatible with the OpenAI /v1/audio/speech API.

Returns a binary audio stream in the requested response_format. Use /v2/models/all to discover available TTS models. Supported voices and response formats are validated per model — an unsupported value returns a 400 listing the accepted options.

POSThttps://api.deutschlandgpt.de/v2/audio/speechTry it

Example request

curl https://api.deutschlandgpt.de/v2/audio/speech \
  -X POST \
  -H "Authorization: Bearer $DGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-4o-mini-tts",
  "input": "Hallo, wie geht es Ihnen heute?",
  "voice": "nova",
  "response_format": "mp3",
  "speed": 1,
  "instructions": "string",
  "language_code": "de",
  "voice_settings": {},
  "parameters": {}
}'

Request body

modelstringrequired

Model to use. Use /v2/models to list TTS models.

inputstringrequired

Text to synthesize. Per-model character limit (4096 for gpt-4o-mini-tts).

voicestringrequired

Voice to use. Optional — defaults to the model's default voice. For gpt-4o-mini-tts: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse, marin, cedar. For ElevenLabs models (eleven_multilingual_v2, eleven_flash_v2_5, eleven_v3) it is any voice_id from your ElevenLabs voice library.

response_formatstringoptional

Audio format. Defaults to the model's default format (mp3). ElevenLabs supports mp3, opus, wav, pcm (not aac/flac).

speednumberoptional

Speech rate multiplier.

instructionsstringoptional

Free-text steering for tone and style. Only applied for models that support it (e.g. gpt-4o-mini-tts).

language_codestringoptional

ISO 639-1 language code to enforce (ElevenLabs only).

voice_settingsobjectoptional

Fine-grained voice controls (ElevenLabs only). Ignored by OpenAI/Azure models.

stabilitynumberoptional
similarity_boostnumberoptional
stylenumberoptional
use_speaker_boostbooleanoptional
parametersobjectoptional

Provider-specific passthrough (ElevenLabs only). Unknown keys are ignored; OpenAI/Azure models ignore this field entirely.

seedintegeroptional

Deterministic sampling seed.

previous_textstringoptional

Text that preceded this request, for prosody continuity across stitched generations.

next_textstringoptional

Text that follows this request, for prosody continuity.

previous_request_idsstring[]optional

Up to 3 request_ids of prior generations, for continuity when stitching.

next_request_idsstring[]optional

Up to 3 request_ids of following generations.

apply_text_normalizationstringoptional

Control number/date spelling-out. Default auto.

apply_language_text_normalizationbooleanoptional

Language-specific normalization (e.g. Japanese). Increases latency.

use_pvc_as_ivcbooleanoptional

Use the IVC version of a voice instead of its PVC version.

optimize_streaming_latencyintegeroptional

Latency-vs-quality tradeoff (0 = best quality, 4 = lowest latency).

Response

200audio/mpeg, audio/opus, audio/aac, audio/flac, audio/wav, audio/pcm

Binary audio stream.

Response headers
X-Request-IDstring

Unique request identifier (req_<id>). Include in support tickets.

Response codes

200

Binary audio stream.

400

Invalid request — unsupported voice/format, input too long, or validation error.

Error
401

Unauthorized — missing or invalid API key.

402

Insufficient credits.

403

API key lacks permission for this model.

404

Model not found or not configured for this workspace.

500

Server error.

Was this page helpful?