> ## 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.

# Trascrivi file multimediale

> Trascrivi un file audio o video come JSON, SRT o VTT completo

# Trascrivi file multimediale

Carica un file audio o video e ricevi direttamente la sua trascrizione. Questo endpoint autonomo non crea un progetto di doppiaggio.

L'endpoint accetta file fino a **200 MB** e **2 ore**. Utilizza le stesse regole di accesso tramite API-key dell'API di traduzione.
Le richieste riuscite restituiscono HTTP `200`.

## Richiesta

Invia `multipart/form-data` con i seguenti campi.

<ParamField header="x-api-key" type="string" required>
  La tua chiave API VoiceCheap.
</ParamField>

<ParamField body="file" type="file" required>
  Il file audio o video da trascrivere. I formati supportati includono MP4, MOV, MKV, WebM, MPEG, MP3, WAV, M4A, FLAC, OGG e AAC.
</ParamField>

<ParamField body="outputFormat" type="string" default="json">
  Formato di risposta: `json`, `srt` o `vtt`.
</ParamField>

<ParamField body="originalLanguage" type="string" default="auto-detect">
  Codice ISO della lingua sorgente supportato. Lascialo come `auto-detect` a meno che tu non conosca la lingua sorgente. Le lingue esplicite non supportate restituiscono un errore di convalida prima dell'inizio dell'elaborazione.
</ParamField>

<ParamField body="numberOfSpeakers" type="string" default="auto-detect">
  `auto-detect` o un numero intero da `1` a `32`.
</ParamField>

<ParamField body="brandVocabulary" type="string">
  Un array di stringhe JSON di nomi, marchi, acronimi o termini di dominio da riconoscere. I termini della richiesta vengono uniti al glossario salvato dell'account o del team.

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

<ParamField body="removeFillerWords" type="boolean" default="true">
  Rimuovi le comuni parole riempitive dalla trascrizione.
</ParamField>

<ParamField body="includeSpeakerLabels" type="boolean" default="false">
  Aggiungi un prefisso ai cue SRT con `Speaker N:` o aggiungi tag vocali VTT. Il formato JSON include sempre il numero del parlante su ogni segmento e parola.
</ParamField>

## Risposta JSON

Il formato JSON è l'output più completo. Contiene il testo completo, l'attendibilità della lingua, la durata del file multimediale, i parlanti, i segmenti con timestamp e le parole con timestamp.

```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
    }
  ]
}
```

## Esempi

<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>

## Errori

| Stato | Codice                      | Descrizione                                                  |
| ----- | --------------------------- | ------------------------------------------------------------ |
| 400   | `FILE_REQUIRED`             | Nessun file è stato caricato                                 |
| 400   | `INVALID_FILE_TYPE`         | Il tipo di file non è supportato                             |
| 400   | `INVALID_MEDIA_STREAM`      | Il file non ha un flusso audio                               |
| 400   | `DURATION_DETECTION_FAILED` | Impossibile leggere la durata del file multimediale          |
| 400   | `DURATION_TOO_LONG`         | Il file multimediale è più lungo di due ore                  |
| 400   | `INVALID_BRAND_VOCABULARY`  | Una o più voci del glossario non sono valide                 |
| 400   | `INVALID_BOOLEAN_VALUE`     | Un valore booleano multipart non è `true` o `false`          |
| 400   | `INVALID_JSON_FORMAT`       | Un campo multipart codificato in JSON è malformato           |
| 400   | `INVALID_MULTIPART_REQUEST` | I dati del modulo multipart sono malformati o troppo grandi  |
| 413   | `FILE_TOO_LARGE`            | Il file supera i 200 MB                                      |
| 502   | `TRANSCRIPTION_EMPTY`       | La trascrizione non ha restituito alcun parlato utilizzabile |
| 502   | `TRANSCRIPTION_FAILED`      | Il motore di trascrizione non è riuscito a terminare         |
