Saltar al contenido 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."
}

Cuerpo de la solicitud

file
file
requerido
Archivo de audio a transcribir. Formatos soportados: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.
model
string
predeterminado:"whisper-1"
Modelo a utilizar. Actualmente solo se admite whisper-1.
language
string
Idioma del audio en formato ISO-639-1 (por ejemplo, en, zh, ja).
prompt
string
Texto opcional para guiar el estilo del modelo o continuar un segmento anterior.
response_format
string
predeterminado:"json"
Formato de salida: json, text, srt, verbose_json, vtt.
temperature
number
predeterminado:"0"
Temperatura de muestreo (0 a 1).
timestamp_granularities
array
Granularidad de la marca de tiempo: word y/o segment. Requiere verbose_json.

Respuesta

text
string
El texto transcrito.
Para verbose_json:
task
string
Siempre transcribe.
language
string
Idioma detectado.
duration
number
Duración del audio en segundos.
segments
array
Segmentos de transcripción con marcas de tiempo.
words
array
Marcas de tiempo a nivel de palabra (si se solicitan).
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."
}

Traducción

Para traducir audio al inglés, utilice el endpoint de traducciones:
response = client.audio.translations.create(
    model="whisper-1",
    file=audio_file
)