Skip to content

API de Transcription Asynchrone de Fichiers ​

Pour les fichiers volumineux ou de longue durée (ex. enregistrements de réunions de 2 heures, podcasts ou pistes vidéo de films), utilisez l’API de tâches asynchrones de OneASR.


1. Créer une Tâche de Transcription (POST /v1/file-transcription/transcriptions) ​

http
POST /v1/file-transcription/transcriptions
Authorization: Bearer sk-oneasr-...
Content-Type: multipart/form-data

Paramètres de Formulaire : ​

  • file : Objet binaire audio/vidéo (mp3, wav, mp4, mkv, etc. jusqu’à 2 Go).
  • model : Modèle ASR cible (faster-whisper, qwen, firered).
  • language : (Facultatif) Code langue ISO-639-1.
  • enable_diarization : (Facultatif) true / false pour la séparation des locuteurs.

Réponse : ​

json
{
  "task_id": "task_8f9c1e7a2b3c4d5e",
  "status": "queued",
  "created_at": "2026-09-28T15:00:00Z"
}

2. Consulter l’État d’une Tâche (GET /v1/file-transcription/transcriptions/{task_id}) ​

http
GET /v1/file-transcription/transcriptions/task_8f9c1e7a2b3c4d5e
Authorization: Bearer sk-oneasr-...

Réponse (Terminée) : ​

json
{
  "task_id": "task_8f9c1e7a2b3c4d5e",
  "status": "completed",
  "progress": 1.0,
  "result": {
    "text": "Full transcribed speech text...",
    "srt": "1\n00:00:00,000 --> 00:00:04,500\nFull transcribed speech text...\n",
    "vtt": "WEBVTT\n\n00:00:00.000 --> 00:00:04.500\nFull transcribed speech text...\n"
  }
}

3. Annuler une Tâche (DELETE /v1/file-transcription/transcriptions/{task_id}) ​

http
DELETE /v1/file-transcription/transcriptions/task_8f9c1e7a2b3c4d5e
Authorization: Bearer sk-oneasr-...