Choose between Best and Nano based on the cost and performance tradeoffs best suited for your application.
Quickstart
The following example transcribes an audio file from a URL.Example output
Word-level timestamps
The response also includes an array with information about each word:Transcript status
After you’ve submitted a file for transcription, your transcript has one of the following statuses:Status | Description |
---|---|
processing | The audio file is being processed. |
queued | The audio file is waiting to be processed. |
completed | The transcription has completed successfully. |
error | An error occurred while processing the audio file. |
Handling errors
If the transcription fails, the status of the transcript iserror
, and the transcript includes an error
property explaining what went wrong.
A transcription may fail for various reasons:
- Unsupported file format
- Missing audio in file
- Unreachable audio URL
Select the speech model with Best and Nano
We use a combination of models to produce your results. You can select the class of models to use in order to make cost-performance tradeoffs best suited for your application. You can visit our for more information on our model tiers.Name | SDK Parameter | Description |
---|---|---|
Best (default) | aai.SpeechModel.best | Use our most accurate and capable models with the best results, recommended for most use cases. |
Nano | aai.SpeechModel.nano | Use our less accurate, but much lower cost models to produce your results. |
speech_model
in the transcription config:
Automatic punctuation and casing
By default, the API automatically punctuates the transcription text and formats proper nouns, as well as converts numbers to their numerical form. To disable punctuation and text formatting, setpunctuate
and format_text
to False
in the transcription config.
Automatic language detection
Identify the dominant language spoken in an audio file and use it during the transcription. Enable it to detect any of the supported languages. To reliably identify the dominant language, the file must contain at least 50 seconds of spoken audio. To enable it, setlanguage_detection
to True
in the transcription config.
By performing automatic language detection on a small chunk of audio first, you can then select between the Best or Nano model depending on the detected language. To learn more, see Separating automatic language detection from transcription.
Confidence score
If language detection is enabled, the API returns a confidence score for the detected language. The score ranges from 0.0 (low confidence) to 1.0 (high confidence).Set a language confidence threshold
You can set the confidence threshold that must be reached if language detection is enabled. An error will be returned if the language confidence is below this threshold. Valid values are in the range [0,1] inclusive.For a workflow that resubmits a transcription request using a default language if the threshold is not reached, see this cookbook.
Set language manually
If you already know the dominant language, you can use thelanguage_code
key to specify the language of the speech in your audio file.
Custom spelling
Custom Spelling lets you customize how words are spelled or formatted in the transcript. To use Custom Spelling, pass a dictionary toset_custom_spelling()
on the transcription config. Each key-value pair specifies a mapping from a word or phrase to a new spelling or format. The key specifies the new spelling or format, and the corresponding value is the word or phrase you want to replace.
The value in the
to
key is case-sensitive, but the value in the from
key isn’t. Additionally, the to
key must only contain one word, while the from
key can contain multiple words.Custom vocabulary
To improve the transcription accuracy, you can boost certain words or phrases that appear frequently in your audio file. To boost words or phrases, include theword_boost
parameter in the transcription config.
You can also control how much weight to apply to each keyword or phrase. Include boost_param
in the transcription config with a value of low
, default
, or high
.
Follow formatting guidelines for custom vocabulary to ensure the best results:
- Remove all punctuation except apostrophes.
- Make sure each word is in its spoken form. For example,
iphone seven
instead ofiphone 7
. - Remove spaces between letters in acronyms.
Multichannel transcription
If you have a multichannel audio file with multiple speakers, you can transcribe each of them separately. To enable it, setmultichannel
to true
in your transcription config.
Multichannel audio increases the transcription time by approximately 25%.The response includes an
audio_channels
property with the number of different channels, and an additional utterances
property, containing a list of turn-by-turn utterances.Each utterance contains channel information, starting at 1.Additionally, each word in the words
array contains the channel identifier.Dual-channel transcription
Dual-channel is a legacy feature. Use Multichannel instead.
Export SRT or VTT caption files
You can export completed transcripts in SRT or VTT format, which can be used for subtitles and closed captions in videos. You can also customize the maximum number of characters per caption by specifying thechars_per_caption
parameter.
Export paragraphs and sentences
You can retrieve transcripts that are automatically segmented into paragraphs or sentences, for a more reader-friendly experience. The text of the transcript is broken down by either paragraphs or sentences, along with additional metadata.Filler words
The following filler words are removed by default:- “um”
- “uh”
- “hmm”
- “mhm”
- “uh-huh”
- “ah”
- “huh”
- “hm”
- “m”
disfluencies
to true
in the transcription config.
Profanity filtering
You can automatically filter out profanity from the transcripts by settingfilter_profanity
to true
in your transcription config.
Any profanity in the returned text
will be replaced with asterisks.
Profanity filter isn’t perfect. Certain words may still be missed or improperly filtered.
Set the start and end of the transcript
If you only want to transcribe a portion of your file, you can set theaudio_start_from
and the audio_end_at
parameters in your transcription config.
Speech threshold
To only transcribe files that contain at least a specified percentage of spoken audio, you can set thespeech_threshold
parameter. You can pass any value between 0 and 1.
If the percentage of speech in the audio file is below the provided threshold, the value of text
is None
and the response contains an error
message:
Word search
You can search through a completed transcript for a specific set of keywords, which is useful for quickly finding relevant information. The parameter can be a list of words, numbers, or phrases up to five words.Delete transcripts
You can remove the data from the transcript and mark it as deleted.Starting on 11-26-2024, the platform will assign an account-level Time to Live (TTL) for customers who have executed a Business Associate Agreement (BAA) with AssemblyAI. For those customers, all transcripts generated via the async transcription endpoint will be deleted after the TTL period.As of the feature launch date:
- The TTL is set to 3 days (subject to change).
- Customers can still manually delete transcripts before the TTL period by using the deletion endpoint. However, they cannot keep transcripts on the platform after the TTL period has expired.
API reference
You can find the API reference here.Troubleshooting
How can I make certain words more likely to be transcribed?
How can I make certain words more likely to be transcribed?
You can include words, phrases, or both in the
word_boost
parameter. Any term included has its likelihood of being transcribed boosted.Can I customize how words are spelled by the model?
Can I customize how words are spelled by the model?
Yes. The Custom Spelling feature gives you the ability to specify how words are spelled or formatted in the transcript text. For example, Custom Spelling could be used to change the spelling of all instances of the word “Ariana” to “Arianna”. It could also be used to change the formatting of “CS 50” to “CS50”.
Why am I receiving a 400 Bad Request error when making an API request?
Why am I receiving a 400 Bad Request error when making an API request?
A “400 Bad Request” error typically indicates that there’s a problem with the formatting or content of the API request. Double-check the syntax of your request and ensure that all required parameters are included as described in the API reference. If the issue persists, contact our support team for assistance.