> 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.

# API Reference

Base URL, authentication, request conventions, and the OpenAPI description of every endpoint.

The DetectifAI REST API checks recordings for AI-generated speech, and enrolls and verifies speakers by voice. Every endpoint has its own page, generated from the OpenAPI description, with examples in cURL, Python and JavaScript.

## Base URL

```
https://platform.detectif.ai/v1
```

## Authentication

Send your API key as a bearer token on every request:

```bash
curl https://platform.detectif.ai/v1/speakers \
  -H "Authorization: Bearer $DETECTIF_API_KEY"
```

See [Authentication](https://platform.detectif.ai/docs/authentication/).

## Requests and responses

- Recordings are sent as `multipart/form-data`, with the audio in the `file` field (up to 100 MB). See [Audio and limits](https://platform.detectif.ai/docs/audio-and-limits/).
- Every response is JSON and includes a `request_id`, which is also sent in the `X-Request-Id` header.
- Send an `Idempotency-Key` header with each upload and reuse it when you retry. A retried request returns the same result instead of running again.
- Errors share one shape with a stable `error.code`. See [Errors](https://platform.detectif.ai/docs/errors/).

## OpenAPI and Postman

The full description of the API, for code generators and API tools:

- [openapi.json](https://platform.detectif.ai/openapi.json)
- [openapi.yaml](https://platform.detectif.ai/openapi.yaml)
- [Download Postman collection](https://platform.detectif.ai/postman/detectif.postman_collection.json): every endpoint, grouped like this reference. Import it into Postman and set the `apiKey` variable to your API key.

## Endpoints

### Deepfake detection

| Method | Path | Page |
|---|---|---|
| `POST` | `/v1/deepfake/detect` | [Detect AI-generated speech](https://platform.detectif.ai/docs/api/detect-deepfake/) |

### Speakers

| Method | Path | Page |
|---|---|---|
| `POST` | `/v1/speakers/enroll` | [Enroll a voice sample](https://platform.detectif.ai/docs/api/enroll-speaker/) |
| `POST` | `/v1/speakers/verify` | [Verify a speaker](https://platform.detectif.ai/docs/api/verify-speaker/) |
| `GET` | `/v1/speakers` | [List speakers](https://platform.detectif.ai/docs/api/list-speakers/) |
| `GET` | `/v1/speakers/{speaker_id}` | [Get a speaker](https://platform.detectif.ai/docs/api/get-speaker/) |
| `DELETE` | `/v1/speakers/{speaker_id}` | [Delete a speaker](https://platform.detectif.ai/docs/api/delete-speaker/) |

### Results

| Method | Path | Page |
|---|---|---|
| `GET` | `/v1/operations/{operation_id}` | [Get a result](https://platform.detectif.ai/docs/api/get-operation/) |
| `POST` | `/v1/operations/{operation_id}/feedback` | [Say whether a result was right](https://platform.detectif.ai/docs/api/send-feedback/) |

### Account

| Method | Path | Page |
|---|---|---|
| `GET` | `/v1/credits` | [Get your balance](https://platform.detectif.ai/docs/api/get-balance/) |
| `GET` | `/v1/usage` | [List your usage](https://platform.detectif.ai/docs/api/get-usage/) |

### System

| Method | Path | Page |
|---|---|---|
| `GET` | `/v1/health` | [Check service health](https://platform.detectif.ai/docs/api/get-health/) |
