> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.voicecheap.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Transcrire un média

> Transcrivez un fichier audio ou vidéo sous forme de JSON, SRT ou VTT complet

# Transcrire un média

Téléchargez un fichier audio ou vidéo et recevez directement sa transcription. Ce point de terminaison autonome ne crée pas de projet de doublage.

Le point de terminaison accepte des fichiers allant jusqu'à **200 Mo** et **2 heures**. Il utilise les mêmes règles d'accès par clé API que l'API de traduction.
Les requêtes réussies renvoient le code HTTP `200`.

## Requête

Envoyez `multipart/form-data` avec les champs suivants.

<ParamField header="x-api-key" type="string" required>
  Votre clé API VoiceCheap.
</ParamField>

<ParamField body="file" type="file" required>
  Le fichier audio ou vidéo à transcrire. Les formats pris en charge incluent MP4, MOV, MKV, WebM, MPEG, MP3, WAV, M4A, FLAC, OGG et AAC.
</ParamField>

<ParamField body="outputFormat" type="string" default="json">
  Format de réponse : `json`, `srt` ou `vtt`.
</ParamField>

<ParamField body="originalLanguage" type="string" default="auto-detect">
  Code ISO de la langue source pris en charge. Laissez cette valeur sur `auto-detect` sauf si vous connaissez la langue source. Les langues explicites non prises en charge renvoient une erreur de validation avant le début du traitement.
</ParamField>

<ParamField body="numberOfSpeakers" type="string" default="auto-detect">
  `auto-detect` ou un entier compris entre `1` et `32`.
</ParamField>

<ParamField body="brandVocabulary" type="string">
  Un tableau de chaînes JSON contenant des noms, des marques, des acronymes ou des termes techniques à reconnaître. Les termes de la requête sont fusionnés avec le glossaire enregistré du compte ou de l'équipe.

  ```json theme={null}
  ["VoiceCheap", "SmartSync", "ITC Global"]
  ```
</ParamField>

<ParamField body="removeFillerWords" type="boolean" default="true">
  Supprimez les mots de remplissage courants de la transcription.
</ParamField>

<ParamField body="includeSpeakerLabels" type="boolean" default="false">
  Préfixez les repères SRT avec `Speaker N:` ou ajoutez des balises vocales VTT. Le format JSON inclut toujours le locuteur numérique sur chaque segment et chaque mot.
</ParamField>

## Réponse JSON

Le format JSON est la sortie la plus complète. Il contient le texte intégral, la confiance linguistique, la durée du média, les locuteurs, les segments horodatés et les mots horodatés.

```json theme={null}
{
  "source": "standalone",
  "language": "en",
  "languageConfidence": 0.99,
  "duration": 12.4,
  "text": "Welcome to VoiceCheap.",
  "speakers": [{ "id": 0, "label": "Speaker 1" }],
  "segments": [
    {
      "index": 0,
      "text": "Welcome to VoiceCheap.",
      "begin": 0.18,
      "end": 1.74,
      "duration": 1.56,
      "speaker": 0,
      "language": "en",
      "confidence": 0.94,
      "words": [
        {
          "index": 0,
          "text": "Welcome",
          "speaker": 0,
          "confidence": 0.96,
          "begin": 0.18,
          "end": 0.62,
          "duration": 0.44
        }
      ]
    }
  ],
  "words": [
    {
      "index": 0,
      "text": "Welcome",
      "speaker": 0,
      "confidence": 0.96,
      "begin": 0.18,
      "end": 0.62,
      "duration": 0.44
    }
  ]
}
```

## Exemples

<CodeGroup>
  ```bash cURL — JSON theme={null}
  curl -X POST "https://api.voicecheap.ai/v1/transcribe" \
    -H "x-api-key: vc_your-api-key" \
    -F "file=@interview.mp4" \
    -F "outputFormat=json" \
    -F "numberOfSpeakers=2" \
    -F 'brandVocabulary=["VoiceCheap","SmartSync"]'
  ```

  ```bash cURL — SRT theme={null}
  curl -X POST "https://api.voicecheap.ai/v1/transcribe" \
    -H "x-api-key: vc_your-api-key" \
    -F "file=@interview.mp4" \
    -F "outputFormat=srt" \
    -F "includeSpeakerLabels=true" \
    --output interview.srt
  ```

  ```bash cURL — VTT theme={null}
  curl -X POST "https://api.voicecheap.ai/v1/transcribe" \
    -H "x-api-key: vc_your-api-key" \
    -F "file=@interview.mp4" \
    -F "outputFormat=vtt" \
    --output interview.vtt
  ```
</CodeGroup>

## Erreurs

| Statut | Code                        | Description                                                               |
| ------ | --------------------------- | ------------------------------------------------------------------------- |
| 400    | `FILE_REQUIRED`             | Aucun fichier n'a été téléchargé                                          |
| 400    | `INVALID_FILE_TYPE`         | Le type de fichier n'est pas pris en charge                               |
| 400    | `INVALID_MEDIA_STREAM`      | Le fichier ne contient aucun flux audio                                   |
| 400    | `DURATION_DETECTION_FAILED` | La durée du média n'a pas pu être lue                                     |
| 400    | `DURATION_TOO_LONG`         | Le média dépasse deux heures                                              |
| 400    | `INVALID_BRAND_VOCABULARY`  | Une ou plusieurs entrées du glossaire sont invalides                      |
| 400    | `INVALID_BOOLEAN_VALUE`     | Un booléen multipart n'est pas `true` ou `false`                          |
| 400    | `INVALID_JSON_FORMAT`       | Un champ multipart encodé en JSON est mal formé                           |
| 400    | `INVALID_MULTIPART_REQUEST` | Les données de formulaire multipart sont mal formées ou trop volumineuses |
| 413    | `FILE_TOO_LARGE`            | Le fichier dépasse 200 Mo                                                 |
| 502    | `TRANSCRIPTION_EMPTY`       | La transcription n'a renvoyé aucune parole exploitable                    |
| 502    | `TRANSCRIPTION_FAILED`      | Le moteur de transcription n'a pas pu terminer                            |
