> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shama.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# VoiceDome® Forensic REST API

> Submit audio to the Batch Analyze endpoint and receive segment-level results for deepfake, replay, and multi-threat detection.

Integrate VoiceDome® Forensic with the REST API. Submit one audio file to the Batch Analyze endpoint and receive the final verdict directly in the response.

> [card] Customer API key

> [card] Synchronous response

> [card] 99.6% accuracy

## Quickstart

Use the Batch Analyze endpoint to submit one audio file. It returns the final verdict directly in the response.

**1. Sign in to the portal**

Create or use your approved customer account in the [VoiceDome® Forensic portal](https://voicedome.shama.ai).

**2. Create an API key**

In the portal, open **API access** and create a key with a label for your integration. The full value is shown only once: copy it and store it securely.

**3. Send your audio**

Make a multipart `POST` request with the API key, the audio file, and one product solution code.

> [!WARNING]
>
> Keep the customer key private. Store it in your backend secret manager. Do not put it in a browser app, mobile bundle, or source control.

## Batch Analyze

Submit one audio file for analysis. The response includes a product-level result and segment classifications.

> [!NOTE]
>
> `POST https://api.shama.ai/api/v1/batch_analyze` — **Coming soon**

| | |
| - | - |
| **Authentication** | `apikey: YOUR_CUSTOMER_API_KEY` header |
| **Content type** | `multipart/form-data` |
| **Required fields** | `file`, `solution` |
| **Optional fields** | `file_id`, `Idempotency-Key` header |

```bash cURL theme={null}
curl --request POST \
  'https://api.shama.ai/api/v1/batch_analyze' \
  --header 'apikey: YOUR_CUSTOMER_API_KEY' \
  --header 'Idempotency-Key: 7a0fc1f1-REUSE-THIS-ON-RETRY' \
  --form 'file=@recording.wav' \
  --form 'solution=voicedome_deepfake' \
  --form 'file_id=customer-reference-001'
```

```python Python theme={null}
import os, uuid
import requests

with open("recording.wav", "rb") as audio:
    resp = requests.post(
        "https://api.shama.ai/api/v1/batch_analyze",
        headers={
            "apikey": os.environ["SHAMA_API_KEY"],
            "Idempotency-Key": str(uuid.uuid4()),  # reuse on retry
        },
        files={"file": audio},
        data={"solution": "voicedome_deepfake", "file_id": "customer-reference-001"},
        timeout=300,
    )

resp.raise_for_status()
result = resp.json()
print(result["final_response"]["summary"]["classification"])
```

```javascript Node.js theme={null}
// Node.js 18+ (built-in fetch and FormData)
import { readFile } from 'node:fs/promises'
import { randomUUID } from 'node:crypto'

const form = new FormData()
form.append('file', new Blob([await readFile('recording.wav')]), 'recording.wav')
form.append('solution', 'voicedome_deepfake')
form.append('file_id', 'customer-reference-001')

const res = await fetch('https://api.shama.ai/api/v1/batch_analyze', {
  method: 'POST',
  headers: { apikey: process.env.SHAMA_API_KEY, 'Idempotency-Key': randomUUID() },
  body: form,
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const result = await res.json()
console.log(result.final_response.summary.classification)
```

> [!TIP]
>
> **Retry safely.** `Idempotency-Key` is optional (up to 128 characters). If you retry the same upload, reuse the same key so it is charged only once. Reusing a key for a different file or solution returns `409`. Use `file_id` as your own correlation value.

* **Supported audio formats:** all audio formats are accepted: any codec, any compression, no conversion needed.
* **Minimum length:** clips shorter than 1 second are rejected with `400`.
* **Authentication:** send your key in the `apikey` header.
* **Data retention:** audio is deleted automatically after analysis. Hosting is in the EU, and we never train models on customer audio unless you opt in.

## Detection solutions

Set the `solution` multipart field to one of these product-level values.

| Solution | Code | Detects | Credits per minute |
| - | - | - | - |
| Audio Deepfake Detection | `voicedome_deepfake` | Synthetic or manipulated speech | 1 |
| Replay Attack Detection | `voicedome_replay` | Speech replayed through a speaker or recording | 1.5 |
| Multi-Threat Detection | `voicedome_multithreat` | Deepfake and replay threats | 2 |

Billing is per minute of audio, with no minimum. A 90-second file costs 1.5, 2.25 or 3 credits. Credits are reserved before analysis, charged when it succeeds and released if it fails.

New accounts get a one-time grant of 10 free credits (10 minutes with Deepfake detection), once per company, to test the API. See plans and credit packs on the [pricing page](https://shama.ai/pricing).

## Response and errors

A successful request returns HTTP `200`. Use `final_response` for the product verdict and per-segment results.

Each segment of the audio has a `classification` (`Fake`, `Real`, `Non Speech` or `Replayed`) and a `score`: the model's confidence, from 0 to 100, in the predicted class.

```json 200 · application/json theme={null}
{
  "solution": "voicedome_deepfake",
  "solution_name": "VoiceDome® Audio Deepfake Detection",
  "file_id": "customer-reference-001",
  "final_response": {
    "num_segments": 1,
    "segments": [{
      "score": 97.4,
      "classification": "Fake",
      "start_time": 0,
      "end_time": 4,
      "duration": 4
    }],
    "summary": {
      "classification": "Fake",
      "fake_percentage": 100,
      "replay_percentage": 0
    }
  }
}
```

| Status | Meaning | What to check |
| - | - | - |
| `400` | Invalid request | Unreadable or unsupported audio, clip under 1 second, solution code, multipart fields |
| `401` | Not authorized | Customer key and API access status |
| `402` | Insufficient credits | Account balance and available credits |
| `409` | Idempotency conflict | The key was already used for a different file or solution |
| `413` | File too large | File size of the upload |
| `422` | Invalid input | Field values and the `Idempotency-Key` length |
| `503` | Service unavailable | Retry later with the same `Idempotency-Key` |
| `504` | Analysis timed out | Retry later with the same `Idempotency-Key` |

Errors return JSON with a `detail` field, for example `{"detail": "insufficient credits"}`.

## Enterprise

Need higher volumes or enterprise onboarding? Talk to our team about enterprise account setup, volume pricing and rollout support.

> [card] [Contact us](https://shama.ai/contact)
>
> Enterprise accounts, volume pricing and rollout support.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.