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

# AI Music Detection Batch

> Detect AI-generated music in an audio file. Returns a clip-level verdict plus a per-window breakdown of vocal and instrumental AI content.



## OpenAPI

````yaml api/velma_2_ai_music_detection_batch.yaml POST /api/velma-2-ai-music-detection-batch
openapi: 3.1.0
info:
  title: Velma 2 AI Music Detection Batch API
  description: >
    Batch endpoint for detecting AI-generated music in audio files via HTTP
    POST.

    The clip is analysed as a sequence of windows; each window is independently

    scored for AI-generated vocals and AI-generated instrumental content

    whenever it has enough of the corresponding content to score, and the

    per-window results are aggregated into a clip-level verdict.


    ## Performance Notes


    - Per-window results can be less accurate than the clip-level verdict. Use
      `primary_verdict` when classifying an entire uploaded song or segment.
    - Heavily processed or high-production songs may be incorrectly labeled as
      AI-generated; this is a known gap targeted by future updates to this
      model.
  version: 1.0.0
servers:
  - url: https://platform.modulate.ai
    description: Modulate AI Music Detection Batch Server
security:
  - ApiKeyAuth: []
paths:
  /api/velma-2-ai-music-detection-batch:
    post:
      summary: Detect AI-generated music in an audio file
      description: |
        Accepts an audio file and returns a clip-level verdict on whether the
        content contains AI-generated music, along with a per-window breakdown
        of how each segment was classified.
      operationId: detectAIMusic
      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/AIMusicDetectionResponse'
              example:
                filename: my_audio.mp3
                duration_s: 89.28
                primary_verdict: ai-vocal-music
                vocal_percentage: 87.5
                vocal_ai_percentage: 56.5
                vocal_ai_confidence: 0.96
                instrumental_percentage: 64.3
                instrumental_ai_percentage: 10.5
                instrumental_ai_confidence: 0.95
                silence_percentage: 3.51
                windows:
                  - start_time_ms: 0
                    end_time_ms: 4000
                    vocal_percentage: 100
                    vocal_ai_probability: 0.97
                    vocal_ai_confidence: 0.97
                    instrumental_percentage: 79
                    instrumental_ai_probability: 0.42
                    instrumental_ai_confidence: 0.16
                    silence_percentage: 0
                  - start_time_ms: 4000
                    end_time_ms: 8000
                    vocal_percentage: 0
                    vocal_ai_probability: null
                    vocal_ai_confidence: null
                    instrumental_percentage: 82
                    instrumental_ai_probability: 0.88
                    instrumental_ai_confidence: 0.76
                    silence_percentage: 18
                latency_ms: 1333
        '400':
          description: >
            Bad request - the uploaded file is empty or its format is not
            supported.
          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.
        '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 - a required request parameter is missing or
            invalid (for example, the `upload_file` field).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              examples:
                invalid_upload_file:
                  value:
                    detail:
                      - loc:
                          - body
                          - upload_file
                        msg: Field required
                        type: missing
        '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 processing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Internal server error
        '502':
          description: Bad gateway - the request could not be completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Unable to complete the request. Please try again.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AIMusicDetectionResponse:
      type: object
      required:
        - filename
        - duration_s
        - primary_verdict
        - vocal_percentage
        - vocal_ai_percentage
        - vocal_ai_confidence
        - instrumental_percentage
        - instrumental_ai_percentage
        - instrumental_ai_confidence
        - silence_percentage
        - windows
        - latency_ms
      properties:
        filename:
          type: string
          description: >
            Name of the submitted audio file. Empty string if no filename was
            provided in the upload.
          example: my_audio.mp3
        duration_s:
          type: number
          format: double
          minimum: 0
          description: Total duration of the analysed audio in seconds.
          example: 89.28
        primary_verdict:
          type: string
          enum:
            - ai-vocal-music
            - ai-instrumental
            - not-ai-music
          description: |
            Clip-level classification:
            - `ai-vocal-music` - AI-generated music with a detected synthetic
              voice (covers AI songs and AI synthetic vocal tracks).
            - `ai-instrumental` - AI-generated instrumental music with no
              detectable synthetic voice.
            - `not-ai-music` - the clip does not appear to contain
              AI-generated music.
          example: ai-vocal-music
        vocal_percentage:
          type: number
          format: double
          minimum: 0
          maximum: 100
          description: >
            Clip-level average percentage of the audio that contains vocal
            content, averaged across all windows.
          example: 87.5
        vocal_ai_percentage:
          type: number
          format: double
          minimum: 0
          maximum: 100
          description: >
            Clip-level AI-vocal score, on a 0-100 scale: each scored window's
            probability-weighted duration as a percentage of the full clip
            duration. Windows without enough vocal content to score contribute
            zero to the numerator but their duration still counts toward the
            total, so a clip that is mostly instrumental with only a brief,
            confidently-synthetic vocal patch does not read as overwhelmingly
            AI-vocal.
          example: 56.5
        vocal_ai_confidence:
          type: number
          format: double
          minimum: 0
          maximum: 1
          description: >
            Average confidence across all windows that were scored for
            AI-generated vocals. Not diluted by windows without enough vocal
            content to score.
          example: 0.89
        instrumental_percentage:
          type: number
          format: double
          minimum: 0
          maximum: 100
          description: >
            Clip-level average percentage of the audio that contains
            instrumental music content, averaged across all windows.
          example: 64.3
        instrumental_ai_percentage:
          type: number
          format: double
          minimum: 0
          maximum: 100
          description: >
            Clip-level AI-instrumental score, on a 0-100 scale: the
            duration-weighted average of each scored window's AI-instrumental
            probability. Windows that are mostly silence do not contribute.
          example: 10.5
        instrumental_ai_confidence:
          type: number
          format: double
          minimum: 0
          maximum: 1
          description: >
            Average confidence across all windows that were scored for
            AI-generated instrumental content. Zero if no window was scored.
          example: 0.95
        silence_percentage:
          type: number
          format: double
          minimum: 0
          maximum: 100
          description: >
            Clip-level average percentage of the audio that contains neither
            vocal nor instrumental content, averaged across all windows.
          example: 3.51
        windows:
          type: array
          items:
            $ref: '#/components/schemas/WindowPrediction'
          description: Per-window breakdown of detection results.
        latency_ms:
          type: number
          format: double
          minimum: 0
          description: End-to-end inference time in milliseconds.
          example: 1333
    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'
    WindowPrediction:
      type: object
      required:
        - start_time_ms
        - end_time_ms
        - vocal_percentage
        - vocal_ai_probability
        - vocal_ai_confidence
        - instrumental_percentage
        - instrumental_ai_probability
        - instrumental_ai_confidence
        - silence_percentage
      properties:
        start_time_ms:
          type: integer
          minimum: 0
          description: Window start time in milliseconds.
          example: 0
        end_time_ms:
          type: integer
          minimum: 0
          description: Window end time in milliseconds.
          example: 4000
        vocal_percentage:
          type: number
          format: double
          minimum: 0
          maximum: 100
          description: |
            Percentage of this window that contains vocal content.
          example: 100
        vocal_ai_probability:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 1
          description: >
            Probability that this window contains AI-generated vocals. `null` if
            the window does not have enough vocal content to score - independent
            of `instrumental_ai_probability`, so a window can carry both, one,
            or neither.
          example: 0.97
        vocal_ai_confidence:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 1
          description: >
            Confidence in `vocal_ai_probability`. `null` under the same
            conditions as that field.
          example: 0.97
        instrumental_percentage:
          type: number
          format: double
          minimum: 0
          maximum: 100
          description: |
            Percentage of this window that contains instrumental music content.
          example: 79
        instrumental_ai_probability:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 1
          description: >
            Probability that this window contains AI-generated instrumental
            content. `null` if the window is mostly silence - independent of
            `vocal_ai_probability`, so a window can carry both, one, or neither.
          example: 0.42
        instrumental_ai_confidence:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 1
          description: >
            Confidence in `instrumental_ai_probability`. `null` under the same
            conditions as that field.
          example: 0.16
        silence_percentage:
          type: number
          format: double
          minimum: 0
          maximum: 100
          description: >
            Percentage of this window that contains neither vocal nor
            instrumental content.
          example: 0
    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.