Skip to main content

Streaming Transcription V2

POST 

/v2/models/transcribe/stream

Perform streaming transcription using the V2 model which perform better when audio are short and contains french words.

What does this endpoint do?

  • Transcribes audio content into text in real-time using Bambara models.
  • Optionally translates the transcribed text into French if translate_to_french is set to True.

Behavior Notes:

  • If translate_to_french=False (default):
    • Each streamed response represents a chunk of the transcribed text.
  • If translate_to_french=True:
    • Each streamed response represents the entire transcription up to that point, translated into French.
    • This is because translation requires full context for accurate results.

Headers:

  • x-api-key: Your API key for authentication.

Parameters:

  • file (UploadFile): The audio file to transcribe.
  • translate_to_french (bool): Whether to translate the transcription into French. Defaults to False.

Example Response (Chunk Mode - translate_to_french=False):

{"text": "Aw ni ce", "start": 0.0, "end": 0.2}
{"text": "I ka kene wa?", "start": 0.2, "end": 0.4}

Example Response (Full Text Mode - translate_to_french=True):

{"text": "Bonjour, comment ça va?"}

Caution:

  • Translation introduces latency because it requires the full transcription context for accuracy. Expect longer delays when translate_to_french=True.

Returns: StreamingResponse: A streaming JSON response containing transcription and optional translation.

Request

Responses

Successful Response