A production-ready REST API that accurately detects whether a given voice recording is AI-generated or Human.
Built for the AI-Generated Voice Detection Challenge with specific support for Tamil, English, Hindi, Malayalam, and Telugu.
nii-yamagishilab/mms-300m-anti-deepfake) derived from XLS-R, supporting 100+ languages including Indic languages.x-api-key header authentication.nii-yamagishilab/mms-300m-anti-deepfake)pydub (ffmpeg) + librosapydub).
sudo apt install ffmpeg# Create virtual environment
python3 -m venv venv
# Activate
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Create virtual environment
python -m venv venv
# Activate
.\venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Create a .env file in the root directory:
API_KEY=test-key-123
Universal Command:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
The server will start at http://localhost:8000.
POST /api/voice-detection| Key | Value |
|---|---|
x-api-key | your-secret-key-123 |
Content-Type | application/json |
{
"language": "Tamil",
"audioFormat": "mp3",
"audioBase64": "<BASE64_ENCODED_MP3_STRING>"
}
{
"status": "success",
"language": "Tamil",
"classification": "HUMAN",
"confidenceScore": 0.98,
"explanation": "High pitch variance and natural prosody detected."
}
We have a built-in test suite that verifies the audio pipeline and model inference:
python verify_pipeline.py
To test the actual running server with a real generated MP3 file:
# Ensure server is running in another terminal first!
python test_api.py
curl -X POST http://127.0.0.1:8000/api/voice-detection \
-H "x-api-key: your-secret-key-123" \
-H "Content-Type: application/json" \
-d '{
"language": "English",
"audioFormat": "mp3",
"audioBase64": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU2LjM2LjEwMAAAAAAA..."
}'
voice-detector/
βββ app/
β βββ main.py # API Entry point & Routes
β βββ infer.py # Model Inference Logic (XLS-R + Classifier)
β βββ audio.py # Audio Normalization (Base64 -> 16kHz WAV)
β βββ auth.py # Utilities
βββ model/ # Model weights storage
βββ requirements.txt # Python dependencies
βββ .env # Config keys
βββ verify_pipeline.py# System health check script
βββ test_api.py # Live API integration test
[Embedding (1024) + Pitch (1)] to predict AI_GENERATED or HUMAN.28 commits
Python
98.7%
Dockerfile
1.3%
A production-ready REST API that accurately detects whether a given voice recording is AI-generated or Human.
Built for the AI-Generated Voice Detection Challenge with specific support for Tamil, English, Hindi, Malayalam, and Telugu.
nii-yamagishilab/mms-300m-anti-deepfake) derived from XLS-R, supporting 100+ languages including Indic languages.x-api-key header authentication.nii-yamagishilab/mms-300m-anti-deepfake)pydub (ffmpeg) + librosapydub).
sudo apt install ffmpeg# Create virtual environment
python3 -m venv venv
# Activate
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Create virtual environment
python -m venv venv
# Activate
.\venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Create a .env file in the root directory:
API_KEY=test-key-123
Universal Command:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
The server will start at http://localhost:8000.
POST /api/voice-detection| Key | Value |
|---|---|
x-api-key | your-secret-key-123 |
Content-Type | application/json |
{
"language": "Tamil",
"audioFormat": "mp3",
"audioBase64": "<BASE64_ENCODED_MP3_STRING>"
}
{
"status": "success",
"language": "Tamil",
"classification": "HUMAN",
"confidenceScore": 0.98,
"explanation": "High pitch variance and natural prosody detected."
}
We have a built-in test suite that verifies the audio pipeline and model inference:
python verify_pipeline.py
To test the actual running server with a real generated MP3 file:
# Ensure server is running in another terminal first!
python test_api.py
curl -X POST http://127.0.0.1:8000/api/voice-detection \
-H "x-api-key: your-secret-key-123" \
-H "Content-Type: application/json" \
-d '{
"language": "English",
"audioFormat": "mp3",
"audioBase64": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU2LjM2LjEwMAAAAAAA..."
}'
voice-detector/
βββ app/
β βββ main.py # API Entry point & Routes
β βββ infer.py # Model Inference Logic (XLS-R + Classifier)
β βββ audio.py # Audio Normalization (Base64 -> 16kHz WAV)
β βββ auth.py # Utilities
βββ model/ # Model weights storage
βββ requirements.txt # Python dependencies
βββ .env # Config keys
βββ verify_pipeline.py# System health check script
βββ test_api.py # Live API integration test
[Embedding (1024) + Pitch (1)] to predict AI_GENERATED or HUMAN.28 commits
Python
98.7%
Dockerfile
1.3%