Skip to main content
POST
Translate audio
For runnable examples, see Speech to Text.

Overview

POST /v1/audio/translations is OpenAI-compatible: client.audio.translations.create(model="morph-transcribe", file=audio) returns English. Morph adds target_language, to translate from English into another language, url input in a JSON body, and prompt and keyterms for names and jargon.

Languages

Translation runs into English from ar, bg, cs, da, de, el, es, et, fi, fr, he, hi, hr, hu, it, ja, ko, lt, lv, mt, nl, pl, pt, ro, ru, sk, sl, sv, th, uk and zh, or from English into any of them. target_language takes the code or the English name; the default is en.

Options and responses

Only morph-transcribe translates. It takes prompt, keyterms[], stream and the json, text and verbose_json formats; style, diarize, tag_audio_events, timestamps, srt and vtt are refused with a 400. In verbose_json, language is the target. stream: true returns the same server-sent events as transcription. Usage, limits and errors match transcription.

Authorizations

Authorization
string
header
required

Morph API key, passed as Authorization: Bearer sk-.... Create keys at https://www.morphllm.com/dashboard/api-keys.

Body

The audio and the target language.

A multipart upload to translate. style, diarize, tag_audio_events, timestamps and subtitles are refused with a 400.

file
file
required

The audio or video file. Anything ffmpeg decodes (mp3, wav, flac, m4a, ogg, webm, mp4 and more); the first audio track is used. Up to 180 MB and 60 minutes. Send exactly one of file or url.

model
enum<string>
required

Only morph-transcribe translates.

Available options:
morph-transcribe
Example:

"morph-transcribe"

target_language
string

The language to translate into, as an ISO 639-1 code or an English name. Default en. Translation runs from English into ar, bg, cs, da, de, el, es, et, fi, fr, he, hi, hr, hu, it, ja, ko, lt, lv, mt, nl, pl, pt, ro, ru, sk, sl, sv, th, uk, zh, or from any of them into English.

Example:

"en"

prompt
string

Free-text context about the audio, such as the topic or the names in it, to spell words correctly. It is context, not an instruction. With keyterms, up to 2,000 characters in total.

Example:

"Quarterly earnings call for Acme Robotics."

response_format
enum<string>

json (default), text or verbose_json. Subtitles and timestamps are refused: word times align the source speech, not the translation.

Available options:
json,
text,
verbose_json
Example:

"json"

stream
boolean

Stream the transcript as server-sent events: transcript.text.delta events, then one transcript.text.done with the full text and usage. Works with json and text response formats.

Example:

false

keyterms[]
string[]

Names and jargon to spell correctly, one form field per term. Up to 100 terms.

Maximum array length: 100
Example:

Response

The translation as json, text or verbose_json, or a server-sent event stream when stream is true.

The json response.

text
string
required

The transcript, or the translation.

Example:

"He hoped there would be stew for dinner, turnips and carrots and bruised potatoes and fat mutton pieces to be ladled out in thick, peppered, flour-fattened sauce."

usage
object
required

What the request used.

Example:
segments
object[]

Speaker segments, when diarize is on.

Example:
truncated
enum<boolean>

Present when the transcript ends before the audio does: it hit the per-request output cap of ceil(audio seconds x 16) + 256 tokens (about 4 tokens per second is normal speech, so this marks a model repetition loop), or the model stopped transcribing and the text was cut there. Also sent as the header x-morph-truncated: true.

Available options:
true
Example:

true

timestamps_incomplete
enum<boolean>

Present when timestamps were requested and could not be placed for every word. words is then left out and segments carry null times; the text is complete. Also sent as the header x-morph-timestamps-incomplete: true.

Available options:
true
Example:

true