Passer au contenu principal

Corps de la requête

file
file
requis
Fichier audio à transcrire. Formats pris en charge : flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.
model
string
défaut:"whisper-1"
Modèle à utiliser. Actuellement, seul whisper-1 est pris en charge.
language
string
Langue de l’audio au format ISO-639-1 (par ex., en, zh, ja).
prompt
string
Texte facultatif pour guider le style du modèle ou poursuivre un segment précédent.
response_format
string
défaut:"json"
Format de sortie : json, text, srt, verbose_json, vtt.
temperature
number
défaut:"0"
Température d’échantillonnage (de 0 à 1).
timestamp_granularities
array
Granularité des horodatages : word et/ou segment. Nécessite verbose_json.

Réponse

text
string
Le texte transcrit.
Pour verbose_json :
task
string
Toujours transcribe.
language
string
Langue détectée.
duration
number
Durée de l’audio en secondes.
segments
array
Segments de transcription avec horodatages.
words
array
Horodatages au niveau des mots (si demandés).
curl -X POST "https://api.lemondata.cc/v1/audio/transcriptions" \
  -H "Authorization: Bearer sk-your-api-key" \
  -F file="@audio.mp3" \
  -F model="whisper-1" \
  -F language="en"
{
  "text": "Hello, this is a test of the transcription API."
}

Traduction

Pour traduire l’audio en anglais, utilisez l’endpoint de traductions :
response = client.audio.translations.create(
    model="whisper-1",
    file=audio_file
)