Skip to main content
POST
Transcribe audio
For a guided tour with runnable examples, see Speech to Text.

Overview

POST /v1/audio/transcriptions is a drop-in for OpenAI’s endpoint: the OpenAI SDK works with the base URL set to https://api.morphllm.com/v1 and model set to morph-transcribe or morph-transcribe-live. Upload the audio as multipart file, or send a JSON body with an https url.

Options

Beyond OpenAI’s fields, keyterms[], style, diarize, tag_audio_events and url are Morph extensions. Options combine: each sets one clause of the model card’s instruction. Only a contradictory request returns a 400: timestamps without verbose_json, stream with verbose_json, srt, vtt or diarize, or transcription options on morph-transcribe-live. There is no system prompt. morph-transcribe-live takes file or url, language, response_format (json, text, verbose_json) and stream only.

Responses

With stream: true (json or text only) the response is text/event-stream: transcript.text.delta events with delta, then one transcript.text.done with text and usage (type: "tokens"). There is no [DONE] line. usage is {"type": "duration", "seconds", "input_tokens", "output_tokens"}. Input tokens are the audio only, ceil(seconds x 12.5) (45,000 per audio hour); instruction, prompt and keyterm tokens are not billed, and output tokens are free. With diarize, text stays plain and speakers come back as segments (speaker, start, end, text). A transcript that ends before the audio does carries "truncated": true and x-morph-truncated: true: it hit the output cap of ceil(audio seconds x 16) + 256 tokens, or the model stopped transcribing and the text was cut there. Word times are returned only when they cover the whole transcript. When they cannot be placed for every word, the response keeps text and segments (with start and end set to null), leaves out words, and carries "timestamps_incomplete": true and x-morph-timestamps-incomplete: true; srt and vtt return a 422 instead.

Limits and errors

60 minutes and 180 MB per request, one file. Errors use the OpenAI envelope {"error": {"message", "type", "param", "code"}}: 400 invalid request, 401 invalid_api_key, 402 monthly_quota_exceeded, 413 file_too_large or audio_too_long, 422 timestamps_unavailable (srt or vtt when word times could not be placed; not billed), 429 rate_limit_exceeded (your limit, or speech capacity is full), 502 engine failure. Every response carries x-request-id.

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 transcription options.

A multipart upload: the audio file and the options. Options combine; only a request that contradicts itself is refused, such as timestamps without verbose_json or a streamed srt.

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

morph-transcribe for files with every option, or morph-transcribe-live, the streaming model, for a plain transcript: it refuses prompt, keyterms, style, speaker labels, events and timestamps.

Available options:
morph-transcribe,
morph-transcribe-live
Example:

"morph-transcribe"

language
string

ISO 639-1 code of the spoken language, or a locale such as en-US. Omit it to let the model work it out. morph-transcribe takes ar, bg, bn, cs, da, de, el, en, es, et, fi, fr, he, hi, hr, hu, id, it, ja, ko, lt, lv, mr, mt, nl, pl, pt, ro, ru, sk, sl, sv, ta, te, th, tl, tr, uk, vi, zh; morph-transcribe-live takes the locales listed on the speech to text page.

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."

style
enum<string>

verbatim (default) keeps fillers and repetitions. clean removes fillers and accidental repetitions and keeps the rest of the wording.

Available options:
verbatim,
clean
Example:

"clean"

diarize
boolean

Label speakers. text stays plain; speakers come back as segments (speaker, start, end, text) in json and verbose_json, and with timestamps each word carries speaker.

Example:

true

tag_audio_events
boolean

Keep non-speech event and speaking style tags (<ev:*>, <sty:*>) in the text.

Example:

false

response_format
enum<string>

json (default): text and usage, plus speaker segments with diarize. text: the transcript as plain text. verbose_json: adds task, language, duration, and with timestamps the words and segments. srt and vtt: subtitles cut from word timestamps.

Available options:
json,
text,
verbose_json,
srt,
vtt
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:
timestamp_granularities[]
enum<string>[]

Ask for timestamps. Either value returns both words and segments. Requires verbose_json.

Available options:
word,
segment
Example:

Response

The transcript in the requested response_format, 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