API Documentation
Vobile/Pex AI Song Detector - API Documentation
The AI Song Detector API lets you check whether an audio file contains AI-generated music.
The submitted audio file must contain music, ideally a single song. Files may be uploaded directly or retrieved from a provided URL. Please avoid files with UGC compilations or other mixed content. See more on Overview page.
The model produces one prediction for the entire file.
To use the API:
Request an access token via OAuth 2.0 Client Credentials.
Submit an audio file to the detection endpoint, either by uploading it directly or by providing a URL to the file. All common audio file formats are supported.
Receive a JSON result describing whether the file contains AI-generated music.
1. Authentication
The API uses OAuth 2.0 Client Credentials. You will need a CLIENT_ID and CLIENT_SECRET.
The generated access token must be included in every request to the detection endpoint.
The access token is valid for 2 hours. Clients should reuse the same token for multiple requests until it expires, rather than requesting a new token for each call. When the token expires, request a new one using the same client credentials.
Token Endpoint
POST
https://api.ae.pex.com/oauth2/token
Auth: HTTP Basic Auth
Body:
grant_type=client_credentials
Examples
2. AI Song Detector Endpoints
Submit an audio file to the detection endpoint, either by uploading it directly (see 2A. AI Song Detector - File Upload Endpoint) or by providing a URL to the file (see 2B. AI Song Detector - URL Endpoint).
File constraints
Supported formats: Most common audio formats (MP3, MP4/M4A, WAV, FLAC, AAC, OGG, WEBM, etc.).
Maximum file size: 100 MB.
Minimum duration: 10 seconds.
Maximum duration: 15 minutes.
Stereo, mono, and variable bitrates are supported.
Files shorter or longer than the limits will return too_short or too_long in the response status. Files containing a lot of silence or non-music parts may return not_enough_music.
2A. AI Song Detector - File Upload Endpoint
This endpoint receives a file and returns AI music detector results.
POST
https://api.ae.pex.com/v1/ai-detector/detect
Requirements
Authorization:
Bearer <access_token>Content-Type:
multipart/form-dataBody:
file=@your_audio_file
Examples
2B. AI Song Detector - URL Endpoint
This endpoint receives a URL from which an audio file is retrieved and analyzed.
The URL must be publicly accessible without authentication and must allow direct file download. If the URL cannot be opened or accessed, the status not_found is returned.
POST
https://api.ae.pex.com/v1/ai-detector/detect-url
Requirements
Authorization:
Bearer <access_token>Content-Type:
application/x-www-form-urlencodedBody:
url=your_audio_file_url
Examples
3. Response Format
A successful request (HTTP 200 OK) with status ok returns a JSON object such as:
Response Fields
request_id
integer
Unique ID for this request.
status
string
Processing status (see full list below).
message
string
Human-readable explanation of the status.
is_ai
boolean
Whether the model classifies the song as AI-generated.
Present only if status is ok.
ai_score
float
Confidence score [0–1]. It represents the model's confidence that the audio is AI-generated. It is not a probability.
Present only if status is ok.
predicted_model
string
Name of the predicted model, e.g. "suno", "udio", etc.
Present only if status is ok.
May be null even when is_ai is true, if the detector is not sufficiently confident about the specific AI generation platform.
predicted_model_score
float
Score of the predicted model.
Present only if status is ok and predicted_model is set.
4. Status Codes
ok
Processing completed successfully. Fields is_ai and ai_score are provided.
invalid_file
The file is not recognized as a valid media file, is corrupted, or the container cannot be parsed.
no_audio
The media file is valid, but contains no extractable audio track.
too_short
Audio is shorter than 10 seconds.
too_long
Audio is longer than 15 minutes.
not_enough_music
Audio exists, but does not contain enough music content for reliable classification.
not_found
The provided URL could not be opened or the file could not be retrieved.
error
Other processing error.
5. HTTP Error Handling
The API uses standard error responses:
200
Request processed. The response body contains a status field that may indicate errors (e.g., invalid_file, too_short).
400
Invalid request (missing file or URL, incorrect field name, etc.).
401
Missing or invalid OAuth token.
413
File too large (over 100 MB).
429
Too Many Requests - retry with backoff.
500
Unexpected server error. You may retry if temporary.
502
Bad Gateway. The server may be overloaded - retry with backoff.
503
Service temporarily overloaded - retry with backoff.
Example error response
6. Full Example
This code illustrates how to use both steps (Authentication and use of AI Song Detector Endpoint), including error handling.
7. Support
If you encounter problems, please contact your Pex representative and include:
the
request_id(if present),timestamp,
HTTP status code,
the approximate file duration.
Last updated