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

# Deepfake Detection Batch

> Detect synthetic (AI-generated) voice in a pre-recorded audio file. Returns per-frame deepfake scores.



## OpenAPI

````yaml api/velma_2_synthetic_voice_detection_batch.yaml POST /api/velma-2-synthetic-voice-detection-batch
openapi: 3.1.0
info:
  title: Velma 2 Synthetic Voice Detection Batch API
  description: >
    Batch endpoint for detecting synthetic (AI-generated) speech in

    single-speaker audio files via HTTP POST. The audio is analysed as a
    sequence

    of windowed frames, each independently classified as synthetic,

    non-synthetic, or no-content (silence), returned in order across the full

    duration.


    ## Behavior Notes


    - Leading and trailing silence is excluded from analysis; frame timestamps
      still reflect positions in the original file.
    - Frames that contain only silence or no usable audio are assigned a
      `no-content` verdict with confidence `1.0`.
    - Files shorter than a single 4-second analysis window are still accepted
      and analysed.
  version: 0.0.0
servers:
  - url: https://platform.modulate.ai
    description: Modulate Synthetic Voice Detection Batch Server
security:
  - ApiKeyAuth: []
paths:
  /api/velma-2-synthetic-voice-detection-batch:
    post:
      summary: Detect synthetic voice in an audio file
      description: |
        Accepts a single audio file and returns a per-frame synthetic-voice
        classification across the clip as a synchronous JSON response.
        Recommended audio length: 4-60 seconds; files shorter than 0.5 seconds
        are rejected with a 422.
      operationId: detectSyntheticVoice
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - upload_file
              properties:
                upload_file:
                  type: string
                  format: binary
                  description: |
                    Audio file to analyse. Must be non-empty. Supported formats:
                    `.3g2`, `.3ga`, `.3gp`, `.3gpp`, `.8svx`, `.aa3`, `.aac`,
                    `.ac3`, `.act`, `.adts`, `.aif`, `.aifc`, `.aiff`, `.alac`,
                    `.amb`, `.amr`, `.ape`, `.asf`, `.at3`, `.au`, `.avi`,
                    `.avr`, `.awb`, `.bwf`, `.c2`, `.caf`, `.dss`, `.dts`,
                    `.dtshd`, `.eac3`, `.ec3`, `.f4a`, `.f4b`, `.flac`, `.flv`,
                    `.gsm`, `.iff`, `.m2a`, `.m2ts`, `.m4a`, `.m4b`, `.m4r`,
                    `.m4v`, `.mka`, `.mkv`, `.mlp`, `.mmf`, `.mov`, `.mp+`,
                    `.mp1`, `.mp2`, `.mp3`, `.mp4`, `.mpa`, `.mpc`, `.mpeg`,
                    `.mpg`, `.mpga`, `.mpp`, `.mts`, `.mxf`, `.nist`, `.oga`,
                    `.ogg`, `.ogx`, `.oma`, `.omg`, `.opus`, `.paf`, `.pvf`,
                    `.qcp`, `.ra`, `.rf64`, `.rka`, `.rm`, `.rmvb`, `.sf`,
                    `.shn`, `.snd`, `.sph`, `.svx`, `.tak`, `.thd`,
                    `.ts`, `.tta`, `.vob`, `.voc`, `.vqf`, `.w64`, `.wav`,
                    `.wave`, `.weba`, `.webm`, `.wma`, `.wmv`,
                    `.wv`. Maximum file size: 100 MB.
      responses:
        '200':
          description: Detection completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetectionAPIResponse'
        '400':
          description: >
            Bad request - the uploaded file is empty, its format is not
            supported, or the audio could not be decoded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_format:
                  summary: Invalid file format
                  value:
                    detail: >-
                      Unsupported file format. Supported formats: .3g2, .3ga,
                      .3gp, .3gpp, .8svx, .aa3, .aac, .ac3, .act, .adts, .aif,
                      .aifc, .aiff, .alac, .amb, .amr, .ape, .asf, .at3, .au,
                      .avi, .avr, .awb, .bwf, .c2, .caf, .dss, .dts, .dtshd,
                      .eac3, .ec3, .f4a, .f4b, .flac, .flv, .gsm, .iff, .m2a,
                      .m2ts, .m4a, .m4b, .m4r, .m4v, .mka, .mkv, .mlp, .mmf,
                      .mov, .mp+, .mp1, .mp2, .mp3, .mp4, .mpa, .mpc, .mpeg,
                      .mpg, .mpga, .mpp, .mts, .mxf, .nist, .oga, .ogg, .ogx,
                      .oma, .omg, .opus, .paf, .pvf, .qcp, .ra, .rf64, .rka,
                      .rm, .rmvb, .sf, .shn, .snd, .sph, .svx, .tak, .thd, .ts,
                      .tta, .vob, .voc, .vqf, .w64, .wav, .wave, .weba, .webm,
                      .wma, .wmv, .wv.
                empty_file:
                  summary: Empty file
                  value:
                    detail: The uploaded file is empty.
                no_audio_stream:
                  summary: No decodable audio stream
                  value:
                    detail: No decodable audio stream was found in the file.
                unsupported_codec:
                  summary: Unsupported audio codec
                  value:
                    detail: The audio codec is not supported.
                corrupt_file:
                  summary: Corrupted or truncated audio file
                  value:
                    detail: The audio file appears to be corrupted or truncated.
                unprocessable:
                  summary: Audio could not be decoded
                  value:
                    detail: >-
                      The audio could not be processed. It may be corrupted or
                      in an unsupported format.
                bad_value:
                  summary: Malformed request value
                  value:
                    detail: Invalid request.
        '401':
          description: Unauthorized - the API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missing_api_key:
                  summary: Missing API key
                  value:
                    detail: Missing API key.
                invalid_api_key:
                  summary: Invalid API key
                  value:
                    detail: Invalid API key.
        '403':
          description: >
            Forbidden - the request is not permitted, or the API key does not
            have access to this model.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                not_permitted:
                  summary: Request not permitted
                  value:
                    detail: This request is not permitted.
                model_access_denied:
                  summary: No access to this model
                  value:
                    detail: This API key does not have access to this model.
        '413':
          description: Payload too large - the uploaded file exceeds the maximum file size.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: The uploaded file is too large.
        '422':
          description: |
            Unprocessable entity - the audio is too short to analyze, or a
            required request parameter is missing or invalid (for example, the
            `upload_file` field).
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/HTTPValidationError'
              examples:
                audio_too_short:
                  summary: Audio too short
                  value:
                    detail: The audio is too short to analyze.
        '429':
          description: >
            Too many requests - the request was denied due to insufficient
            credits, a concurrent request limit, or a monthly usage limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                insufficient_credits:
                  summary: Insufficient credits
                  value:
                    detail: Insufficient credits.
                concurrency_limit:
                  summary: Concurrent request limit reached
                  value:
                    detail: >-
                      Concurrent request limit reached. Please retry after your
                      in-flight requests complete.
                monthly_limit:
                  summary: Monthly usage limit reached
                  value:
                    detail: Monthly usage limit reached.
        '500':
          description: Internal server error during inference.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Internal server error
        '504':
          description: Gateway timeout - inference did not complete in time.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: The request timed out. Please try again.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    DetectionAPIResponse:
      type: object
      required:
        - filename
        - frames
        - duration_ms
      properties:
        filename:
          oneOf:
            - type: string
            - type: 'null'
          description: Original filename of the uploaded audio.
          example: recording.wav
        frames:
          type: array
          description: >-
            Ordered list of per-frame detection results covering the full audio
            duration.
          items:
            $ref: '#/components/schemas/FrameResult'
        duration_ms:
          type: integer
          minimum: 0
          description: Total duration of the audio in milliseconds.
          example: 34500
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Human-readable error message.
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    FrameResult:
      type: object
      required:
        - start_time_ms
        - end_time_ms
        - verdict
        - confidence
      properties:
        start_time_ms:
          type: integer
          minimum: 0
          description: Frame start time in milliseconds.
          example: 0
        end_time_ms:
          type: integer
          minimum: 0
          description: Frame end time in milliseconds.
          example: 3000
        verdict:
          type: string
          enum:
            - synthetic
            - non-synthetic
            - no-content
          description: |
            Classification for this frame:
            - `synthetic` - the frame likely contains AI-generated speech.
            - `non-synthetic` - the frame likely contains natural human speech.
            - `no-content` - the frame is silent or contains no usable audio.
          example: synthetic
        confidence:
          type: number
          format: double
          minimum: 0
          maximum: 1
          description: Confidence in the stated verdict, from 0 (lowest) to 1 (highest).
          example: 0.9732
    ValidationError:
      type: object
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          type: string
        type:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key used for authentication and usage tracking.

````

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