# Parameters

The form fields a request takes and the rules they follow, its headers, and files sent by their address.

Form fields, next to `model_id` and `file`. Every one but `model_id` is optional.

| Field | Values | Default | What it does |
|---|---|---|---|
| `model_id` | `vatis_ro_v9`, `vatis_multi_v1` | required | A model whose `mode` is `batch` (`GET /v1/models`): Romanian, or 99 languages with detection. |
| `file` | a file |  | An audio or video file in any common format (WAV, MP3, M4A, FLAC, OGG, Opus, MP4, ...), up to 2 GiB. Send this or `url`. |
| `url` | an `http://` or `https://` address, up to 8192 characters |  | The address of a file: the API downloads it ([Files at an address](https://platform.vatis.tech/docs/batch/parameters#files-at-an-address)). |
| `language_code` | `ro` (also `ron`); with `vatis_multi_v1`, one of its languages or several, separated by commas | the model's | With `vatis_ro_v9`, files are Romanian. With `vatis_multi_v1`, one code is the file's language; several, such as `ro,en`, have the language detected among them only, part by part, so a recording that mixes them is transcribed in each; none, detected among all its languages. A language the model does not offer: `400` `invalid_parameter`. |
| `diarize` | `true`, `false` | `false` | Tells the speakers apart ([Speakers](https://platform.vatis.tech/docs/transcript-object#speakers)). |
| `num_speakers` | 1 to 32 |  | How many people speak, when you know. Above 8, a slower speaker model with no limit runs. Without `diarize` it has no effect. |
| `multichannel` | `true`, `false` | `false` | At most 2 channels, each transcribed alone: the channel is the speaker. Not with `diarize`. |
| `remove_fillers` | `true`, `false` | `false` | Removes filler words and hesitations from the text. |
| `punctuation` | `true`, `false` | `true` | Punctuation and capitals, the capitals of names too. `false`: lowercase words without punctuation, and segments cut on pauses alone. |
| `numbers` | `digits`, `words` | `digits` | `digits`: numbers as digits, times and units in short form (`30`, `3:30`, `70km/h`). `words`: in words (`treizeci`, `trei și treizeci de minute`). |
| `timestamps` | `word`, `none` | `word` | `none`: words keep their text, confidence and speaker; `start` and `end` are `null`. |
| `vocabulary_id` | a vocabulary id, `voc_...` |  | A saved vocabulary of your workspace ([Vocabulary](https://platform.vatis.tech/docs/batch/parameters#vocabulary)). |
| `vocabulary` | a JSON list of up to 250 entries, as a string |  | The file's own names and terms, added to the saved ones. |
| `vocabulary_strength` | 0 to 2 | `1` | How hard the service leans towards the entries. |
| `async` | `true`, `false` | always on | Taken, and changes nothing: every request is answered `202` at once ([Send now, collect later](https://platform.vatis.tech/docs/batch/send-now-collect-later)). |
| `webhook` | `true`, `false` | `false` | Also post the result to every enabled webhook when the job ends ([Webhooks](https://platform.vatis.tech/docs/batch/webhooks)). |
| `webhook_id` | a webhook's id |  | Post the result to this webhook only. |
| `metadata` | a JSON object, as a string, up to 16 KB |  | Your own data, returned unchanged in the transcript and the webhook delivery. |
| `store` | `true`, `false` | `true` | `false`: keep nothing after the webhook delivery. Needs `webhook` or `webhook_id` ([Keeping nothing](https://platform.vatis.tech/docs/batch/manage-transcripts#keeping-nothing)). |
| `exports` | any of `txt`, `srt`, `vtt`, separated by commas |  | The finished transcript also carries these files ([Exports](https://platform.vatis.tech/docs/batch/exports#files-with-the-transcript-itself)). |

## Headers and the token

| Name | Values | What it does |
|---|---|---|
| Header `Authorization` | `Bearer <api key>` | Your API key ([Authentication and API keys](https://platform.vatis.tech/docs/authentication)). |
| Header `Idempotency-Key` | 1 to 255 printable characters | Repeat a request safely ([Idempotency](https://platform.vatis.tech/docs/batch/idempotency)). |
| Query `token` | a single-use `batch` token | Instead of the key, for a web page that uploads a file ([Tokens for web pages](https://platform.vatis.tech/docs/authentication#tokens-for-web-pages)). The only query parameter this endpoint takes. |

## Rules for the fields

- **The body** is `multipart/form-data`. A request with a `url` and no file may also be `application/x-www-form-urlencoded`. Anything else: `400` `invalid_request`.
- **Booleans** are `true` or `false` (also `1` or `0`, in any case). An empty value counts as not sent.
- **Strict fields:** an unknown field, a field sent twice, or a second file is `400` `invalid_parameter`, with `param` naming it ([Strict parameters](https://platform.vatis.tech/docs/errors#strict-parameters)).
- **`file` and `url`:** both is `400` `invalid_parameter` (`param` `url`), neither is `400` `missing_parameter` (`param` `file`).
- **Fields that do not go together**, `400` `invalid_parameter`: `multichannel` with `diarize` (`param` `diarize`); `store=false` without a webhook (`param` `store`); `srt` or `vtt` in `exports` with `timestamps=none` (`param` `exports`).
- **Webhooks:** `webhook=true` with no enabled webhook (`param` `webhook`), or an unknown or turned-off `webhook_id` (`param` `webhook_id`): `400` `invalid_parameter`.
- **Size:** the form fields together (all but the file) hold at most 1 MB, in at most 200 parts.

## Vocabulary

A Romanian file can take a vocabulary: the names and terms it must get right. Wherever they are recognised, they are written exactly as listed, in `words` and `text`. A saved one goes by its id, and the file's own entries as a JSON list, up to 250:

```bash
curl -sS -H "Authorization: Bearer $VATIS_KEY" https://api.eu.vatis.tech/v1/speech-to-text \
  -F model_id=vatis_ro_v9 -F vocabulary_id=voc_3f9c1a2b7d4e \
  -F vocabulary='["Vatis Tech", "Ispas"]' -F file=@speech.wav
```

The transcript then says what was applied, never the entries: `"vocabulary": {"id": "voc_3f9c1a2b7d4e", "strength": 1, "entries": 427}`. Romanian models only, at no extra price. How to write entries, the strength, and the errors: [Vocabularies](https://platform.vatis.tech/docs/realtime/vocabularies#files).

## Files at an address

- The API downloads the file itself, so the address must be reachable from the internet. Loopback, link-local and private network addresses are refused: `400` `invalid_parameter`, at once for an address, in the job for a name that leads to one.
- Each redirect is checked like the first address. A download that fails (no answer, an answer other than `200`, too many redirects, too slow) fails the job with `400` `invalid_parameter`; a file over 2 GiB with `413` `request_too_large`; an empty one with `400` `invalid_audio`.
- The download happens in the job, after the request is answered: a download that fails ends the job `failed`, with these errors.
