# Audio OpenAI-compatible endpoints for text-to-speech and transcription. PrivateMind has OpenAI-compatible endpoints that turn text into speech and speech into text. ## Text to speech `POST /v1/audio/speech` turns text into an audio file. ```bash curl -s "https://api.privatemind.com/v1/audio/speech" \ -H "Authorization: Bearer $PMIND_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "tts", "voice": "default", "input": "Hello world." }' \ --output speech.mp3 ``` - **`model`** (required): the `tts` alias or a TTS model id. List with `GET /v1/models`. - **`voice`** (required): a voice id. List the voices with `GET /v1/voices`. - **`input`** (required): the text to synthesise. - **`response_format`** (default `mp3`): `mp3`, `opus`, `aac`, `flac`, `wav`, `pcm`. Engine support varies. - **`speed`** (default `1.0`): playback speed multiplier. The response body is the raw audio bytes. ## Speech to text `POST /v1/audio/transcriptions` takes an audio file and returns text. ```bash curl -s "https://api.privatemind.com/v1/audio/transcriptions" \ -H "Authorization: Bearer $PMIND_KEY" \ -F "file=@call.m4a" \ -F "model=stt" ``` The request is multipart form data, and `curl -F` sets the `Content-Type` for you. - **`file`** (required): the audio file. Supported formats: `mp3`, `mp4`, `m4a`, `wav`, `webm`, `flac`, `ogg`, `mpga`, `mpeg`. - **`model`** (required): the `stt` alias, or an ASR model id from `GET /v1/models`. - **`language`**: an ISO-639-1 code (`en`, `fr`, `de`, ...). Improves accuracy and latency. - **`prompt`**: priming text, such as names, jargon or context. - **`response_format`** (default `json`): `json`, `text`, `srt`, `verbose_json`, `vtt`. Default `json` response: ```json { "text": "Hello, this is a test transcription." } ``` `verbose_json` adds per-segment timestamps and the detected language. `srt` and `vtt` return subtitle files. ## List voices ```bash curl -s "https://api.privatemind.com/v1/voices?model=" \ -H "Authorization: Bearer $PMIND_KEY" ``` ```json {"object": "list", "data": [{"id": "Emily.wav", "name": "Emily"}]} ``` Pass an `id` as `voice` to `/v1/audio/speech`. ## Limits - Transcription uploads: up to **75 MB**. A larger file gets `413` before it reaches the engine. Split a long recording into segments under the cap, transcribe them in parallel and join the text. - TTS responses are buffered before they are sent. Keep `input` under a few thousand characters. ## Where next - [Models](https://docs.privatemind.com/models.html) to list audio-capable models in your org. - [Errors](https://docs.privatemind.com/errors.html) for the `413` upload-size response and other status codes. - [Rate limits](https://docs.privatemind.com/rate-limits.html) for budget and RPM behaviour on audio calls.