API Documentation

Everything you need to integrate the schwiizerdütsch.com API.

Authentication

All API requests require an API key. Pass it as a Bearer token in the Authorization header.

Authorization: Bearer sk_...

API keys can be created and managed in the Dashboard.

Base URL

https://schwiizerdütsch.com

Endpoints

POST /v1/speak

Generates an audio file from text.

# Request curl -X POST https://schwiizerdütsch.com/v1/speak \ -H "Authorization: Bearer sk_..." \ -H "Content-Type: application/json" \ -d '{ "text": "Grüezi, wie gaats Ihne?", "voice": "marco", "speed": 1.0, "output_format": "mp3" }' \ --output greeting.mp3

Parameters:

text requiredstringThe text to synthesise. Max. 10,000 characters.
voicestringVoice, 13 available, all cleared for commercial use (see Voice Licences). Full list via /v1/voices. Default marco.
dialectstringSelectable per request on all voices except marco: zh, be, gr, lu. Default zh. For marco the dialect is fixed (Züridütsch).
speedfloatSpeed. 0.5 to 2.0, default 1.0.
output_formatstringAudio format: mp3, wav, ogg, flac, pcm. Default mp3.
sample_rateintegerSample rate in Hz (resampling): 8000, 16000, 24000, 48000. Default: native 22050.

Response: Audio file in the selected format.

POST /v1/batch

Synchronous batch processing: multiple texts in one request. Returns one base64-encoded audio per text (same order). The whole batch counts once against your quota. Max. 100 texts per request.

curl -X POST https://schwiizerdütsch.com/v1/batch \ -H "Authorization: Bearer sk_..." \ -H "Content-Type: application/json" \ -d '{ "texts": ["First sentence.", "Second sentence."], "voice": "marco", "output_format": "mp3" }'

Additional parameters:

texts requiredarrayArray of texts (max. 100). Each max. 10,000 characters.

Response: JSON with count, total_chars and results — per text {index, char_count, format, audio_b64}.

GET /v1/voices

Lists all available voices with dialect, gender, and licence. Per voice, commercial_use, license and attribution state what is permitted with the output, see Voice Licences.

curl https://schwiizerdütsch.com/v1/voices \ -H "Authorization: Bearer sk_..."

GET /v1/usage

Returns the current character consumption and quota.

curl https://schwiizerdütsch.com/v1/usage \ -H "Authorization: Bearer sk_..."

Parameter Reference

textstringInput text. Max. 10,000 characters per request.
voicestringVoice ID, 13 available, all cleared for commercial use. List via /v1/voices. Default marco.
speedfloat0.5 to 2.0. Default: 1.0
output_formatstringmp3 · wav · ogg · flac · pcm
sample_rateinteger8000 · 16000 · 24000 · 48000 · nativ 22050 (Standard)

Voice Licences

All available voices may be used commercially. Generated output may be used commercially, edited and integrated into your own products. You may not resell the voices themselves, offer them as your own speech synthesis service, or use the output to train models.

For confirmation, the API ships the clearance in three places:

In the Python SDK it sits on the result: audio.commercial_use and audio.license.

Audio Formats

MP3audio/mpegCompressed. Ideal for web and mobile.
WAVaudio/wavUncompressed. Highest quality.
OGGaudio/oggCompressed. Open-source alternative to MP3.
FLACaudio/flacLossless compression.
PCMaudio/pcmRaw data for further processing (e.g. telephony).

Error Codes

400Bad RequestInvalid parameters or missing required fields.
401UnauthorizedMissing or invalid API key.
403ForbiddenNo access to this resource.
429Too Many RequestsRate limit exceeded.
500Server ErrorInternal server error.

Guthaben und Limits

BillingCreditsNo subscription. One character of text costs one credit, billed on the input length.
PriceCHF 0.40per 1,000 characters. Credits do not expire.
Starting credit600 charactersOne-off for every new account, to try it out. Credit packages from CHF 10.
Requests10 req/minMax. 10,000 characters per request, max. 100 texts per batch.

SDKs

Official SDKs for the most popular programming languages.

Python

Install:

pip install schwiizerduetsch

Usage:

import schwiizerduetsch client = schwiizerduetsch.Client("sk_...") # Generate speech audio = client.speak( text="Grüezi, wie gaats Ihne?", voice="marco", speed=1.0, format="mp3" ) audio.save("greeting.mp3")

Supported methods: