For the complete documentation index, see llms.txt. This page is also available as Markdown.

/api/v1/authentication

This endpoint is used to authenticate a voice. It receives an audio file and a voice template, and returns a boolean value indicating whether the voice belongs to the same person as the one in the voice template, as well as a probability indicating the similarity between both voices.

post
Autorizações
AuthorizationstringObrigatório
Bearer authentication header of the form Bearer <token>.
Corpo

Authentication request body

audiostringObrigatório

Raw audio buffer in WAV, OPUS/OGG, MP3 or AAC format, encoded in base64 RFC4648. The audio may or may not be encrypted.

Example: /9j/4AAQSkZJRgABAQEAtAC0AAD...
templatestringObrigatório

Biometric template buffer, obtained from Enrollment(), encrypted and encoded in base64 RFC4648.

Example: BAEBGgEroySjGz2C9iIki35J/FA...
check_livenessbooleanOpcional

If true, a liveness check will be performed

Default: falseExample: false
check_qualitybooleanOpcional

If true, a quality check will be performed

Default: trueExample: true
liveness_thresholdnumberOpcional

Threshold for liveness detection. If the liveness probability is below this value, the audio is considered invalid.

Default: 0.5Example: 0.5
minimum_snr_dbnumberOpcional

Minimum SNR in dB for the audio to be considered valid.

Default: 8Example: 8
minimum_speech_duration_msnumberOpcional

Minimum audio duration in milliseconds for it to be considered valid.

Default: 1000Example: 1000
minimum_speech_relative_lengthnumberOpcional

Minimum relative speech length (speech length relative to the total audio duration).

Default: 0Example: 0
maximum_multiple_speakers_detector_scorenumberOpcional

Maximum score allowed by the multiple speakers detector.

Default: 1Example: 1
extra_datastringOpcional

Tokenized data to invoke the Api Tracking service after the operation, encoded in base64.

Example: BQABAQGkJhiCqQjKYUZyDM...
Respostas
200

The result of the authentication. The *_detected fields are only present when the audio quality check fails.

application/json

Authentication response

operation_resultnumber · enumOpcional

Result of the operation.

Example: 3Valores possíveis:
matchbooleanOpcional

Indicates whether the audio matches the template

Example: true
liveness_scorenumberOpcional

Liveness probability

Example: 0.9
matching_scorenumberOpcional

Matching probability

Example: 0.9
snr_db_detectednumberOpcional

SNR in dB detected in the audio.

Example: 8
speech_length_ms_detectednumberOpcional

Speech duration in milliseconds detected in the audio.

Example: 1000
speech_relative_length_detectednumberOpcional

Relative speech length detected in the audio.

Example: 0.5
multiple_speakers_score_detectednumberOpcional

Multiple speakers score detected in the audio.

Example: 1
tracking_statusnumberOpcional

Status returned by the Api Tracking service, or -1 if tracking is not required.

Example: 201
tracking_messagestringOpcional

Message returned by the Api Tracking service, or empty if tracking is not required.

Example: Authentication: Ok
post/api/v1/authentication
POST /api/v1/authentication HTTP/1.1
Host: 127.0.0.1:6982/
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 329

{
  "audio": "/9j/4AAQSkZJRgABAQEAtAC0AAD...",
  "template": "BAEBGgEroySjGz2C9iIki35J/FA...",
  "check_liveness": false,
  "check_quality": true,
  "liveness_threshold": 0.5,
  "minimum_snr_db": 8,
  "minimum_speech_duration_ms": 1000,
  "minimum_speech_relative_length": 0,
  "maximum_multiple_speakers_detector_score": 1,
  "extra_data": "BQABAQGkJhiCqQjKYUZyDM..."
}
{
  "operation_result": 3,
  "match": true,
  "liveness_score": 0.9,
  "matching_score": 0.9,
  "snr_db_detected": 8,
  "speech_length_ms_detected": 1000,
  "speech_relative_length_detected": 0.5,
  "multiple_speakers_score_detected": 1,
  "tracking_status": 201,
  "tracking_message": "Authentication: Ok"
}

Atualizado