Overview
The /predict endpoint analyzes audio files for AI-generated content (deepfakes, voice cloning, text-to-speech). Returns results in real-time for small files.
File Size Limits: This endpoint is optimized for files under 5MB . For larger files, use /predict/large-file (5-100MB) or pre-signed S3 URLs (100MB+).
Authentication
Your API key for authentication
Request Parameters
Audio or video file to analyze Supported formats: WAV, MP3, AAC, FLAC, OGG, M4A, MP4, MOV, AVI, MKVMax size: 5 MB (recommended for fastest processing)
Device type making the request Options: macos, windows, web_app, api
Custom prediction ID for tracking (auto-generated if not provided) Format: pred_ followed by 12 hex charactersExample: pred_9b6ff057a7f7
Model version to use Options:
stable - Production model (recommended)
stable-latest - Latest stable release
dev-v4 - Development model (testing only)
Response
Unique identifier for this prediction
Overall prediction for the entire audio file Confidence score from 0.0 (uncertain) to 1.0 (very confident) Calculated as abs(probability - 0.5) * 2
Classification result:
"bonafide" - Authentic human voice
"spoofed" - AI-generated audio
"partially_spoofed" - Mixed content
null - Unable to determine (see reason)
Explanation when result is null Examples: “Audio quality too poor”, “All chunks in uncertain range”
Per-segment analysis (one per chunk_duration) Segment start time in seconds
Segment end time in seconds
Segment-level confidence (0.0-1.0)
Model version used for prediction
Time taken to process in seconds
Total audio file duration in seconds
List of warnings (e.g., partial chunk failures, quality issues)
Example Request
curl -X POST "https://api.aurigin.ai/v1/predict" \
-H "X-Api-Key: YOUR_API_KEY" \
-F "file=@suspicious_voice.wav" \
-F "device=api" \
-F "model=stable"
Example Response
200 - Spoofed Audio Detected
{
"prediction_id" : "pred_9b6ff057a7f7" ,
"global" : {
"confidence" : 0.95 ,
"result" : "spoofed" ,
"reason" : null
},
"segments" : [
{
"index" : 0 ,
"start" : 0.0 ,
"end" : 5.0 ,
"confidence" : 0.96 ,
"result" : "spoofed"
},
{
"index" : 1 ,
"start" : 5.0 ,
"end" : 10.0 ,
"confidence" : 0.94 ,
"result" : "spoofed"
}
],
"model" : "stable-latest" ,
"processing_time" : 1.23 ,
"audio_duration" : 10.0 ,
"warnings" : []
}
{
"prediction_id" : "pred_abc123def456" ,
"global" : {
"confidence" : 0.92 ,
"result" : "bonafide" ,
"reason" : null
},
"segments" : [
{
"index" : 0 ,
"start" : 0.0 ,
"end" : 5.0 ,
"confidence" : 0.91 ,
"result" : "bonafide"
},
{
"index" : 1 ,
"start" : 5.0 ,
"end" : 8.5 ,
"confidence" : 0.93 ,
"result" : "bonafide"
}
],
"model" : "stable-latest" ,
"processing_time" : 0.87 ,
"audio_duration" : 8.5 ,
"warnings" : []
}
{
"error" : "validation_error" ,
"message" : "Audio file too short: 2.1s (minimum 3.0s required)" ,
"correlation_id" : "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
{
"error" : "unauthorized" ,
"message" : "Invalid or inactive API key" ,
"correlation_id" : "8b738992-c4eb-4f19-870a-900e6830d147"
}
{
"error" : "payload_too_large" ,
"message" : "Request body exceeds maximum allowed size of 5MB" ,
"correlation_id" : "7f629881-a3db-5e28-761b-811f7940c258"
}
Error Codes
Code Description Solution 400 Validation error Check file format, duration, parameters 401 Unauthorized Verify API key is valid and active 413 File too large Use /predict/large-file or reduce file size 422 Unsupported format Convert to supported audio format 500 Processing failed Retry or contact support if persists 503 Service unavailable Retry with exponential backoff
Confidence Score Interpretation
The confidence score indicates how certain the model is about its prediction:
Confidence Interpretation Action 0.9 - 1.0 Very confident Trust the result 0.7 - 0.9 Confident Generally reliable 0.4 - 0.7 Moderate Review segments individually 0.0 - 0.4 Low confidence Manual review recommended
For high-security applications, set a threshold of 0.85+ before taking automated actions.
Best Practices
Check the warnings array for partial failures: "warnings" : [ "3 of 10 segments skipped due to quality issues" ]
If warnings exist, review individual segments for confidence.
Implement exponential backoff for transient errors: import time
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
session = requests.Session()
retry = Retry(
total = 3 ,
backoff_factor = 1 ,
status_forcelist = [ 500 , 502 , 503 , 504 ]
)
adapter = HTTPAdapter( max_retries = retry)
session.mount( 'https://' , adapter)
Rate Limits
Plan Requests/Minute Concurrent Free 10 2 Starter 60 5 Professional 300 20 Enterprise Custom Custom
Body multipart/form-data application/json multipart/form-data application/json
Error messages for each 5-second chunk (null if successful). Aligns 1:1 with the predictions array.
Confidence scores (0.0-1.0) for each prediction, one per 5-second chunk. Aligns 1:1 with the predictions array.
AI detection results for each 5-second chunk of the audio. Array length equals the number of 5-second chunks in the audio file.
Available options:
fake,
real