How It Works
This feature is controlled by two parameters you send in your/transcribe request. When enabled, the initial transcript is chunked and analyzed by the AI, which uses your provided context to identify and fix errors.
boolean
default:"false"
Set this to
true to enable the secondary AI correction pass. If false, this feature is skipped entirely.string
A string of text providing hints to the AI. This is where you should include correct spellings of names, products, or technical terms that the ASR might mishear.
Performance Impact: Enabling contextual correction adds processing time (latency) and increases the cost of the transcription. Use it when accuracy for specific terms is critical.
How to Use It
Using the feature is as simple as adding two fields to yourmultipart/form-data request.
Python SDK Example
Example Result
Contextual correction can fix errors that would be impossible to resolve without external knowledge.Before Correction
Transcript:
After Correction
Context Provided:
The company they are talking about is called Bartholomew Bros, correct any potential misinterpretations in the script.Transcript:Deeper Use Cases
This feature is also very useful for dynamic formatting work and subtle adjustments to anything in the text:Before Contextual Adjustment
Transcript:
After Contextual Adjustment
Context Provided:
De-capitalize all proper nouns, unless they are the start of a sentenceTranscript:Code Samples
Code Samples
Add the parameters to your request
Include context and apply_contextual_correction in the data part of your call.A Full Example (quickstart_context.py)
URL Example
URL Example
URL Sample Script (quickstart_context_url.py)
Tips for Writing Effective Context
- Be Specific: Instead of writing “The book is called ‘Agoraphobia in Romanesque Society’” in the context field, write “The book being talked about is ‘Agoraphobia in Romanesque Society’, please ensure that anything that seems like it could be a misinterpretation of the title is replaced with this book title. Also, anytime someone says an abbreviation of the title (ARS) or what sounds like an abbreviation, replace it with the title.”
- Provide Correct Spellings: Include a list of correctly spelled names and jargon, e.g., “Key terms to replace in this script: OAuth 2.0, Kubernetes, FastAPI, Pydantic.”
- Keep it Concise: A few clear sentences are more effective than a long, rambling paragraph. Specific examples are helpful as well.