IDVoice
Overview¶
Cloud solution is the easiest way to test and use the REST API provided by IDVoice Server. It's available at the following base URL: https://voice-rest-api.idrnd.net
. In order to work with this solution, you should contact our sales team, and they will provision an API token for you. After that you should send that API key on every request as value of the x-api-key
HTTP header.
OpenAPI specification¶
For REST API reference and usage examples please refer to the OpenAPI specification available here. It can be easily imported in tools like Swagger Editor or Postman. Make sure to set proper base URL and authorization as described above.
You can find the Postman-based REST API reference for the IDVoice Cloud API here.
Sample requests¶
Below are several examples of using various endpoints. Make sure you have curl
, jq
and jo
utilities installed.
Liveness (replay attack detection):
$ curl -H 'x-api-key: @api_token.txt' --form audio_file=@file.wav -X POST https://voice-rest-api.idrnd.net/liveness_engine/check_liveness_file
{"score":0.26348,"probability":0.6038183,"validation_status_code":"OK"}
Liveness (voice clones/deepfakes detection):
$ curl -H 'x-api-key: @api_token.txt' --form audio_file=@file.wav -X POST https://voice-rest-api.idrnd.net/liveness_engine/check_liveness_file?configuration=voice-clones
{"score":0.26348,"probability":0.6038183,"validation_status_code":"OK"}
Verification:
$ voice_template1=$(curl -s -H 'x-api-key: @api_token.txt' --form wav_file=@file1.wav -X POST https://voice-rest-api.idrnd.net/voice_template_factory/create_voice_template_from_file)
$ voice_template2=$(curl -s -H 'x-api-key: @api_token.txt' --form wav_file=@file2.wav -X POST https://voice-rest-api.idrnd.net/voice_template_factory/create_voice_template_from_file)
$ curl -H 'x-api-key: @api_token.txt' -H 'Content-Type: application/json' --data $(jo template1=$voice_template1 template2=$voice_template1) -X POST https://voice-rest-api.idrnd.net/voice_template_matcher/verify
{"probability":1.0,"score":0.9999996423721313}
Speech summary:
$ # real voice
$ curl -H 'x-api-key: @api_token.txt' --form wav_file=@file.wav -X POST https://voice-rest-api.idrnd.net/speech_summary_engine/get_speech_summary_from_file | jq 'del(.vad_result)'
{
"background_length": 1.350000023841858,
"speech_signal_length": 1.7100000381469727,
"total_length": 3.066499948501587
}
Please note that the Cloud API doesn't provide WebSocket support, so in case you need it to implement streaming test-cases, please contact our sales team for IDVoice Server on-premise package.