curl -X POST "https://t.ato2.nodesms.com/v1/audio/translations" \
-H "Authorization: Bearer $API_KEY" \
-F file="@audio.mp3" \
-F model="whisper-1"
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)
{
"text": "Hello, this is a test in English."
}
{
"error": {
"message": "string",
"type": "invalid_request_error",
"param": "file",
"code": "string"
}
}
{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"param": null,
"code": "rate_limit_exceeded"
}
}
Audio Translation
Translate audio files to English text, supporting multiple source languages.
POST
/
v1
/
audio
/
translations
curl -X POST "https://t.ato2.nodesms.com/v1/audio/translations" \
-H "Authorization: Bearer $API_KEY" \
-F file="@audio.mp3" \
-F model="whisper-1"
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)
{
"text": "Hello, this is a test in English."
}
{
"error": {
"message": "string",
"type": "invalid_request_error",
"param": "file",
"code": "string"
}
}
{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"param": null,
"code": "rate_limit_exceeded"
}
}
Headers
string
required
Bearer token authentication. Format:
Authorization: Bearer sk-xxxxxxstring
required
Must be
multipart/form-dataBody
file
required
Audio file to translate. Binary format, supports multiple audio formats (e.g., mp3, mp4, mpeg, mpga, m4a, wav, webm).
string
required
Model ID. For example
whisper-1.string
Optional text prompt to guide the model’s style or continue a previous audio segment. The prompt should be in English.
string
default:"json"
Translation output format. Allowed values are
json, text, srt, verbose_json, vtt. Defaults to json.number
Sampling temperature, between 0 and 1. Defaults to 0.
Response
string
Translated English text.
curl -X POST "https://t.ato2.nodesms.com/v1/audio/translations" \
-H "Authorization: Bearer $API_KEY" \
-F file="@audio.mp3" \
-F model="whisper-1"
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)
{
"text": "Hello, this is a test in English."
}
{
"error": {
"message": "string",
"type": "invalid_request_error",
"param": "file",
"code": "string"
}
}
{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"param": null,
"code": "rate_limit_exceeded"
}
}
Last modified on October 28, 2026
Was this page helpful?