# AI-voice detection
Source: https://docs.aurigin.ai/api-reference/v1/ai-voice-detection
/api-reference/v1/openapi.json post /predict
Detect whether audio clips are human (`bonafide`) or AI-generated (`spoofed`) and get segment-level confidence scores.
**Designed for quick checks**
- Supported formats: WAV, MP3, AAC, FLAC, OGG, M4A, MP4, MOV, AVI, MKV
**Two ways to send audio**
1. `multipart/form-data` upload with a `file`
2. `application/json` payload with a `presigned_url`
The API automatically analyzes the audio in ~5-second segments and returns both a global verdict and detailed per-segment results.
# Create presigned upload URL
Source: https://docs.aurigin.ai/api-reference/v1/create-presigned-upload-url
/api-reference/v1/openapi.json post /file
Generate presigned upload URLs for one or more objects so files can be streamed directly to storage. Use this when preparing large uploads for the asynchronous workflow.
# Get presigned download URL
Source: https://docs.aurigin.ai/api-reference/v1/get-presigned-download-url
/api-reference/v1/openapi.json get /file
Retrieve presigned download URLs for previously uploaded files. This lets you stream results from storage without routing through the API.
# Introduction
Source: https://docs.aurigin.ai/api-reference/v1/introduction
Start here for the Aurigin API v1 reference
## Welcome to the Aurigin API
The Aurigin API provides powerful audio analysis capabilities for deepfake detection and voice identification. Our REST API is designed for ease of use while providing enterprise-grade performance and reliability.
**Two layers of voice security:**
1. **Deepfake Detection** → Verify if a voice is authentic or AI-generated
2. **Voice Identification (Voice ID)** → Confirm who is speaking by matching against enrolled voiceprints
Together, these capabilities create a comprehensive foundation for voice fraud prevention and identity verification.
## Base URL
All API requests are made to:
```
https://api.aurigin.ai/v1
```
## Authentication
All endpoints require authentication via API key in the `X-Api-Key` header:
```bash theme={null}
curl https://api.aurigin.ai/v1/predict \
-H "X-Api-Key: YOUR_API_KEY"
```
Get your API key from the [Aurigin Dashboard](https://app.aurigin.ai/api)
## Endpoints Overview
### Deepfake Detection Endpoints
| Endpoint | Processing | Use Case |
| ---------- | ------------ | -------------------- |
| `/predict` | Synchronous | Direct file analysis |
| `/file` | Asynchronous | Large files (100MB+) |
### Voice ID Endpoints
| Endpoint | Description | Use Case |
| ----------------- | --------------------------------------- | -------------------------------------- |
| `/voiceid/enroll` | Create a voiceprint from a voice sample | Enroll users for identity verification |
| `/voiceid/verify` | Verify voice identity and authenticity | Authenticate users and prevent fraud |
## Response Format
All successful API responses return JSON with a consistent structure:
```json theme={null}
{
"prediction_id": "pred_abc123def456",
"global": {
"confidence": 0.9921,
"result": "spoofed",
"reason": null
},
"segments": [...],
"model": "stable-latest",
"processing_time": 1.23,
"audio_duration": 10.0,
"warnings": []
}
```
### Key Fields
Unique identifier for tracking this prediction
Overall prediction with confidence score and classification result
Per-segment analysis for timeline-based insights
Model version used for the prediction
## Error Handling
All errors return a consistent error response:
```json theme={null}
{
"error": "error_code",
"message": "Human-readable error message",
"correlation_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```
### Common Error Codes
| Code | Description |
| ---- | ---------------------------------------------- |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 413 | Payload Too Large - File exceeds size limit |
| 422 | Unprocessable Entity - Invalid file format |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Server-side issue |
| 503 | Service Unavailable - Temporary unavailability |
## Versioning
The API uses URL versioning. The current stable version is `v1`:
```
https://api.aurigin.ai/v1
```
API versions are maintained for 6 months after deprecation. You'll receive advance notice of any breaking changes.
## Next Steps
[Create an API key](https://app.aurigin.ai/api) in the dashboard
Try the [Quickstart guide](/quickstart) to analyze your first audio file
Browse the [Deepfake Detection](/api-reference/v1/endpoint/predict) and [Voice ID](/api-reference/v1/endpoint/enroll) documentation
# Enroll voice for identification
Source: https://docs.aurigin.ai/api-reference/voice-id/enroll-voice-for-identification
/api-reference/v1/openapi.json post /voiceid/enroll
Create a unique, non-reversible voiceprint (embedding) for a user or speaker that can later be used for identity verification. This is the foundation for comparing future recordings to a "known" voice profile.
**Requirements:**
- Clean voice sample >= 10 seconds
- Supported formats: WAV, MP3, AAC, FLAC, OGG, M4A
**Note:** Voice prints and audio files are not stored in the first implementation. You must store the returned embedding vector yourself.
# Verify voice identity
Source: https://docs.aurigin.ai/api-reference/voice-id/verify-voice-identity
/api-reference/v1/openapi.json post /voiceid/verify
Verify if a new voice sample matches a previously enrolled voice embedding (belongs to the same speaker) and is not AI-generated.
This endpoint provides a dual-layer trust mechanism:
1. **Voice Matching** - Compares the voice sample against the enrolled voiceprint
2. **Authenticity Detection** - Verifies the voice is not AI-generated
**Requirements:**
- Voice sample to compare
- Previously generated voice vector from `/voiceid/enroll`
- Supported formats: WAV, MP3, AAC, FLAC, OGG, M4A
# Introduction
Source: https://docs.aurigin.ai/index
Detect AI-generated audio with high confidence and simple APIs
## Why Aurigin
Aurigin's API provides dual-layer voice security:
1. **Deepfake Detection** - Instantly verify whether audio is AI-generated by detecting tell-tale acoustic and statistical patterns of AI-generated speech
2. **Voice Identification** - Confirm who is speaking by matching voice samples against enrolled voiceprints
Together, these capabilities enable comprehensive voice fraud prevention and identity verification. Security teams, financial institutions, and platform providers use Aurigin to block fraud, safeguard communications, and maintain trust with their users.
Upload and get predictions in seconds with a single request.
State-of-the-art detection models tuned for real‑world audio.
Clean REST API with copy‑paste examples in Python and Node.js.
API key auth and HTTPS across the stack.
Built on AWS—scale from prototypes to production workloads.
Clear responses and errors designed for quick integrations.
## Get started
Install, upload, and predict in minutes with copy‑paste code.
Endpoints for deepfake detection and voice identification.
## How it works
### Deepfake Detection
1. Send your audio file to `POST /predict`.
2. Receive predictions and confidence scores indicating if the voice is authentic or AI-generated.
### Voice ID
1. Enroll a user's voice with `POST /voiceid/enroll` to create a voiceprint.
2. Verify identity with `POST /voiceid/verify` to match voice samples and detect deepfakes simultaneously.
## Example responses
### Partially Spoofed (Mixed)
```json theme={null}
{
"prediction_id": "pred_c3f91c4e10f3",
"global": {
"confidence": 0.99647911317705393,
"result": "partially_spoofed",
"reason": null
},
"segments": [
{
"index": 0,
"start": 0.0,
"end": 5.0,
"confidence": 0.9998742424242424,
"result": "bonafide"
},
{
"index": 1,
"start": 5.0,
"end": 10.0,
"confidence": 0.9948440790176392,
"result": "spoofed"
},
{
"index": 2,
"start": 10.0,
"end": 15.0,
"confidence": 0.9999675750732422,
"result": "spoofed"
},
{
"index": 3,
"start": 15.0,
"end": 20.0,
"confidence": 0.91984398439526558,
"result": "bonafide"
},
{
"index": 4,
"start": 20.0,
"end": 25.0,
"confidence": 0.9565668821334839,
"result": "spoofed"
},
{
"index": 5,
"start": 25.0,
"end": 30.0,
"confidence": 0.9934345965280663222,
"result": "bonafide"
}
],
"model": "apollo-4-5-2026-03-26",
"processing_time": 11.55466890335083,
"audio_duration": 29.87,
"warnings": []
}
```
## Need help?
Questions or feedback? Reach us at `support@aurigin.ai`.
# Migration guide
Source: https://docs.aurigin.ai/migration
Move from the legacy endpoints to the new versioned base URL
## Why migrate?
Aurigin now exposes versioned endpoints at `https://api.aurigin.ai/{version}`. Moving from the legacy `https://aurigin.ai/api-ext` base URL to the new versioned endpoints gives you:
* A stable base URL shared by every version (`https://api.aurigin.ai`)
* A richer prediction payload with global + per-segment insights
* New endpoints for larger uploads and storage management
* Backwards-compatible timelines so you can cut over safely
This guide compares responses, highlights breaking changes, and shows how to update clients.
## Base URL changes
| Legacy | New versioned |
| ---------------------------- | ------------------------------------- |
| `https://aurigin.ai/api-ext` | `https://api.aurigin.ai/v1` (current) |
Update any hard-coded URLs and SDK configuration to point at the new base URL plus the desired version.
```diff theme={null}
- const BASE_URL = "https://aurigin.ai/api-ext";
+ const BASE_URL = "https://api.aurigin.ai/v1";
- await fetch(`${BASE_URL}/predict`, …)
+ await fetch(`${BASE_URL}/predict`, …)
```
## Response payload differences
### v0 (chunk arrays)
```json theme={null}
{
"predictions": ["fake", "fake", "real"],
"global_probability": [0.9912, 0.9889, 0.9824],
"error": [null, null, null],
"model": "apollo-4-2026-01-16",
"processing_time": 1.35,
"audio_duration": 69.91
}
```
### v1 (rich objects)
```json theme={null}
{
"prediction_id": "pred_abc123def456",
"global": {
"confidence": 0.9921,
"result": "spoofed",
"reason": null
},
"segments": [
{
"index": 0,
"start": 0.0,
"end": 5.0,
"confidence": 0.9898,
"result": "spoofed"
}
],
"model": "apollo-4-5-2026-03-26",
"processing_time": 1.23,
"audio_duration": 10.0,
"warnings": []
}
```
**Key differences**
* v0 returns parallel arrays (`predictions`, `global_probability`, `error`).
* v1 wraps results into structured objects: a `global` verdict and a `segments` array with timing metadata.
* v1 responses always include a `prediction_id` you can use for auditing or async lookups.
* The `warnings` array replaces per-chunk error strings.
## Request changes
* **Upload formats**: both versions accept `multipart/form-data` uploads. v1 also accepts a JSON payload with a `presigned_url`.
* **Device + model metadata**: v1 adds optional `device` and `model` fields for tagging requests. `model` accepts `apollo-4-5-2026-03-26` (latest) or `apollo-4-2026-01-16`, and can be omitted to use the latest available model.
## Endpoint mapping
| v0 endpoint | v1 replacement | Notes |
| -------------------------- | -------------------------- | ------------------------------------------------------------------------- |
| `POST /predict` | `POST /predict` | Same behaviour with richer response fields. |
| `POST /file` / `GET /file` | `POST /file` / `GET /file` | Storage workflows remain, but now surfaced in the `Prediction` tag group. |
> Async uploads via pre-signed URLs are now handled outside of the public v1 spec. Reach out to support if you depend on the old async flow.
## Migration checklist
1. **Switch base URL** to `https://api.aurigin.ai/v1`.
2. **Update response parsing**:
* Map `predictions[n]` -> `segments[n].result`
* Map `global_probability[n]` -> `segments[n].confidence`
* Use `global.confidence` / `global.result` for overall status.
3. **Handle `prediction_id`** for logging or follow-up status checks.
4. **Retire deprecated fields**:
* `error[]` is replaced by `warnings[]`.
* `global_probability[]` is no longer returned.
## Rollout tips
* **Dual-write strategy**: call both v0 and v1 in parallel, compare outputs, then flip traffic once results align.
* **Monitor warnings**: v1 warnings highlight partial failures that used to surface as `error[i]` entries.
* **SDK regeneration**: regenerate clients from the v1 OpenAPI spec to pick up the new response schema automatically.
Still need help? Reach out at [support@aurigin.ai](mailto:support@aurigin.ai).
# Quickstart
Source: https://docs.aurigin.ai/quickstart
Detect AI generated audio in seconds with only a few lines of code
## 1) Get an API key
Create an account and generate an [API key in your dashboard](https://aurigin.ai/app/dashboard/api).
Add it to an environment variable:
```bash theme={null}
export AURIGIN_API_KEY=aurigin_test_1234567890abcdef
```
## 2) Upload a file and get a prediction
Send your audio file directly to `POST /predict`. The API processes your audio in 5-second segments and returns both a global verdict and per-segment results.
```python Python theme={null}
import os
import json
import requests
API_KEY = os.environ.get("AURIGIN_API_KEY", "aurigin_test_1234567890abcdef")
BASE_URL = "https://api.aurigin.ai/v1"
FILE_PATH = "path/to/your/recording.wav" # Replace with the path to your local audio file
with open(FILE_PATH, "rb") as f:
files = {
"file": (os.path.basename(FILE_PATH), f, "audio/wav")
}
r2 = requests.post(f"{BASE_URL}/predict", headers={"x-api-key": API_KEY}, files=files)
print("Multipart response:", r2.status_code, r2.json())
# The response contains predictions for each 5-second chunk of your audio
# For a 15-second file, you'll get 3 predictions: ["fake", "real", "fake"]
```
```javascript Node.js theme={null}
// Node.js 18+
import { readFile } from "node:fs/promises";
import path from "node:path";
const API_KEY = process.env.AURIGIN_API_KEY || 'aurigin_test_1234567890abcdef'
const BASE_URL = 'https://api.aurigin.ai/v1'
const FILE_PATH = 'path/to/your/recording.mp3' // Replace with your local audio file path
const buf = await readFile(FILE_PATH);
const form = new FormData();
form.append("file", new File([buf], path.basename(FILE_PATH), { type: "audio/mpeg" }));
const blob = await new Response(form).blob();
const resp = await fetch(`${BASE_URL}/predict`, {
method: "POST",
headers: {
"x-api-key": API_KEY,
"Content-Type": blob.type,
"Content-Length": String(blob.size),
},
body: blob,
});
if (!resp.ok) {
console.error('Request failed:', resp.status, await resp.text())
} else {
console.log('Multipart response:', await resp.json())
// The response contains predictions for each 5-second chunk of your audio
// For a 15-second file, you'll get 3 predictions: ["fake", "real", "fake"]
}
```
## 3) Voice ID: Enroll and Verify
Voice ID adds identity verification on top of deepfake detection. First, enroll a user's voice to create a voiceprint, then verify if future voice samples match.
### Enroll a Voice
Create a voiceprint from a clean voice sample (>= 10 seconds):
```python Python theme={null}
import os
import json
import requests
API_KEY = os.environ.get("AURIGIN_API_KEY", "aurigin_test_1234567890abcdef")
BASE_URL = "https://api.aurigin.ai/v1"
ENROLLMENT_FILE = "path/to/user_voice_enrollment.wav" # >= 10 seconds
with open(ENROLLMENT_FILE, "rb") as f:
files = {"audio_file": (os.path.basename(ENROLLMENT_FILE), f, "audio/wav")}
data = {"user_id": "john_doe"}
response = requests.post(
f"{BASE_URL}/voiceid/enroll",
headers={"x-api-key": API_KEY},
files=files,
data=data
)
result = response.json()
embedding_vector = result["embedding"]
# Store the embedding vector securely for future verification
print(f"Enrollment successful! Embedding dimension: {len(embedding_vector)}")
print(f"Model: {result['model_version']}")
print(f"Processing time: {result['processing_time']:.2f}s")
# Save embedding for later use
with open("user_voiceprint.json", "w") as out:
json.dump(embedding_vector, out)
```
```javascript Node.js theme={null}
import { readFile } from "node:fs/promises";
import path from "node:path";
import FormData from "form-data";
import fs from "fs";
const API_KEY = process.env.AURIGIN_API_KEY || 'aurigin_test_1234567890abcdef'
const BASE_URL = 'https://api.aurigin.ai/v1'
const ENROLLMENT_FILE = 'path/to/user_voice_enrollment.wav' // >= 10 seconds
const form = new FormData();
form.append('audio_file', fs.createReadStream(ENROLLMENT_FILE));
form.append('user_id', 'john_doe');
const response = await fetch(`${BASE_URL}/voiceid/enroll`, {
method: 'POST',
headers: {
'x-api-key': API_KEY,
...form.getHeaders()
},
body: form
});
const result = await response.json();
const embeddingVector = result.embedding;
console.log(`Enrollment successful! Embedding dimension: ${embeddingVector.length}`);
console.log(`Model: ${result.model_version}`);
console.log(`Processing time: ${result.processing_time.toFixed(2)}s`);
// Save embedding for later use
await fs.promises.writeFile(
'user_voiceprint.json',
JSON.stringify(embeddingVector)
);
```
### Verify a Voice
Compare a new voice sample against the enrolled voiceprint:
```python Python theme={null}
import os
import json
import requests
API_KEY = os.environ.get("AURIGIN_API_KEY", "aurigin_test_1234567890abcdef")
BASE_URL = "https://api.aurigin.ai/v1"
VERIFICATION_FILE = "path/to/verification_sample.wav"
# Load the stored embedding vector
with open("user_voiceprint.json", "r") as f:
embedding_vector = json.load(f)
with open(VERIFICATION_FILE, "rb") as f:
files = {"audio_file": (os.path.basename(VERIFICATION_FILE), f, "audio/wav")}
data = {
"voice_vector": json.dumps(embedding_vector),
"user_id": "john_doe"
}
response = requests.post(
f"{BASE_URL}/voiceid/verify",
headers={"x-api-key": API_KEY},
files=files,
data=data
)
result = response.json()
print(f"Is Match: {result['is_match']}")
print(f"Similarity Score: {result['similarity_score']:.2%}")
print(f"Confidence Score: {result['confidence_score']:.2%}")
print(f"Model Version: {result['model_version']}")
print(f"Processing Time: {result['processing_time']:.2f}s")
if result['deepfake_score'] is not None:
print(f"Deepfake Score: {result['deepfake_score']:.2%}")
# Make authentication decision
if result['is_match'] and result['similarity_score'] >= 0.85:
print("✅ Authentication successful!")
else:
print("❌ Authentication failed - require additional verification")
```
```javascript Node.js theme={null}
import { readFile } from "node:fs/promises";
import FormData from "form-data";
import fs from "fs";
const API_KEY = process.env.AURIGIN_API_KEY || 'aurigin_test_1234567890abcdef'
const BASE_URL = 'https://api.aurigin.ai/v1'
const VERIFICATION_FILE = 'path/to/verification_sample.wav'
// Load the stored embedding vector
const embeddingVector = JSON.parse(
await fs.promises.readFile('user_voiceprint.json', 'utf8')
);
const form = new FormData();
form.append('audio_file', fs.createReadStream(VERIFICATION_FILE));
form.append('voice_vector', JSON.stringify(embeddingVector));
form.append('user_id', 'john_doe');
const response = await fetch(`${BASE_URL}/voiceid/verify`, {
method: 'POST',
headers: {
'x-api-key': API_KEY,
...form.getHeaders()
},
body: form
});
const result = await response.json();
console.log(`Is Match: ${result.is_match}`);
console.log(`Similarity Score: ${(result.similarity_score * 100).toFixed(2)}%`);
console.log(`Confidence Score: ${(result.confidence_score * 100).toFixed(2)}%`);
console.log(`Model Version: ${result.model_version}`);
console.log(`Processing Time: ${result.processing_time.toFixed(2)}s`);
if (result.deepfake_score !== null) {
console.log(`Deepfake Score: ${(result.deepfake_score * 100).toFixed(2)}%`);
}
// Make authentication decision
if (result.is_match && result.similarity_score >= 0.85) {
console.log('✅ Authentication successful!');
} else {
console.log('❌ Authentication failed - require additional verification');
}
```
## Errors
Check your API key and file size before making requests.
| Code | Description |
| ----- | ----------------------------------------- |
| `400` | Invalid input or file too large |
| `403` | Authentication failed (check `x-api-key`) |
| `500` | Internal error or upstream unavailability |
## Next Steps
Learn more about detecting AI-generated audio
Explore voice enrollment and verification