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

# AI-voice detection

> Analyze audio to determine if it is AI generated or real.

You can send audio data in two ways: (1) multipart/form-data with a direct file upload, or (2) application/json with a presigned URL.

The API processes audio files in 5-second chunks and returns one prediction per chunk.
- Minimum duration: 3 seconds (1 chunk)
- Maximum file size: 4MB
- Chunk size: 5 seconds each
- Output: One prediction per 5-second chunk

Supported formats: WAV, MP3, M4A, FLAC, OGG.

Error codes:
- 400 Invalid input or file too large
- 403 Authentication failed (check x-api-key)
- 500 Internal error or upstream unavailability.



## OpenAPI

````yaml /api-reference/v0/openapi.json post /predict
openapi: 3.0.3
info:
  title: Aurigin API v0
  version: 0.1.0
  description: Legacy Aurigin API for audio deepfake detection (chunk-based responses)
servers:
  - url: https://api.aurigin.ai/v0
security: []
tags:
  - name: v0
    description: Endpoints that analyze audio to determine if it is AI generated or real.
  - name: Async Predictions
    description: Endpoints that handle asynchronous prediction workflows.
paths:
  /predict:
    post:
      tags:
        - v0
      summary: AI-voice detection
      description: >-
        Analyze audio to determine if it is AI generated or real.


        You can send audio data in two ways: (1) multipart/form-data with a
        direct file upload, or (2) application/json with a presigned URL.


        The API processes audio files in 5-second chunks and returns one
        prediction per chunk.

        - Minimum duration: 3 seconds (1 chunk)

        - Maximum file size: 4MB

        - Chunk size: 5 seconds each

        - Output: One prediction per 5-second chunk


        Supported formats: WAV, MP3, M4A, FLAC, OGG.


        Error codes:

        - 400 Invalid input or file too large

        - 403 Authentication failed (check x-api-key)

        - 500 Internal error or upstream unavailability.
      operationId: predictV0
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                user_id:
                  type: string
                  description: Optional user identifier
              required:
                - file
            example:
              file: (binary audio file)
              user_id: speaker_123
          application/json:
            schema:
              $ref: '#/components/schemas/PredictRequest'
            example:
              presigned_url: https://example.com/presigned.wav
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictResponse'
              example:
                predictions:
                  - fake
                  - fake
                  - real
                global_probability:
                  - 0.9584
                  - 0.9585
                  - 0.9123
                error:
                  - null
                  - null
                  - null
                model: apollo-4-2025-10-20
                processing_time: 1.350719928741455
                audio_duration: 69.91
        '400':
          description: Invalid input or file too large (4MB max)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: validation_error
                message: Audio file too large (max 4MB)
                status: 400
                correlation_id: d3a1cb06-23a3-4f8a-a955-7ed2df41b5b7
        '403':
          description: Authentication failed (check x-api-key)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: unauthorized
                message: Invalid x-api-key header
                status: 403
                correlation_id: 12b52e74-7a57-4d85-aa2b-7b9158f09ef9
        '500':
          description: Internal error or upstream unavailability
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: internal_error
                message: Upstream model timed out
                status: 500
                correlation_id: f906f85c-4b63-4f25-a93d-392d8fd521fb
      security:
        - api_key: []
components:
  schemas:
    PredictRequest:
      type: object
      properties:
        user_id:
          type: string
          description: Optional user identifier
        presigned_url:
          type: string
          description: Presigned URL to the audio file
      required:
        - presigned_url
    PredictResponse:
      type: object
      properties:
        error:
          type: array
          items:
            type: string
            nullable: true
          description: >-
            Error messages for each 5-second chunk (null if successful). Aligns
            1:1 with the predictions array.
        global_probability:
          type: array
          items:
            type: number
            format: float
          description: >-
            Confidence scores (0.0-1.0) for each prediction, one per 5-second
            chunk. Aligns 1:1 with the predictions array.
        predictions:
          type: array
          items:
            type: string
            enum:
              - fake
              - real
          description: >-
            AI detection results for each 5-second chunk of the audio. Array
            length equals the number of 5-second chunks in the audio file.
      example:
        error:
          - null
          - null
          - null
        global_probability:
          - 0.9584
          - 0.9585
          - 0.9123
        predictions:
          - fake
          - fake
          - real
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Machine-readable error identifier
        message:
          type: string
          description: Human-readable error message
        status:
          type: integer
          description: HTTP status code associated with the error
          example: 400
        correlation_id:
          type: string
          description: Unique identifier for tracing failed requests
      required:
        - error
        - message
      example:
        error: validation_error
        message: Audio file too large (max 4MB)
        status: 400
        correlation_id: be7a2d19-5ef9-4472-9a21-7b90c0c8573c
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: x-api-key

````