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
| Field | Type | Description |
|---|---|---|
audio_base64required | string | The 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. |
transcriptrequired | string | The 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.
{
"audio_base64": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQAAAAA=",
"transcript": "Could you send the proposal by Thursday?",
"language": "us"
}Responses
200 Assessment result. · PronunciationResponse
| Field | Type | Description |
|---|---|---|
accuracyrequired | number (0–1) | Overall pronunciation score for the utterance: correct phonemes divided by all phonemes, from 0 to 1 (higher is better). |
wordsrequired | array of WordScore | One entry per word of the normalised transcript, in order. |
words[].textrequired | string | The 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[].accuracyrequired | number (0–1) | Share of the word’s phonemes that were pronounced correctly, from 0 to 1. |
words[].start_timerequired | number | Start of the word in the audio, in seconds. |
words[].end_timerequired | number | End of the word in the audio, in seconds. |
words[].phonemesrequired | array of PhonemeScore | The 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[].textrequired | string | The expected phoneme, in IPA. Empty string when the word is not in the reference pronunciation lexicon. |
words[].phonemes[].start_timerequired | number | Start of the phoneme in the audio, in seconds. Can be 0 when the phoneme was not detected. |
words[].phonemes[].end_timerequired | number | End of the phoneme in the audio, in seconds. Can be 0 when the phoneme was not detected. |
words[].phonemes[].probabilityrequired | number (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[].correctrequired | boolean | Whether the phoneme was pronounced as expected. |
words[].phonemes[].expectedrequired | array of string | Accepted pronunciation(s) of this phoneme, in IPA. |
words[].phonemes[].candidatesrequired | array of PhonemeCandidate | Other phonemes the model heard, with their probability. Often empty. |
words[].phonemes[].candidates[].valuerequired | string | Phoneme the model heard, in IPA. |
words[].phonemes[].candidates[].probabilityrequired | number (0–1) | Model probability for this candidate, from 0 to 1. |
{
"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
| Field | Type | Description |
|---|---|---|
detailrequired | string | JSON text such as {"detail":"Invalid WAV file format"}: parse it to get the message. |
{
"detail": "{\"detail\":\"'fr' is not supported. Language must be 'us' or 'uk'.\"}"
}{
"detail": "{\"detail\":\"Invalid WAV file format\"}"
}{
"detail": "{\"detail\":\"Audio file is too short (minimum 0.1 seconds required)\"}"
}401 Missing, malformed, invalid or expired token. · ErrorDetail
{
"detail": "Missing or invalid Authorization header"
}422 Validation Error · HTTPValidationError
| Field | Type | Description |
|---|---|---|
detailoptional | array of ValidationError | |
detail[].locrequired | array of any | |
detail[].msgrequired | string | |
detail[].typerequired | string |
429 More than 10 requests in the current minute from your IP address. · RateLimitError
{
"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
{
"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
{
"detail": "Pronunciation service at capacity, please retry"
}{
"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
| Field | Type | Description |
|---|---|---|
detailrequired | string | JSON text such as {"detail":"Invalid WAV file format"}: parse it to get the message. |
{
"detail": "{\"detail\":\"Model inference timed out after 30.0s\"}"
}