Skip to main content
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_123
{
  "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
}

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

X-Api-Key
string
required
Your API key for authentication

Request Parameters

file
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)
device
string
required
Device type making the requestOptions: macos, windows, web_app, api
prediction_id
string
Custom prediction ID for tracking (auto-generated if not provided)Format: pred_ followed by 12 hex charactersExample: pred_9b6ff057a7f7
model
string
default:"stable"
Model version to useOptions:
  • stable - Production model (recommended)
  • stable-latest - Latest stable release
  • dev-v4 - Development model (testing only)

Response

prediction_id
string
required
Unique identifier for this prediction
global
object
required
Overall prediction for the entire audio file
segments
array
required
Per-segment analysis (one per chunk_duration)
model
string
required
Model version used for prediction
processing_time
number
required
Time taken to process in seconds
audio_duration
number
required
Total audio file duration in seconds
warnings
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"

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": "Audio file too short: 2.1s (minimum 3.0s required)",
  "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

CodeDescriptionSolution
400Validation errorCheck file format, duration, parameters
401UnauthorizedVerify API key is valid and active
413File too largeUse /predict/large-file or reduce file size
422Unsupported formatConvert to supported audio format
500Processing failedRetry or contact support if persists
503Service unavailableRetry with exponential backoff

Confidence Score Interpretation

The confidence score indicates how certain the model is about its prediction:
ConfidenceInterpretationAction
0.9 - 1.0Very confidentTrust the result
0.7 - 0.9ConfidentGenerally reliable
0.4 - 0.7ModerateReview segments individually
0.0 - 0.4Low confidenceManual review recommended
For high-security applications, set a threshold of 0.85+ before taking automated actions.

Best Practices

  • Use WAV or FLAC for best accuracy
  • Keep files under 5MB for fastest processing with this endpoint
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)
Track processing_time to identify slow requests:
  • < 2s: Excellent
  • 2-5s: Good
  • 5-10s: Acceptable for large files
  • > 10s: Consider async processing

Rate Limits

PlanRequests/MinuteConcurrent
Free102
Starter605
Professional30020
EnterpriseCustomCustom
Upgrade your plan at app.aurigin.ai/billing for higher limits.

Authorizations

x-api-key
string
header
required

Body

file
file
required
user_id
string

Optional user identifier

Response

OK

error
(string | null)[]

Error messages for each 5-second chunk (null if successful). Aligns 1:1 with the predictions array.

global_probability
number<float>[]

Confidence scores (0.0-1.0) for each prediction, one per 5-second chunk. Aligns 1:1 with the predictions array.

predictions
enum<string>[]

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