# Create Transcription

`POST https://api.vultrinference.com/v1/audio/transcriptions`

Transcribe audio. The request can be OpenRouter's JSON form, with the audio base64-encoded in `input_audio`, or OpenAI's `multipart/form-data` upload with the audio in `file`. Both return the same response, so the OpenAI and OpenRouter SDKs work unchanged.

**Audio:** Up to 25 MB after decoding and 4 hours long. Audio URLs are not accepted.

**Formats:** `response_format` is `json` (the default) or `text`, which returns the bare transcript as `text/plain`. `verbose_json`, `timestamp_granularities`, `srt` and `vtt` are not supported and return 400.

**Streaming:** With `stream: true` the response is OpenAI's server-sent events: `transcript.text.delta` events with each piece of the transcript as it is decoded, then one `transcript.text.done` with the whole `text` and the same `usage` as the JSON response. A failure after the stream began ends it with a `transcript.text.error` event in the error envelope. The upload still completes before decoding starts; this is not live audio.

**Billing:** Per second of audio, rounded up, as reported in `usage.seconds`.

## Body (application/json)

- `model` (string, required): The speech-to-text model to use, e.g. `whisper-large-v3-turbo`.
- `input_audio` (object, required)
  - `data` (string, required): The audio, base64-encoded. Raw base64, not a data URI. Up to 25 MB decoded.
  - `format` (string, required) [wav, mp3, flac, m4a, ogg, webm, aac]
- `language` (string): ISO-639-1 code of the spoken language. Detected when omitted.
- `prompt` (string): Text to guide spelling and style, such as names and terms in the audio.
- `temperature` (number) [range 0–1]
- `response_format` (string) [default json, json, text]
- `stream` (boolean): Stream the transcript as OpenAI's `transcript.text.*` server-sent events. [default false]

## Body (multipart/form-data)

- `model` (string, required): The speech-to-text model to use, e.g. `whisper-large-v3-turbo`.
- `file` (string (binary), required): The audio file, up to 25 MB.
- `language` (string): ISO-639-1 code of the spoken language. Detected when omitted.
- `prompt` (string): Text to guide spelling and style, such as names and terms in the audio.
- `temperature` (number) [range 0–1]
- `response_format` (string) [default json, json, text]
- `stream` (boolean): Stream the transcript as OpenAI's `transcript.text.*` server-sent events. [default false]

## Responses

- `200`: OK (transcription-response-payload)
- `400`: The request body is neither JSON nor multipart, or the model could not decode the audio (error-payload)
- `401`: The API key is missing, unknown or not active. Send it as Authorization: Bearer <key>. (error-payload)
- `404`: Model not found (error-payload)
- `413`: The audio is larger than 25 MB (error-payload)
- `429`: Rate limit exceeded (error-payload)
- `502`: The model could not be reached or returned an unusable response (error-payload)
- `504`: The model timed out (error-payload)

## Example

```bash
curl https://api.vultrinference.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $VULTR_INFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "whisper-large-v3-turbo",
    "input_audio": {
      "data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQAAAAA=",
      "format": "wav"
    },
    "language": "en"
  }'
```

```python
import os
import requests

response = requests.post(
    "https://api.vultrinference.com/v1/audio/transcriptions",
    headers={"Authorization": f"Bearer {os.environ['VULTR_INFERENCE_API_KEY']}"},
    json={
        "model": "whisper-large-v3-turbo",
        "input_audio": {
            "data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQAAAAA=",
            "format": "wav",
        },
        "language": "en",
    },
)
print(response.json())
```

```javascript
const response = await fetch("https://api.vultrinference.com/v1/audio/transcriptions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.VULTR_INFERENCE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "whisper-large-v3-turbo",
    "input_audio": {
      "data": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQAAAAA=",
      "format": "wav"
    },
    "language": "en"
  }),
});
console.log(await response.json());
```
