Assess pronunciation
assess_pronunciationScores pronunciation from an audio recording against a reference text and returns sentence, word, and sound-level feedback with expected-versus-heard details.
Instructions
Score a recording of someone reading a known reference text (POST /v1/assess). Give the audio as a local file path, base64, or an http(s) URL (WAV, MP3, M4A, Ogg or WebM; 0.15-30 s; max 10 MB), plus the reference text and locale. Returns a short summary and the full JSON (sentence, word and sound scores, expected vs heard, timings, billing). Uses the API key in TONEPERFECT_API_KEY; 1 credit per started 15 s of assessable audio.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | No | general (default), connected_speech (enables Mandarin component correction decisions) or isolated_word. | general |
| text | No | The expected words the speaker read. Required unless pinyin is given (Mandarin only). Numbers written as words. | |
| pinyin | No | Mandarin only: numbered-tone pinyin, one syllable per character, e.g. "ni3 hao3". | |
| filename | No | Optional filename sent with the upload (helps format detection). | |
| language | No | Locale: zh-CN, en-US, fr-FR, es-419, de-DE, it-IT, pt-BR, ru-RU, ko-KR (beta), ja-JP (beta). | zh-CN |
| audio_url | No | http(s) URL to download the audio from. | |
| audio_path | No | Path to a local audio file (~ is expanded). | |
| audio_base64 | No | Audio bytes as base64 (a data: URL prefix is accepted). | |
| idempotency_key | No | Optional. Defaults to a hash of the audio and fields, so repeating the identical call within 24 h returns the stored result without charging again. |