Skip to main content

1) Get an API key

Create an account and generate an API key in your dashboard. API key Add it to an environment variable:
export AURIGIN_API_KEY=aurigin_test_1234567890abcdef

2) Upload a file and get a prediction

Send your audio file (3s minimum) directly to POST /predict. The API processes your audio in 5-second chunks and returns one prediction per chunk.
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"]

Errors

Check your API key and file size before making requests.
CodeDescription
400Invalid input or file too large
403Authentication failed (check x-api-key)
500Internal error or upstream unavailability