Transcribe an audio file with the ElevenLabs Scribe API
Send a recording to Scribe v2 and use the returned text, word timestamps and speaker labels to review the transcript.
What you will create
Turn a short audio file into locally saved text and locate passages that need another listen. This method uses Python and an API: it suits a future integration into your own workflow rather than someone looking only for a button in an editor.
The video shows Node.js; the written example below uses Python.
Before you start
Prepare Python, a non-confidential test recording and an ElevenLabs key stored in the ELEVENLABS_API_KEY environment variable. Do not put the key in code, screenshots or browser scripts. Check pricing and usage limits before the test: a request can consume credits.
The script uses scribe_v2, the model in this existing tutorial, not a realtime model. Install the elevenlabs Python package with python -m pip install elevenlabs in your project environment. The following procedure sends the file to the provider.
Step-by-step
- Create a checkable test. Record a few sentences containing a fictional name, a number and a negative statement. Keep the intended wording for comparison.
- Prepare the files. Place sample.mp3 alongside the script and set the secret environment variable using your usual method. Do not paste it into the Python file.
- Submit once. The script checks for the file and key before the request, asks for speaker labels and writes the text to transcript.txt.
- Use the markers. Words can include a start, end and speaker identifier. This identifier distinguishes voices; it does not establish the person's real name.
- Review before automating. Correct uncertain passages in a copy and keep the original transcript. Do not turn an uncertain interpretation into a confirmed fact.
Example to adapt
Record this fictional sentence: “Nora orders twelve notebooks, not twenty. Delivery is still to be confirmed.” A successful test preserves the quantity, negative statement and uncertainty. The example script below has not been run against an ElevenLabs account.
import os
from pathlib import Path
from elevenlabs.client import ElevenLabs
source = Path('sample.mp3')
if not source.is_file():
raise SystemExit('Missing sample.mp3')
secret = os.environ.get('ELEVENLABS_API_KEY')
if not secret:
raise SystemExit('Missing ELEVENLABS_API_KEY')
client = ElevenLabs(api_key=secret)
with source.open('rb') as recording:
result = client.speech_to_text.convert(
file=recording, model_id='scribe_v2', diarize=True
)
Path('transcript.txt').write_text(result.text, encoding='utf-8')
for item in result.words or []:
if item.type == 'word':
print(item.start, item.end, item.speaker_id, item.text)
Check your result
- transcript.txt contains readable UTF-8 text.
- Numbers and negative statements match the recording.
- The markers help locate uncertain passages.
- A second voice is not automatically treated as a verified real-world identity.
Common problems
Missing file: check the folder from which you run Python. Missing or rejected key: check configuration without displaying the secret. Interrupted request: review usage before retrying instead of adding a retry loop. Plausible but incorrect wording: listen to the source again; transcription does not verify the substance of a statement.
Next steps
Explore ElevenLabs on QAILT. To translate a recording's voices rather than transcribe its speech, follow the dubbing tutorial.








