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

API reference guide

1. Introduction

This document includes the API description for the service offered in the product FacePhi Voice Service.

2. Rest API

The service offers these two main endpoints:

  • /api/v1/enrollment: This endpoint is used to enroll a new voice. It receives one or more audio files and returns a voice template. The voice template is a string containing the voice's biometric information. This template can be used to authenticate voices in the future. The audio files may or may not be encrypted, and are encoded in base64. The returned template is always encrypted and encoded in base64. It accepts 1 audio file, or 3 to 5 audio files, for text-independent or text-dependent enrollment, respectively:

      - 1 audio file for text-independent enrollment.
      - 3 to 5 audio files for text-dependent enrollment.
  • /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 voice in the template, as well as a probability indicating the similarity between the two voices. The audio file may or may not be encrypted, and is encoded in base64. The voice template must be encrypted and encoded in base64.

  • /api/v1/version and /api/v1/health: Public management endpoints for retrieving the service version and availability status (readiness).

  • /api/v1/config: Management endpoint for retrieving or updating the public runtime configuration. JWT authentication startup settings are intentionally hidden from the GET response and rejected in the POST operation.

Optional JWT authentication can be enabled at startup from config.json or through the environment variables FACEPHI_VOICE_REST_AUTH_*. When JWT is enabled, GET /api/v1/version, GET /api/v1/health and preflight requests OPTIONS remain public, while all other endpoints require a valid JWT via Authorization: Bearer <jwt> or the configured API key header.

Last updated