mirror of
https://github.com/hanzoai/ai.git
synced 2026-11-20 14:13:23 +00:00
/v1/audio/speech has shipped OpenAI-shaped TTS since the audio group landed; STT never got its compat twin — api.hanzo.ai 404s /v1/audio/transcriptions and the only STT path is the legacy store-bound /v1/process-speech-to-text. Chat's composer therefore still listens with the browser recogniser (broken in Brave), and the intended upgrade recorded in universe's chat configmap is blocked on exactly this route. AudioTranscriptions mirrors AudioSpeech end to end: same bearer auth (pk- refused, auth before body validation so nothing is probe-able), same model-route resolution, same balance gate, same unpriced usage row + trace. Both surfaces stay in step — the beego controller and the ZAP-native handler (audio.transcribe, gateway path /v1/audio/transcriptions) — with the multipart body recovered from its own boundary line exactly as stt.process does. stt gains the OpenAI-compatible provider: any /v1 root that serves /audio/transcriptions (OpenAI itself, the in-cluster speech service, a BYO node) registers as Type OpenAI with ProviderUrl as the root. The factory takes flavor like the TTS factory always has; for STT it carries the audio's language hint, bound from the request's language field. Co-authored-by: Hanzo Dev <[email protected]>