Reference

API reference

Taktik Voice API v1.0.0. Base URL https://api.taktikvoice.com. Generated from our OpenAPI document; to send test requests from your browser, open the interactive explorer.

Assess pronunciation

POSThttps://api.taktikvoice.com/service/pronunciation

Scores a recording against the text the speaker was asked to read, at utterance, word and phoneme level. Rate limit: 10 requests per minute per client IP. Errors raised by the assessment service (400, 503 while the model loads, 504) carry a double-encoded detail: see ServiceErrorDetail.

Authentication: Authorization: Bearer <token>. See Authentication.

Request body application/json · PronunciationRequest

Request body fields
FieldTypeDescription
audio_base64requiredstringThe recording as a WAV file, base64-encoded. Recommended: PCM 16-bit, 16 kHz, mono (other sample rates are resampled to 16 kHz and stereo is mixed down to mono). At least 0.1 seconds; keep it to a sentence, because processing is cut off at about 30 seconds. Send the plain base64 string, without a data: URI prefix.
transcriptrequiredstringThe text the speaker was asked to read. Must not be empty.
languageoptional"us" | "uk"Reference accent: uk (British English, default) or us (American English). Any other value returns 400. Default: "uk".

audio_base64 here is only the 44-byte header of an empty 16 kHz mono 16-bit WAV file.

Example request body
{
  "audio_base64": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQAAAAA=",
  "transcript": "Could you send the proposal by Thursday?",
  "language": "us"
}

Responses

200 Assessment result. · PronunciationResponse

Fields of the 200 response
FieldTypeDescription
accuracyrequirednumber (0–1)Overall pronunciation score for the utterance: correct phonemes divided by all phonemes, from 0 to 1 (higher is better).
wordsrequiredarray of WordScoreOne entry per word of the normalised transcript, in order.
words[].textrequiredstringThe word after normalisation: punctuation removed and numbers spelled out (21 becomes twenty and one), so words can have more entries than the transcript has words.
words[].accuracyrequirednumber (0–1)Share of the word’s phonemes that were pronounced correctly, from 0 to 1.
words[].start_timerequirednumberStart of the word in the audio, in seconds.
words[].end_timerequirednumberEnd of the word in the audio, in seconds.
words[].phonemesrequiredarray of PhonemeScoreThe expected phonemes of the word, in order (the most likely pronunciation in the reference pronunciation lexicon). A word missing from the pronunciation lexicon comes back with a single phoneme whose text is an empty string and correct is false.
words[].phonemes[].textrequiredstringThe expected phoneme, in IPA. Empty string when the word is not in the reference pronunciation lexicon.
words[].phonemes[].start_timerequirednumberStart of the phoneme in the audio, in seconds. Can be 0 when the phoneme was not detected.
words[].phonemes[].end_timerequirednumberEnd of the phoneme in the audio, in seconds. Can be 0 when the phoneme was not detected.
words[].phonemes[].probabilityrequirednumber (0–1)Model probability for this phoneme, from 0 to 1. It is a confidence value, not a grade: use correct to decide whether the phoneme was pronounced as expected.
words[].phonemes[].correctrequiredbooleanWhether the phoneme was pronounced as expected.
words[].phonemes[].expectedrequiredarray of stringAccepted pronunciation(s) of this phoneme, in IPA.
words[].phonemes[].candidatesrequiredarray of PhonemeCandidateOther phonemes the model heard, with their probability. Often empty.
words[].phonemes[].candidates[].valuerequiredstringPhoneme the model heard, in IPA.
words[].phonemes[].candidates[].probabilityrequirednumber (0–1)Model probability for this candidate, from 0 to 1.
Example response (excerpt of a real response)
{
  "accuracy": 0.96,
  "words": [
    {
      "text": "Could",
      "phonemes": [
        {
          "text": "kʰ",
          "start_time": 0.2405,
          "end_time": 0.2605,
          "probability": 0.9956,
          "correct": true,
          "expected": [
            "kʰ"
          ],
          "candidates": []
        },
        {
          "text": "ʊ",
          "start_time": 0.2806,
          "end_time": 0.3006,
          "probability": 0.6448,
          "correct": true,
          "expected": [
            "ʊ"
          ],
          "candidates": []
        },
        {
          "text": "d",
          "start_time": 0.3407,
          "end_time": 0.3808,
          "probability": 0.4019,
          "correct": true,
          "expected": [
            "d"
          ],
          "candidates": []
        }
      ],
      "start_time": 0.2405,
      "end_time": 0.3808,
      "accuracy": 1
    },
    {
      "text": "Thursday",
      "phonemes": [
        {
          "text": "θ",
          "start_time": 1.6634,
          "end_time": 1.6834,
          "probability": 0.9876,
          "correct": true,
          "expected": [
            "θ"
          ],
          "candidates": []
        },
        {
          "text": "ɝ",
          "start_time": 1.7035,
          "end_time": 1.7235,
          "probability": 0.9863,
          "correct": true,
          "expected": [
            "ɝ"
          ],
          "candidates": []
        },
        {
          "text": "z",
          "start_time": 1.944,
          "end_time": 1.964,
          "probability": 0.9938,
          "correct": true,
          "expected": [
            "z"
          ],
          "candidates": []
        },
        {
          "text": "d",
          "start_time": 1.9841,
          "end_time": 2.0241,
          "probability": 0.9592,
          "correct": true,
          "expected": [
            "d"
          ],
          "candidates": []
        },
        {
          "text": "ej",
          "start_time": 0,
          "end_time": 0,
          "probability": 0,
          "correct": false,
          "expected": [
            "ej"
          ],
          "candidates": [
            {
              "value": "h/ç",
              "probability": 0.0103
            }
          ]
        }
      ],
      "start_time": 1.6634,
      "end_time": 2.0241,
      "accuracy": 0.8
    }
  ]
}

