AI-voice detection
curl --request POST \
--url https://api.aurigin.ai/v0/predict \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file=@example-file \
--form user_id=speaker_123import requests
url = "https://api.aurigin.ai/v0/predict"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "user_id": "speaker_123" }
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '(binary audio file)');
form.append('user_id', 'speaker_123');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.aurigin.ai/v0/predict', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aurigin.ai/v0/predict",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary audio file)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_id\"\r\n\r\nspeaker_123\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aurigin.ai/v0/predict"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary audio file)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_id\"\r\n\r\nspeaker_123\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aurigin.ai/v0/predict")
.header("x-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary audio file)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_id\"\r\n\r\nspeaker_123\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aurigin.ai/v0/predict")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary audio file)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_id\"\r\n\r\nspeaker_123\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"predictions": [
"fake",
"fake",
"real"
],
"global_probability": [
0.9584,
0.9585,
0.9123
],
"error": [
null,
null,
null
],
"model": "apollo-4-2025-10-20",
"processing_time": 1.350719928741455,
"audio_duration": 69.91
}{
"error": "validation_error",
"message": "Audio file too large (max 4MB)",
"status": 400,
"correlation_id": "d3a1cb06-23a3-4f8a-a955-7ed2df41b5b7"
}{
"error": "unauthorized",
"message": "Invalid x-api-key header",
"status": 403,
"correlation_id": "12b52e74-7a57-4d85-aa2b-7b9158f09ef9"
}{
"error": "internal_error",
"message": "Upstream model timed out",
"status": 500,
"correlation_id": "f906f85c-4b63-4f25-a93d-392d8fd521fb"
}Analyze Audio
Detect AI-generated audio with real-time deepfake analysis
POST
/
predict
AI-voice detection
curl --request POST \
--url https://api.aurigin.ai/v0/predict \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file=@example-file \
--form user_id=speaker_123import requests
url = "https://api.aurigin.ai/v0/predict"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "user_id": "speaker_123" }
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '(binary audio file)');
form.append('user_id', 'speaker_123');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.aurigin.ai/v0/predict', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aurigin.ai/v0/predict",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary audio file)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_id\"\r\n\r\nspeaker_123\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aurigin.ai/v0/predict"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary audio file)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_id\"\r\n\r\nspeaker_123\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aurigin.ai/v0/predict")
.header("x-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary audio file)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_id\"\r\n\r\nspeaker_123\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aurigin.ai/v0/predict")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n(binary audio file)\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_id\"\r\n\r\nspeaker_123\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"predictions": [
"fake",
"fake",
"real"
],
"global_probability": [
0.9584,
0.9585,
0.9123
],
"error": [
null,
null,
null
],
"model": "apollo-4-2025-10-20",
"processing_time": 1.350719928741455,
"audio_duration": 69.91
}{
"error": "validation_error",
"message": "Audio file too large (max 4MB)",
"status": 400,
"correlation_id": "d3a1cb06-23a3-4f8a-a955-7ed2df41b5b7"
}{
"error": "unauthorized",
"message": "Invalid x-api-key header",
"status": 403,
"correlation_id": "12b52e74-7a57-4d85-aa2b-7b9158f09ef9"
}{
"error": "internal_error",
"message": "Upstream model timed out",
"status": 500,
"correlation_id": "f906f85c-4b63-4f25-a93d-392d8fd521fb"
}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: For very large files (100MB+), use pre-signed S3 URLs for asynchronous processing.
Authentication
string
required
Your API key for authentication
Request Parameters
file
required
Audio or video file to analyzeSupported formats: WAV, MP3, AAC, FLAC, OGG, M4A, MP4, MOV, AVI, MKVMax size: 5 MB (recommended for fastest processing)
string
required
Device type making the requestOptions:
macos, windows, web_app, apistring
Custom prediction ID for tracking (auto-generated if not provided)Format:
pred_ followed by 12 hex charactersExample: pred_9b6ff057a7f7string
default:"stable"
Model version to useOptions:
stable- Production model (recommended)stable-latest- Latest stable releasedev-v4- Development model (testing only)
Response
string
required
Unique identifier for this prediction
object
required
Overall prediction for the entire audio file
Show properties
Show properties
number
Confidence score from 0.0 (uncertain) to 1.0 (very confident)Calculated as
abs(probability - 0.5) * 2string
Classification result:
"bonafide"- Authentic human voice"spoofed"- AI-generated audio"partially_spoofed"- Mixed contentnull- Unable to determine (seereason)
string
Explanation when
result is nullExamples: “Audio quality too poor”, “All chunks in uncertain range”array
required
string
required
Model version used for prediction
number
required
Time taken to process in seconds
number
required
Total audio file duration in seconds
array
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"
import requests
url = "https://api.aurigin.ai/v1/predict"
headers = {"X-Api-Key": "YOUR_API_KEY"}
files = {"file": open("suspicious_voice.wav", "rb")}
data = {
"device": "api",
"model": "stable"
}
response = requests.post(url, headers=headers, files=files, data=data)
result = response.json()
print(f"Result: {result['global']['result']}")
print(f"Confidence: {result['global']['confidence']:.2%}")
const FormData = require('form-data');
const fs = require('fs');
const axios = require('axios');
const form = new FormData();
form.append('file', fs.createReadStream('suspicious_voice.wav'));
form.append('device', 'api');
form.append('model', 'stable');
const response = await axios.post(
'https://api.aurigin.ai/v1/predict',
form,
{
headers: {
'X-Api-Key': 'YOUR_API_KEY',
...form.getHeaders()
}
}
);
console.log(`Result: ${response.data.global.result}`);
console.log(`Confidence: ${response.data.global.confidence}`);
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": []
}
200 - Authentic Audio
{
"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": []
}
400 - Validation Error
{
"error": "validation_error",
"message": "Unsupported audio format",
"correlation_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
401 - Unauthorized
{
"error": "unauthorized",
"message": "Invalid or inactive API key",
"correlation_id": "8b738992-c4eb-4f19-870a-900e6830d147"
}
413 - File Too Large
{
"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 | Reduce file size or use pre-signed S3 URLs |
| 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
Theconfidence 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
Optimize Performance
Optimize Performance
- Use WAV or FLAC for best accuracy
- Keep files under 5MB for fastest processing with this endpoint
Handle Partial Results
Handle Partial Results
Check the If warnings exist, review individual segments for confidence.
warnings array for partial failures:"warnings": ["3 of 10 segments skipped due to quality issues"]
Retry Logic
Retry Logic
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)
Monitor Performance
Monitor Performance
Track
processing_time to identify slow requests:- < 2s: Excellent
- 2-5s: Good
- 5-10s: Acceptable for large files
- > 10s: Consider async processing
Rate Limits
| Plan | Requests/Minute | Concurrent |
|---|---|---|
| Free | 10 | 2 |
| Starter | 60 | 5 |
| Professional | 300 | 20 |
| Enterprise | Custom | Custom |
Upgrade your plan at app.aurigin.ai/billing for higher limits.
Related Endpoints
Pre-Signed URLs
Asynchronous processing for large files (100MB+)
Authorizations
Response
OK
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