Lia

Mint a short-lived Azure Speech token (STT/TTS)

Changed on

Returns a 10-minute authorization token for direct Azure STT/TTS calls.

Why this pattern:

  • The raw AZURE_SPEECH_KEY never leaves the server.
  • Tokens expire in 10 minutes — limited blast radius if leaked.
  • The frontend connects directly to Azure via WebSocket using the token, so audio streaming is realtime (no round-trip through this backend).

Frontend usage with Microsoft Speech SDK: const config = sdk.SpeechConfig.fromAuthorizationToken(token, region);

post/api/lia/speech/token

Request

Response

Successful Response

tokenstring required
regionstring required
expires_ininteger required

Seconds until token expires (Azure default: 600)

Changes