400 The assessment service rejected the request: `language` other than `us`/`uk`, empty transcript, invalid base64, audio that is not a readable WAV, empty or shorter than 0.1 seconds. `detail` is double-encoded. · ServiceErrorDetail

ServiceErrorDetail
FieldTypeDescription
detailrequiredstringJSON text such as {"detail":"Invalid WAV file format"}: parse it to get the message.
Example 400 body: Unsupported language
{
  "detail": "{\"detail\":\"'fr' is not supported. Language must be 'us' or 'uk'.\"}"
}
Example 400 body: Audio is not a readable WAV file
{
  "detail": "{\"detail\":\"Invalid WAV file format\"}"
}
Example 400 body: Audio too short
{
  "detail": "{\"detail\":\"Audio file is too short (minimum 0.1 seconds required)\"}"
}

401 Missing, malformed, invalid or expired token. · ErrorDetail

Example 401 body
{
  "detail": "Missing or invalid Authorization header"
}

422 Validation Error · HTTPValidationError

HTTPValidationError
FieldTypeDescription
detailoptionalarray of ValidationError
detail[].locrequiredarray of any
detail[].msgrequiredstring
detail[].typerequiredstring

429 More than 10 requests in the current minute from your IP address. · RateLimitError

Example 429 body
{
  "error": "Rate limit exceeded: 10 per 1 minute"
}

500 Unexpected error. The usual cause is a long recording: the gateway waits 30 seconds for the assessment and then answers 500 with a `ReadTimeout` in `detail`. · ErrorDetail

Example 500 body
{
  "detail": "Gateway error forwarding to pronunciation-service: ReadTimeout('')"
}

503 Temporarily unavailable: either the service stayed at capacity after the gateway retried for you (plain `detail`), or the model is still loading on a freshly started instance (double-encoded `detail`). Retry later with backoff. · ErrorDetail

Example 503 body: At capacity after the gateway’s retries
{
  "detail": "Pronunciation service at capacity, please retry"
}
Example 503 body: Model still loading (double-encoded)
{
  "detail": "{\"detail\":\"Model is still loading, please retry\"}"
}

504 Model inference took longer than 30 seconds. In practice the gateway’s own 30-second timeout usually fires first, so a long recording more often surfaces as `500`. `detail` is double-encoded. · ServiceErrorDetail

ServiceErrorDetail
FieldTypeDescription
detailrequiredstringJSON text such as {"detail":"Invalid WAV file format"}: parse it to get the message.
Example 504 body
{
  "detail": "{\"detail\":\"Model inference timed out after 30.0s\"}"
}