Skip to main content

POST /v1/audio/translations

Translate an audio file into English.

  • Method: POST
  • Path: /v1/audio/translations
  • Auth: Bearer token in Authorization header
  • Content-Type: multipart/form-data

Request parameters

  • model (string, required): Translation model ID (e.g., whisper-large-v3).
  • file (binary, required): The audio file to translate.
  • prompt (string, optional): Optional prompt to guide the translation.
  • language (string, optional): Source language hint (if known).

Example requests

from openai import OpenAI

client = OpenAI(base_url="https://api.naga.ac/v1", api_key="YOUR_API_KEY")

with open("german.mp3", "rb") as f:
translation = client.audio.translations.create(
model="whisper-large-v3",
file=f,
# prompt="Translate clearly with punctuation."
)
print(translation.text)

Response

Returns a JSON object with the translated text, e.g.:

{ "text": "Hello and welcome to NagaAI!" }