Skip to main content

Get started in five minutes

Step 1: Get your API Key

Your API key is used to authenticate your requests. Follow this link to grab your first API key.

Step 2: Grab an audio file

Grab an audio file of your choice, or download this audio file and save it as sample.mp3 in the same directory where you will save the Python script below.
Our API works best with common audio formats like MP3, WAV, M4A, OGG, WEBM, and FLAC.

Step 3: Install the SDK

pip install fennec-asr

Step 4: Transcribe!

from fennec_asr import FennecASRClient
print(FennecASRClient(api_key="YOUR_API_KEY").transcribe_file(r"sample.mp3"))
Don’t want to use the SDK? See the example code below:
quickstart.py
import os
import time
import requests

BASE_URL = "https://api.fennec-asr.com/api/v1"
API_KEY = "YOUR_API_KEY_HERE" # 👈 Paste your API key here
AUDIO_PATH = "sample.mp3"
POLL_INTERVAL_S = 3

def transcribe_audio():
    if not os.path.exists(AUDIO_PATH):
        print(f"❌ Error: Audio file not found at '{AUDIO_PATH}'.")
        print("   Please make sure the audio file is in the same directory as this script.")
        return

    if "YOUR_API_KEY_HERE" in API_KEY:
        print("❌ Error: Please replace 'YOUR_API_KEY_HERE' with your actual API key.")
        return

    headers = {"X-API-Key": API_KEY}

    with open(AUDIO_PATH, "rb") as audio_file:
        files = {"audio": (os.path.basename(AUDIO_PATH), audio_file, "audio/mpeg")}

        print(f"Submitting '{AUDIO_PATH}' for transcription...")
        try:
            # 1. Submit the job
            submit_response = requests.post(f"{BASE_URL}/transcribe", headers=headers, files=files)
            submit_response.raise_for_status()
            job_id = submit_response.json().get("job_id")
            print(f"✅ Job submitted successfully! Job ID: {job_id}\n")

            # 2. Poll for the result
            status_url = f"{BASE_URL}/transcribe/status/{job_id}"
            while True:
                status_response = requests.get(status_url, headers=headers)
                status_response.raise_for_status()
                data = status_response.json()
                status = data.get("status")

                if status == "completed":
                    print("\n🎉 Transcription Complete!")
                    print("-" * 25)
                    print(data.get("transcript"))
                    print("-" * 25)
                    break
                elif status == "failed":
                    print("\n❌ Transcription failed.")
                    print("Error:", data.get("transcript"))
                    break
                else:
                    print(f"  Current status: '{status}'... waiting.")
                    time.sleep(POLL_INTERVAL_S)

        except requests.exceptions.RequestException as e:
            print(f"An error occurred: {e}")
            if e.response:
                print(f"Response Body: {e.response.text}")

# --- Run the script ---
if __name__ == "__main__":
    transcribe_audio()

Next Steps

Now that you’ve completed your first transcription, you can explore the API’s more powerful features.