STT

Overview

Speech-to-text transcription through the environment’s STT provider, with usage tracking.

Supported providers include OpenAI, Deepgram, AssemblyAI, Google, Azure, and Athena (OpenAI-compatible Live API via tunnel or custom baseUrl ending in /v1).

API

{pe} = /projects/{projectId}/environments/{environmentId}.

MethodPathNotes
GET/stt/healthHealth
POST/stt{pe}/transcribeRequireAuthorization — multipart file, returns JSON
POST/stt{pe}/transcribe/streamRequireAuthorization — multipart file, SSE transcript deltas
GET/stt{pe}/usageRequireAuthorization

Streaming events

POST /transcribe/stream returns text/event-stream:

data: {"type":"transcript.text.delta","delta":"…","text":"…"}
data: {"type":"transcript.text.done","text":"…"}
data: [DONE]

Athena uses native upstream SSE (stream=true). Other providers run a batch transcription and emit a synthetic delta + done.

Clients

PackageRuntime
@vijihub/sttserver
VijiHub.STT.NET
import { createSttClient } from '@vijihub/stt'

const stt = createSttClient({
  baseUrl: 'http://localhost:5600',
  projectId: '...',
  environmentId: '...',
  getAccessToken: () => auth.ensureAccessToken(),
})

Implementation

  1. Enable STT and configure the provider (and optional tunnel URL).
  2. For Athena, set baseUrl to https://{slug}.tunnel.vijihub.com/v1 (API key optional).
  3. POST audio to /transcribe or /transcribe/stream from a trusted client with Bearer auth.
  4. Track consumption via /usage.

Constraints

  • Requires authorization — keep calls on server/BFF.
  • Audio size/format limits depend on the configured provider (Athena prefers WAV).
  • Provider credentials stay in environment settings.