> For AI agents: the documentation index is at https://platform.detectif.ai/llms.txt. Every page is also available as Markdown by adding `.md` to its path.

# Deepfake detection

Find out whether a voice is real or AI-generated. Check a recording with one request, or check a phone call while it happens over a WebSocket, from Twilio, Plivo, Telnyx, Exotel, Vonage, FreeSWITCH or your own code.

**Is this a real voice?** Deepfake detection (the Aletheia model) checks speech for signs that it was generated by AI, and answers `real` or `fake`. Use it in three ways, with the same API key:

| Way | You send | You get | Section |
|---|---|---|---|
| Recording | One audio file, up to 5 minutes | One verdict, plus a verdict for each part of the recording | [Check a recording](#detect-ai-generated-speech) |
| Live phone call | The call's audio, over a WebSocket, while the call runs | An early verdict when the start is already clear, live verdicts every few seconds, a final verdict when the call ends; on the socket and as webhooks | [Live call streams](https://platform.detectif.ai/docs/live-call-streams/) |
| AI assistant | A recording, through MCP | The verdict, explained by the assistant | [MCP tools](#mcp-tools) |

## Quickstart

Create an API key in the dashboard (see [Get started](https://platform.detectif.ai/docs/#quickstart)), then send a recording as the multipart field `file`:

```bash
curl https://platform.detectif.ai/v1/deepfake/detect \
  -H "Authorization: Bearer $DETECTIF_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@clip.wav"
```

```python
import os
import uuid

import requests

with open("clip.wav", "rb") as f:
    resp = requests.post(
        "https://platform.detectif.ai/v1/deepfake/detect",
        headers={
            "Authorization": f"Bearer {os.environ['DETECTIF_API_KEY']}",
            "Idempotency-Key": str(uuid.uuid4()),
        },
        files={"file": f},
        timeout=300,
    )
resp.raise_for_status()
result = resp.json()["result"]
print(result["verdict"], result["score"])
```

```javascript
import { readFile } from "node:fs/promises";
import { randomUUID } from "node:crypto";

const form = new FormData();
form.append("file", new Blob([await readFile("clip.wav")]), "clip.wav");
const res = await fetch("https://platform.detectif.ai/v1/deepfake/detect", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.DETECTIF_API_KEY}`,
    "Idempotency-Key": randomUUID(),
  },
  body: form,
});
const { result } = await res.json();
console.log(result.verdict, result.score);
```

Send the same `Idempotency-Key` when you retry, and you get the stored result back instead of a second check.

## Read the result

Example response, shortened:

```json
{
  "request_id": "req_8f14e45fceea167a5a36dedd",
  "operation_id": "op_6f1ed002ab5595859014ebf0951522d9",
  "object": "deepfake.detection",
  "result": {
    "verdict": "real",
    "score": 0.0731,
    "duration_seconds": 10.4,
    "scored_seconds": 10.4,
    "segments": [
      { "start": 0, "end": 4, "score": 0.061, "verdict": "real" },
      { "start": 2, "end": 6, "score": 0.085, "verdict": "real" },
      { "start": 4, "end": 8, "score": 0.07, "verdict": "real" },
      { "start": 6, "end": 10, "score": 0.077, "verdict": "real" },
      { "start": 6.4, "end": 10.4, "score": 0.072, "verdict": "real" }
    ]
  }
}
```

| Field | Meaning |
|---|---|
| `result.verdict` | The decision: `real` or `fake` (likely AI-generated). Decide with this field. |
| `result.score` | How likely the recording is AI-generated, from 0 to 1 (higher means more likely). Decide with `verdict`, not the score alone. |
| `result.segments` | Consecutive, overlapping parts of the recording, with `start` and `end` in seconds, a `score` and a `verdict`: whether that part on its own sounds AI-generated. Use it to see where in a recording the AI-generated speech is. |
| `result.duration_seconds` | Length of the checked audio, in seconds. |
| `result.scored_seconds` | Seconds of audio the verdict is based on. |
| `result.label`, `result.is_synthetic` | The same decision in older wording (`genuine`, `synthetic`), kept for older clients. |
| `operation_id` | Fetch the result again later, for 30 days. |
| `request_id` | Include it when you contact support. |

### Send at least 10 seconds of speech

The check works on recordings with at least 2 seconds of speech, but longer audio gives far fewer false alarms, and recordings shorter than 4 seconds are the least reliable. In our English tests, real voices were flagged as fake in 4.2% of checks on the first 4 seconds of a recording and in 0.45% of checks on the first 10 seconds of the same recordings, while about as many fakes were caught.

- Send at least 10 seconds of speech when you can.
- On a phone call, use a [live call stream](#live-call-streams): it answers early only when the start of the call is already clear, and gives a final verdict over all the speech of the call.

### Recording length and speech

- Up to 300 seconds (5 minutes); there is no minimum length. Longer: `422 audio_too_long`. Trim long recordings to the part you want checked.
- At least 2 seconds of speech. A recording with less speech, or music, noise or silence without a voice, is refused with `422 insufficient_speech` and is not charged. Parts without speech, such as a silent or music intro, are left out of the score.

### Use the verdict well

- A verdict is a strong signal, not proof. Use it with other checks, and have a person review decisions that matter.
- Phone-quality audio (calls, voice messages) gives less reliable results than clear recordings.
- The check works best on English and Hindi speech.

### After the check

- **Fetch the result again.** Results are kept for 30 days: [Get a result](https://platform.detectif.ai/docs/#get-a-result) returns one by its `operation_id`, for example when your connection dropped before the response arrived.
- **Tell us whether it was right** with [Say whether a result was right](https://platform.detectif.ai/docs/deepfake-detection/#say-whether-a-result-was-right): `correct`, and optionally what the recording really is and a short note. Your answer is stored with the result, not the audio.

## API reference

Base URL: `https://platform.detectif.ai` (live stream: `wss://platform.detectif.ai`).

| Method | Path | Reference |
|---|---|---|
| `WS` | `/v1/stream` | [Live call stream](https://platform.detectif.ai/docs/live-call-streams/) |
| `POST` | `/v1/deepfake/detect` | [Detect AI-generated speech](https://platform.detectif.ai/docs/deepfake-detection/#detect-ai-generated-speech) |
| `POST` | `/v1/operations/{operation_id}/feedback` | [Say whether a result was right](https://platform.detectif.ai/docs/deepfake-detection/#say-whether-a-result-was-right) |
| `GET` | `/v1/operations/{operation_id}` | [Get a result](https://platform.detectif.ai/docs/#get-a-result). Shared with Eidos, listed under Account. |

### Detect AI-generated speech

`POST /v1/deepfake/detect`

Checks whether a recording contains AI-generated speech. Send one audio file of up to 300 seconds (5 minutes) with at least 2 seconds of speech; at least 10 seconds of speech gives the most reliable verdicts. Use the result's `verdict`: always `real` or `fake`. `score` (0 to 1, higher means more likely AI-generated) is kept for older clients together with `label` and `is_synthetic`. Main failures: the file is not audio or is damaged (415/422), longer than 300 seconds (422), under 2 seconds of speech (music, noise or silence: 422 `insufficient_speech`), not enough credits (402), the service is busy (503, retry later). Requires scope `deepfake:detect`.

Full URL: `https://platform.detectif.ai/v1/deepfake/detect`. Send your API key as `Authorization: Bearer <your API key>`.

#### Request

Headers:

| Name | Type | Required | Description |
|---|---|---|---|
| `Authorization` | string | yes | `Bearer <your API key>`. Keys are created in the dashboard; see [Authentication](https://platform.detectif.ai/docs/#authentication). |
| `Idempotency-Key` | string or null | no | Optional (recommended) key that makes retries safe for 24 h: a retry with the same key and the same request returns the stored response without charging again. (1 to 128 characters) |

Form fields (`multipart/form-data`). Upload the audio file in the `file` field (up to 100 MB); send the other fields as form fields:

| Field | Type | Required | Description |
|---|---|---|---|
| `file` | file | yes | The audio file: WAV, MP3, FLAC, OGG/Opus, WebM, M4A/AAC or AIFF, at most 100 MB. |

#### Response

`200`: The check completed.

| Field | Type | Always there | Description |
|---|---|---|---|
| `request_id` | string | yes |  |
| `operation_id` | string | yes |  |
| `object` | string | yes | (always `"deepfake.detection"`) |
| `result` | object | yes |  |
| `result.verdict` | string | yes | The decision: `real` or `fake` (AI-generated). Always one of these two. (`not_sure` stays in the list of values only so that older clients keep working; it is never returned.) (one of `real`, `fake`, `not_sure`) |
| `result.label` | string | yes | The same decision in the older wording: `synthetic` (fake) or `genuine` (real). (`uncertain` is never returned.) (one of `synthetic`, `genuine`, `uncertain`) |
| `result.is_synthetic` | boolean | yes | true only when the verdict is `fake`. |
| `result.score` | number | yes | How likely the recording is AI-generated, from 0 to 1. (0 to 1) |
| `result.score_semantics` | string | yes | A short reminder of what `score` means. |
| `result.duration_seconds` | number | yes | Length of the checked audio, in seconds. |
| `result.scored_seconds` | number or null | no | Seconds of audio the verdict is based on (all of the checked audio). At least 10 seconds of speech gives the most reliable verdicts. |
| `result.segments` | array of object | yes | Scores for consecutive, overlapping parts of the recording. |
| `result.segments.start` | number | yes | Start of this part of the recording, in seconds. |
| `result.segments.end` | number | yes | End of this part of the recording, in seconds. |
| `result.segments.score` | number | yes | How likely this part is synthetic (0 to 1). (0 to 1) |
| `result.segments.verdict` | string or null | no | Whether this part on its own sounds AI-generated: `fake` or `real`. The recording's `verdict` is the decision for the whole recording. Absent in results from before 29 October 2026. (one of `real`, `fake`) |
| `model` | object | yes |  |
| `model.name` | string | yes | Model family: `aletheia` (deepfake detection) or `eidos` (speaker verification). |
| `model.version` | string | yes | Model version, for example `2026.10`; it changes whenever the model is updated. |
| `credits` | object | yes |  |
| `credits.charged` | integer | yes | Credits used by this request. A repeated request with the same Idempotency-Key uses none: it reports 0 here and what the original request used in `original_charge`. |
| `credits.balance` | integer or null | yes | Your available credits after this request; null on the unlimited plan. |
| `credits.original_charge` | integer or null | no | Only on repeated requests (`charged` is then 0): the credits the original request used. |
| `credits.unlimited` | boolean or null | no | Present (true) only for accounts on the unlimited plan, where checks use no credits. |
| `latency_ms` | number | yes |  |
| `idempotent_replay` | boolean | yes |  |

Example response:

```json
{
  "request_id": "req_8f14e45fceea167a5a36dedd",
  "operation_id": "op_6f1ed002ab5595859014ebf0951522d9",
  "object": "deepfake.detection",
  "idempotent_replay": false,
  "result": {
    "score_semantics": "Higher means more likely AI-generated. Decide with the verdict, not the score alone.",
    "verdict": "real",
    "label": "genuine",
    "is_synthetic": false,
    "score": 0.0731,
    "duration_seconds": 10.4,
    "scored_seconds": 10.4,
    "segments": [
      {
        "start": 0,
        "end": 4,
        "score": 0.061,
        "verdict": "real"
      },
      {
        "start": 2,
        "end": 6,
        "score": 0.085,
        "verdict": "real"
      },
      {
        "start": 4,
        "end": 8,
        "score": 0.07,
        "verdict": "real"
      },
      {
        "start": 6,
        "end": 10,
        "score": 0.077,
        "verdict": "real"
      },
      {
        "start": 6.4,
        "end": 10.4,
        "score": 0.072,
        "verdict": "real"
      }
    ]
  }
}
```

#### Errors

| Status | Meaning |
|---|---|
| `400` | The request is invalid, for example a missing or malformed field. |
| `401` | The API key is missing, invalid or revoked. |
| `402` | Not enough credits are available for this operation. |
| `403` | The key lacks the required scope, the email address is not verified, or the account is suspended. |
| `408` | The upload did not arrive in time (the whole file within 120 seconds, at least 64 KB per second). |
| `409` | Conflict, for example a request with the same Idempotency-Key is still running, or the speaker already has the maximum number of samples. |
| `413` | The upload is larger than 100 MB. |
| `415` | Not a supported audio format, or the request is not multipart/form-data. |
| `422` | The audio cannot be used (damaged, too short, too long, silent or too little speech; the message says what is needed), or the Idempotency-Key was already used for a different request. |
| `429` | Too many requests or too many operations at the same time. Wait for the number of seconds in Retry-After. |
| `500` | Something went wrong on our side. No credits were used. |
| `502` | The check failed on our side. No credits were used; retry later. |
| `503` | The service is busy, for example with many large uploads. Retry after the Retry-After seconds. |
| `504` | The check took too long. No credits were used; retry later. |

Every error body has the shape described in [Errors](https://platform.detectif.ai/docs/#errors), with a stable `error.code`.

#### Example

```bash
curl "https://platform.detectif.ai/v1/deepfake/detect" \
  -H "Authorization: Bearer $DETECTIF_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@clip.wav"
```

```python
import os
import uuid

import requests

with open("clip.wav", "rb") as f:
    resp = requests.post(
        "https://platform.detectif.ai/v1/deepfake/detect",
        headers={"Authorization": f"Bearer {os.environ['DETECTIF_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
        files={"file": f},
        timeout=300,
    )
print(resp.status_code, resp.json())
```

```javascript
import { readFile } from "node:fs/promises";
import { randomUUID } from "node:crypto";

const form = new FormData();
form.append("file", new Blob([await readFile("clip.wav")]), "clip.wav");

const res = await fetch("https://platform.detectif.ai/v1/deepfake/detect", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.DETECTIF_API_KEY}`,
    "Idempotency-Key": randomUUID(),
  },
  body: form,
});
console.log(res.status, await res.json());
```

### Say whether a result was right

`POST /v1/operations/{operation_id}/feedback`

Tells us whether an AI-speech check (`deepfake.detect`) got it right. Send `correct`, and optionally what the recording really is (`label`: `real` or `fake`) and a short note. Only for checks of your own account; sending again replaces your earlier answer. No credits are used. Your answer is stored with the result. Requires the scope of the check (`deepfake:detect`).

Full URL: `https://platform.detectif.ai/v1/operations/{operation_id}/feedback`. Send your API key as `Authorization: Bearer <your API key>`.

#### Request

Headers:

| Name | Type | Required | Description |
|---|---|---|---|
| `Authorization` | string | yes | `Bearer <your API key>`. Keys are created in the dashboard; see [Authentication](https://platform.detectif.ai/docs/#authentication). |

Path parameters:

| Name | Type | Required | Description |
|---|---|---|---|
| `operation_id` | string | yes | The `operation_id` of the check (`op_...`). |

JSON body (`application/json`):

| Field | Type | Required | Description |
|---|---|---|---|
| `correct` | boolean | yes | Was the result right? |
| `label` | string or null | no | Optional: what the recording really is. (one of `real`, `fake`) |
| `note` | string or null | no | Optional note, at most 500 characters. (at most 500 characters) |

```json
{
  "correct": false,
  "label": "real",
  "note": "My own voice, recorded on a phone."
}
```

#### Response

`200`: Your answer was saved.

| Field | Type | Always there | Description |
|---|---|---|---|
| `request_id` | string | yes |  |
| `object` | string | yes | (always `"operation.feedback"`) |
| `operation_id` | string | yes |  |
| `correct` | boolean | yes |  |
| `label` | string or null | yes | (one of `real`, `fake`) |
| `note` | string or null | yes |  |
| `created_at` | string | yes |  |
| `updated_at` | string | yes |  |

Example response:

```json
{
  "request_id": "req_8f14e45fceea167a5a36dedd",
  "object": "operation.feedback",
  "operation_id": "op_6f1ed002ab5595859014ebf0951522d9",
  "correct": false,
  "label": "real",
  "note": "My own voice, recorded on a phone.",
  "created_at": "2026-10-13T09:30:00Z",
  "updated_at": "2026-10-13T09:30:00Z"
}
```

#### Errors

| Status | Meaning |
|---|---|
| `400` | The request is invalid, for example a missing or malformed field. |
| `401` | The API key is missing, invalid or revoked. |
| `403` | The key lacks the required scope, the email address is not verified, or the account is suspended. |
| `404` | Not found. Also returned for resources that belong to another account. |
| `409` | Conflict, for example a request with the same Idempotency-Key is still running, or the speaker already has the maximum number of samples. |
| `429` | Too many requests or too many operations at the same time. Wait for the number of seconds in Retry-After. |
| `500` | Something went wrong on our side. No credits were used. |

Every error body has the shape described in [Errors](https://platform.detectif.ai/docs/#errors), with a stable `error.code`.

#### Example

```bash
curl -X POST "https://platform.detectif.ai/v1/operations/op_0123456789abcdef0123456789abcdef/feedback" \
  -H "Authorization: Bearer $DETECTIF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"correct":false,"label":"real","note":"My own voice, recorded on a phone."}'
```

```python
import os

import requests

resp = requests.post(
    "https://platform.detectif.ai/v1/operations/op_0123456789abcdef0123456789abcdef/feedback",
    headers={"Authorization": f"Bearer {os.environ['DETECTIF_API_KEY']}"},
    json={
        "correct": False,
        "label": "real",
        "note": "My own voice, recorded on a phone.",
    },
    timeout=30,
)
print(resp.status_code, resp.json())
```

```javascript
const res = await fetch("https://platform.detectif.ai/v1/operations/op_0123456789abcdef0123456789abcdef/feedback", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.DETECTIF_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "correct": false,
    "label": "real",
    "note": "My own voice, recorded on a phone."
  }),
});
console.log(res.status, await res.json());
```

## Live call streams

Check a phone call while it happens: one WebSocket per call gives an early verdict when the start is clear, live verdicts while the call runs and a final verdict when it ends, and the same stream can verify or enroll the caller. It works with Twilio, Plivo, Telnyx, Exotel, Vonage, FreeSWITCH, any other platform through a relay, and your own code: see [Live call streams](https://platform.detectif.ai/docs/live-call-streams/).

```
wss://platform.detectif.ai/v1/stream?checks=deepfake
```

## Webhooks

Add an endpoint under **Webhooks** in the dashboard to receive these events (signing, retries and verification: see [Webhooks](https://platform.detectif.ai/docs/#webhooks)):

| Event | When |
|---|---|
| `deepfake.completed` | A check finished: from the API, MCP, the dashboard, or the final check of a stream (with `stream_id`, `reference` and `"source": "stream"`) |
| `stream.started` | A live call stream started |
| `stream.deepfake.updated` | The early verdict (`early: true`) or a live update |
| `stream.completed` | A stream ended, with every final result |

## MCP tools

Connect an AI assistant to the [MCP server](https://platform.detectif.ai/docs/mcp/) and ask, for example, "Check if /path/call.wav is AI-generated" or "Which parts of /path/call.wav sound AI-generated?". The assistant calls `detect_deepfake` with the recording and reads the verdict for you.

| Tool | What it does | Inputs |
|---|---|---|
| [`detect_deepfake`](https://platform.detectif.ai/docs/mcp/#detect_deepfake) | Check a recording (up to 300 s = 5 min, at least 2 s of speech) for AI-generated speech. | `audio_base64`, `filename`, `idempotency_key` (optional) |
| [`get_operation`](https://platform.detectif.ai/docs/mcp/#get_operation) | Fetch a stored operation: status and, for 30 days, its result. Shared with Eidos, listed under Account. | `operation_id` |
