Passer au contenu principal
POST
/
v1
/
audio
/
transcriptions
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."
}

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 continuer 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 (0 à 1).
timestamp_granularities
array
Granularité de l’horodatage : 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 de l’audio vers l’anglais, utilisez l’endpoint de traduction :
response = client.audio.translations.create(
    model="whisper-1",
    file=audio_file
)