跳到主要内容

语音年龄估算 API

根据上传的音频文件估算说话人的年龄。

基础 URL​

https://api.genderrecognition.com

端点​

POST /v1/voice-age/api

请求标头​

apiKey: YOUR_API_KEY
Content-Type: multipart/form-data

请求正文​

字段类型必填说明
filefile是要分析的音频文件。

示例​

curl -X POST "https://api.genderrecognition.com/v1/voice-age/api" \
-H "apiKey: YOUR_API_KEY" \
-F "file=@audio.wav"

响应​

{
"success": true,
"estimated_age_years": 32,
"confidence": 91,
"probabilities": {
"male": 86,
"female": 9,
"child": 5
},
"remainingRequests": 2999
}

错误情况​

缺少 API 密钥​

{
"error": "API key is required"
}

API 密钥无效​

{
"error": "Invalid API key"
}

缺少文件​

{
"error": "No file uploaded"
}

文件类型无效​

{
"error": "Invalid file type. Allowed formats: WAV, MP3, FLAC, MP4, OGG, AIFF"
}

配额已用尽​

{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "You have exceeded your free tier limit of 50 requests.",
"detailedMessage": "Insufficient remaining requests. Required: 1, Available: 0",
"details": {
"limit": 50,
"used": 50,
"reset_date": "2026-07-01T00:00:00.000Z"
},
"suggested_action": "Please upgrade to a premium plan to continue using the API."
}
}

处理失败​

{
"error": "Voice age detection failed"
}

说明​

  • 后端接受 WAV、MP3、FLAC、MP4、OGG 和 AIFF 等常见音频格式。
  • 音频上传使用 file 字段,文件大小不得超过 10 MB。