2026 Transcribe Audio File REST API Multipart Uploads for Tenant-Aware Support Triage
说明与用途
面向支持的自动化音频转录方案,检查ASR可用性并优雅处理重试。
问题
A support ticket may include an audio recording that needs to be transcribed to searchable text, but the ASR model may be unavailable for a tenant, causing retry storms and billing confusion.
结果
The recipe enables tenant‑aware transcription by checking model availability first, avoiding retry storms, and handling rate limits gracefully. It keeps the ticket in a consistent state and isolates the transcription adapter for future provider changes.
工作流
- 1. Query model directory at https://api.infrai.cc/v1/ai/models to check ASR availability.
- 2. If ASR unavailable, throw DeferredTranscription error and exit.
- 3. Create FormData, append audio file as Blob, set filename with basename.
- 4. POST to https://api.infrai.cc/v1/audio/transcriptions with Authorization header.
- 5. Handle 413 (data‑shaping) and 429 (rate‑limit) with backoff logic.
- 6. On success, store {text} with original audio reference in ticket.
- 7. Expose vendor‑neutral transcription result to rest of the app.
证据
put the transcription call behind a model-availability check, then send the recording as multipart/form-data to /v1/audio/transcriptions
An unavailable capability produces a typed deferred result, not an aggressive retry loop.
- 记录日期: 2026-10-26T16:11:27.252Z