Create Transcription

Transcribes audio files into text in the language they are spoken.

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, in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.

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

ID of the model to use for transcription.

language
string

The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.

response_format
string
Default Value: json

The format of the transcript output.

Successful Response

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

Champs de réponse

text
string
Required

The transcribed text.

Examples

Exemples de code pour utiliser cet endpoint :

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

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

const transcription = await alphaedge.audio.transcriptions.create({
  file: fs.createReadStream('audio.mp3'),
  model: 'alphaedge-audio-3-2512'
});
python
from alphaedge import AlphaEdge

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

with open('audio.mp3', 'rb') as audio_file:
    transcription = alphaedge.audio.transcriptions.create(
        file=audio_file,
        model="alphaedge-audio-3-2512"
    )
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"

Response

Exemple de réponse de l'API :

json
{
  "text": "Hello, this is a transcription of the audio file."
}