Convert speech to text in audio and video files with high accuracy.
Configure model parameters
Results from model execution
No output yet
Configure inputs and click generate
1import json2import time34import requests56api_key = "YOUR_API_KEY"7start_url = "https://api.magica.com/api/v1/nodes/ai_transcription/run"8runs_url = "https://api.magica.com/api/v1/nodes/runs/"9headers = {"Authorization": f"Bearer {api_key}"}10MAX_TRANSIENT_RETRIES = 5111213def request_failed(response):14 try:15 body = response.json()16 except ValueError:17 body = None18 detail = body if isinstance(body, dict) else {}19 message = detail.get("message") or detail.get("error") or response.reason20 return RuntimeError(f"Request failed ({response.status_code}): {message}")212223# Start model execution (not retried: a retry could start a second run)24data = {25 "nodeType": "ai_transcription",26 "input": {27 "inputMode": "upload",28 "audioUrl": [29 "https://example.com/audio.mp3"30 ],31 "language": "Auto-detect language",32 "output_format": "text",33 "utterance_split": 0.8,34 "diarize": True,35 "smart_format": True,36 "punctuate": True,37 "paragraphs": True,38 "filler_words": False,39 "numerals": False,40 "measurements": False,41 "dictation": False,42 "profanity_filter": False,43 "multichannel": False,44 "redact": "none"45 }46}4748response = requests.post(start_url, json=data, headers=headers)49if not response.ok:50 raise request_failed(response)51run_id = response.json()["runId"]52print(f"Started run: {run_id}")5354# Poll until the run reaches a terminal status55retries = 056while True:57 poll = requests.get(runs_url + run_id, headers=headers)58 if not poll.ok:59 transient = poll.status_code == 429 or poll.status_code >= 50060 if not transient or retries >= MAX_TRANSIENT_RETRIES:61 raise request_failed(poll)62 retries += 163 time.sleep(2 ** retries)64 continue65 retries = 066 run = poll.json()67 status = run.get("status")6869 if status == "COMPLETED":70 print(json.dumps(run["output"], indent=2))71 break72 elif status == "FAILED":73 raise RuntimeError(f"Run failed: {run.get('error') or 'Unknown error'}")74 elif status == "CANCELED":75 raise RuntimeError("Canceled: the run stopped before it completed")76 elif status not in ("QUEUED", "RUNNING"):77 raise RuntimeError(f"Unexpected run status: {status}")7879 time.sleep(5)
https://api.magica.com/api/v1/nodes/ai_transcription/runinputModestringrequiredChoose how to provide audio — upload a file or paste a social media URL
"upload"audioUrlstring[]requiredUpload the audio or video file you want to transcribe (MP3, MP4, WAV, M4A, WEBM, etc.). Max 2 GB.
[]urlstringrequiredPaste the URL to transcribe
languagestringoptionalMultilingual mode handles mixed speech; choose a language for monolingual audio.
"Auto-detect language"keytermsstringoptionalOne term or phrase per line; no weights. Up to 500 UTF-8 bytes total.
output_formatstringoptionalText preserves the usual transcript. Timestamped adds utterance times. JSON includes word times, confidence, speakers and channels.
"text"utterance_splitnumberoptionalSilence threshold for timestamped or JSON output.
0.8Min: 0.1Max: 10diarizebooleanoptionalIdentify speakers in the transcript.
truesmart_formatbooleanoptionalFormat dates, currency and numbers; requires punctuation and paragraphs.
truepunctuatebooleanoptionalTurning off also disables smart formatting and paragraphs.
trueparagraphsbooleanoptionalTurning off returns continuous text and disables smart formatting.
truefiller_wordsbooleanoptionalKeep uh, um and similar fillers in English audio.
falsenumeralsbooleanoptionalConvert spoken numbers to digits.
falsemeasurementsbooleanoptionalAbbreviate spoken measurement units in English audio.
falsedictationbooleanoptionalInterpret spoken formatting commands in English audio.
falseprofanity_filterbooleanoptionalFilter recognized profanity.
falsemultichannelbooleanoptionalTranscribe each channel separately and retain all channels. Price uses recording duration.
falseredactstringoptionalEntity groups require English audio; number redaction works across languages. Review output before sharing.
"none"The start endpoint returns a runId. Poll GET /v1/nodes/runs/{runId} to check status and get output. When you include a webhook, the response also returns its webhook.signingSecret for Svix signature verification; store it securely and do not send it back as a custom header.
{
"runId": "run_abc123...",
"webhook": {
"signingSecret": "whsec_..."
}
}https://api.magica.com/api/v1/nodes/runs/{runId}Poll every 5 seconds until status is terminal:
{
"id": "run_abc123...",
"nodeType": "ai_transcription",
"status": "COMPLETED",
"output": {
"result": [
"https://..."
],
"creditUsed": 40000
},
"error": null,
"creditUsed": 40000,
"createdAt": "2025-01-01T00:00:00.000Z"
}Add a webhook object to your request body to receive live status updates instead of polling.
{
"webhook": {
"url": "https://your-server.com/webhook",
"events": [
"run.started",
"run.completed",
"run.failed"
],
"metadata": {
"myCustomField": "value"
},
"headers": {
"X-Custom-Header": "value"
}
}
}urlstringrequiredThe URL to receive webhook POST requests.
eventsstring[]optionalFilter which events to receive. Defaults to all events.
metadataobjectoptionalCustom metadata included in every webhook payload.
headersobjectoptionalCustom headers sent with each webhook request.
These headers are separate from Svix's signed svix-* headers.
Webhook Payload Example
{
"type": "run.completed",
"runId": "run_abc123...",
"data": {
"status": "COMPLETED",
"nodeType": "ai_transcription",
"output": {
"result": [
"https://..."
],
"creditUsed": 40000
},
"creditUsed": 40000,
"finishedAt": "2025-01-01T00:00:05.000Z"
}
}