POST /v1/audio/transcriptions and NagaAI returns the words that were spoken. To get English text from speech in another language, upload the file to POST /v1/audio/translations instead. Both endpoints take a multipart form and follow the OpenAI Audio format, so the OpenAI SDK works unchanged.
Transcribe a file
The example transcribes thespeech.mp3 file from Text to speech. Choose a model whose operations include transcription in GET /v1/models.
response_format, timestamp_granularities and temperature, so the answer is always this JSON. There are no timestamps and no SRT or VTT output.
Send the audio
file accepts mp3, wav, m4a, ogg, flac, webm and other common audio formats. When the model needs a different container, NagaAI converts the file for you. The whole request can be up to 32 MiB, so cut long recordings into parts and join the text.
language is the language spoken in the audio, as a lower-case ISO 639-1 code such as en or de. prompt is a hint for spelling and style, such as product names or jargon the clip contains.
Translate speech
Callclient.audio.translations.create with whisper-large-v3, or send the same form to POST /v1/audio/translations. Not every transcription model translates: whisper-large-v3-turbo transcribes only. The answer is English text in the same {"text": "..."} shape. language still names the language of your audio, and the translation is always into English.
Troubleshooting
400 with The audio file you sent is invalid
NagaAI could not decode the file. Check that it plays locally and isn’t cut off, then upload it again.
400 on language
The code must be two lower-case letters, such as en. Names like English and codes like EN or en-US fail.
400 with body.file: Field required
The form has no file part. Send multipart/form-data and name the part file.
400 with does not support translate
The model transcribes but doesn’t translate. Send the file to POST /v1/audio/translations with whisper-large-v3, or use POST /v1/audio/transcriptions to keep the original language.
400 model_not_found
The model does not exist or has no transcription operation (translation for the translations endpoint). Check its operations in GET /v1/models.