Classify speaker gender
curl --request POST \
--url https://restapi.deepdub.ai/api/v1/gender-detection/classify \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"audio_url": "https://example.com/audio/sample.wav",
"audio_base64": "<string>"
}
'import requests
url = "https://restapi.deepdub.ai/api/v1/gender-detection/classify"
payload = {
"audio_url": "https://example.com/audio/sample.wav",
"audio_base64": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({audio_url: 'https://example.com/audio/sample.wav', audio_base64: '<string>'})
};
fetch('https://restapi.deepdub.ai/api/v1/gender-detection/classify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://restapi.deepdub.ai/api/v1/gender-detection/classify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'audio_url' => 'https://example.com/audio/sample.wav',
'audio_base64' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://restapi.deepdub.ai/api/v1/gender-detection/classify"
payload := strings.NewReader("{\n \"audio_url\": \"https://example.com/audio/sample.wav\",\n \"audio_base64\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://restapi.deepdub.ai/api/v1/gender-detection/classify")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"audio_url\": \"https://example.com/audio/sample.wav\",\n \"audio_base64\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://restapi.deepdub.ai/api/v1/gender-detection/classify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"audio_url\": \"https://example.com/audio/sample.wav\",\n \"audio_base64\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"predicted_gender": "female",
"confidence": 0.95,
"prediction": {
"female": 0.95,
"male": 0.05
},
"duration_seconds": 3.5,
"processing_time_ms": 120.5
}{
"error": "Bad request",
"detail": "Either audio_url or audio_base64 must be provided"
}{
"error": "Unauthorized",
"detail": "Invalid or missing API key"
}{
"error": "Classification failed",
"detail": "Internal server error"
}Gender Detection
Classify speaker gender
Classify the gender of the speaker in an audio file. Accepts either an audio URL (S3 or HTTP) or base64-encoded audio data. Supports WAV, MP3, FLAC, OGG, and other common audio formats.
POST
/
gender-detection
/
classify
Classify speaker gender
curl --request POST \
--url https://restapi.deepdub.ai/api/v1/gender-detection/classify \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"audio_url": "https://example.com/audio/sample.wav",
"audio_base64": "<string>"
}
'import requests
url = "https://restapi.deepdub.ai/api/v1/gender-detection/classify"
payload = {
"audio_url": "https://example.com/audio/sample.wav",
"audio_base64": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({audio_url: 'https://example.com/audio/sample.wav', audio_base64: '<string>'})
};
fetch('https://restapi.deepdub.ai/api/v1/gender-detection/classify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://restapi.deepdub.ai/api/v1/gender-detection/classify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'audio_url' => 'https://example.com/audio/sample.wav',
'audio_base64' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://restapi.deepdub.ai/api/v1/gender-detection/classify"
payload := strings.NewReader("{\n \"audio_url\": \"https://example.com/audio/sample.wav\",\n \"audio_base64\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://restapi.deepdub.ai/api/v1/gender-detection/classify")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"audio_url\": \"https://example.com/audio/sample.wav\",\n \"audio_base64\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://restapi.deepdub.ai/api/v1/gender-detection/classify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"audio_url\": \"https://example.com/audio/sample.wav\",\n \"audio_base64\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"predicted_gender": "female",
"confidence": 0.95,
"prediction": {
"female": 0.95,
"male": 0.05
},
"duration_seconds": 3.5,
"processing_time_ms": 120.5
}{
"error": "Bad request",
"detail": "Either audio_url or audio_base64 must be provided"
}{
"error": "Unauthorized",
"detail": "Invalid or missing API key"
}{
"error": "Classification failed",
"detail": "Internal server error"
}Authorizations
API key for authentication. Must start with dd- prefix.
Headers
API Key
Body
application/json
Response
Successful classification
Gender classification result
Predicted gender of the speaker
Available options:
female, male Example:
"female"
Confidence score (0.0 to 1.0)
Required range:
0 <= x <= 1Example:
0.95
Full prediction scores for both genders
Show child attributes
Show child attributes
Duration of the audio in seconds
Example:
3.5
Processing time in milliseconds
Example:
120.5
