← Blog

DocuMind API voice mode: optional voice flag for REST integrations

If you embed DocuMind in your product with a Bearer API key, you can keep using the API exactly as before—nothing breaks when you omit this option. When you add voice: true to the JSON body, responses include extra strings formatted like the web app’s voice transcripts (guillemets «…»), so your UI can match DocuMind’s chat styling when you build speech → text → answer → speech flows.

What stays the same

What voice: true adds

On POST /api/v1/chat, when voice is true, the JSON may include voice, message_marked, and reply_marked alongside reply. Use message_marked / reply_marked only if you want your saved chat history to mirror the in-app voice appearance.

On POST /api/v1/chat/stream, delta events are unchanged {"t":"d","c":"..."}. The final {"t":"done", ...} event may include voice, message_marked, and reply_marked when you requested voice mode—parse the last JSON object accordingly.

Speech recognition and TTS

DocuMind’s HTTP API does not run speech-to-text or TTS on the server for Bearer keys—you wire those in your client (browser Web Speech API, mobile SDKs, or a cloud STT/TTS provider). Send the transcribed text as message; speak the streamed or JSON reply with your chosen voice engine.

Full reference: How it works — API & optional voice · Voice assistant guide for developers · Web Speech API + DocuMind