Create Streaming Transcription

Transcribes audio files in real-time, returning partial results as they become available.

POST /v1/audio/transcriptions

Request Body

Les paramètres suivants peuvent être inclus dans le corps de la requête :

Paramètres

file
file
Required

The audio file to transcribe.

model
string
Required
Default Value: alphaedge-audio-3-2512

ID of the model to use for transcription.

stream
boolean
Required
Default Value: true

Whether to stream back partial progress. Must be true.

Successful Response

Les champs suivants sont retournés dans une réponse réussie :

Champs de réponse

text
string
Required

The transcribed text chunk.

is_final
boolean
Required

Whether this is the final transcription chunk.

Examples

Exemples de code pour utiliser cet endpoint :

typescript
import { AlphaEdge } from '@alphaedge/alphaedge';

const alphaedge = new AlphaEdge({
  apiKey: process.env.ALPHAEDGE_API_KEY,
});

const stream = await alphaedge.audio.transcriptions.create({
  file: audioFile,
  model: 'alphaedge-audio-3-2512',
  stream: true
});

for await (const chunk of stream) {
  console.log(chunk.text);
}
python
from alphaedge import AlphaEdge

alphaedge = AlphaEdge(api_key="your-api-key")

with open('audio.mp3', 'rb') as audio_file:
    stream = alphaedge.audio.transcriptions.create(
        file=audio_file,
        model="alphaedge-audio-3-2512",
        stream=True
    )
    
    for chunk in stream:
        print(chunk.text)
curl
curl https://api.alphaedge-ai.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $ALPHAEDGE_API_KEY" \
  -F file="@audio.mp3" \
  -F model="alphaedge-audio-3-2512" \
  -F stream="true"

Response

Exemple de réponse de l'API :

json
{
  "text": "Hello",
  "is_final": false
}
text
data: {"text":"Hello","is_final":false}

data: {"text":" world","is_final":false}

data: {"text":"Hello world","is_final":true}

data: [DONE]