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

# Audio Translation

> Translate audio files to English text, supporting multiple source languages.

## Headers

**Authorization** `string` *required*

Bearer token authentication. Format: `Authorization: Bearer sk-xxxxxx`

**Content-Type** `string` *required*

Must be `multipart/form-data`

## Body

**file** `file` *required*

Audio file to translate. Binary format, supports multiple audio formats (e.g., mp3, mp4, mpeg, mpga, m4a, wav, webm).

**model** `string` *required*

Model ID. For example `whisper-1`.

**prompt** `string`

Optional text prompt to guide the model's style or continue a previous audio segment. The prompt should be in English.

**response\_format** `string` (default: json)

Translation output format. Allowed values are `json`, `text`, `srt`, `verbose_json`, `vtt`. Defaults to `json`.

**temperature** `number`

Sampling temperature, between 0 and 1. Defaults to 0.

## Response

**text** `string`

Translated English text.

```bash cURL theme={"dark"}
curl -X POST "https://t.ato2.nodesms.com/v1/audio/translations" \
  -H "Authorization: Bearer $API_KEY" \
  -F file="@audio.mp3" \
  -F model="whisper-1"
```

```python Python theme={"dark"}
from openai import OpenAI

client = OpenAI(
    api_key="sk-xxxxxx",
    base_url="https://t.ato2.nodesms.com/v1"
)

audio_file = open("audio.mp3", "rb")
translation = client.audio.translations.create(
    model="whisper-1",
    file=audio_file
)
print(translation.text)
```

```json 200 theme={"dark"}
{
  "text": "Hello, this is a test in English."
}
```

```json 400 theme={"dark"}
{
  "error": {
    "message": "string",
    "type": "invalid_request_error",
    "param": "file",
    "code": "string"
  }
}
```

```json 429 theme={"dark"}
{
  "error": {
    "message": "Rate limit exceeded",
    "type": "rate_limit_error",
    "param": null,
    "code": "rate_limit_exceeded"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.