> For the complete documentation index, see [llms.txt](https://api-docs.speechace.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.speechace.com/getting-started/error-handling.md).

# Error Handling

Speechace uses conventional HTTP response codes to indicate the success or failure of an API request. In general: codes in the `2xx` range indicate API execution success; The `status` field in the API response indicates wether the scoring request itself was successful or if an error occured due the information provided (e.g., a required parameter was omitted); codes in the `5xx` range indicate an error with Speechace's servers (these are rare).

{% hint style="info" %}
A `2xx` HTTP status does not always mean the audio was scorable. Always check the JSON `status` field — a request can return `200` with `"status": "error"` and a `short_message`. See [Scoring errors & warnings](/interpreting-results/scoring-errors-and-warnings.md) for signals returned *inside* an otherwise successful score.
{% endhint %}

#### **HTTP Status Code Summary**

<table><thead><tr><th width="139">Code</th><th width="179">Code Meaning</th><th>Description</th></tr></thead><tbody><tr><td>200</td><td>OK</td><td>Everything worked as expected.</td></tr><tr><td>400</td><td>Bad Request</td><td>The request was unacceptable, often due to missing a required parameter.</td></tr><tr><td>401</td><td>Unauthorized</td><td>No valid API key provided.</td></tr><tr><td>402</td><td>Request Failed</td><td>The parameters were valid but the request failed.</td></tr><tr><td>403</td><td>Forbidden</td><td>The API key doesn’t have permissions to perform the request.</td></tr><tr><td>404</td><td>Not Found</td><td>The requested resource doesn’t exist.</td></tr><tr><td>409</td><td>Conflict</td><td>The request conflicts with another request.</td></tr><tr><td>429</td><td>Too Many Requests</td><td>Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.</td></tr><tr><td>500, 502, 503, 504</td><td>Server Errors</td><td>Something went wrong on the Server's end. (These are rare.)</td></tr></tbody></table>

## Error response format

Whenever the API returns an error, the response will appear as follows:

{% code title="Sample error response" collapsedlinecount="10" %}

```json
{
    "status": "error",
    "short_message": "error_invalid_parameters",
    "detail_message": "key"
}
```

{% endcode %}

The attributes of the response are:

* `status`: whether the response is a success or an error.
* `short_message`: the type of error returned — one of the codes in the tables below.
* `detail_message`: a human-readable message with more detail (often naming the offending parameter).

Branch on `short_message`, not on `detail_message` (which is free text). Note that similar-sounding codes are distinct — for example `error_unknown_words` (a lexicon/parse problem with the text) is **not** `error_feature_unavailable` (the feature isn't offered for your plan, region, or dialect).

## Errors

Every `short_message` the API returns, grouped by cause.

### Request & parameters

| Error                      | Cause & solution                                                                                                                                                                                                                                                                                            |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `error_missing_parameters` | <p><strong>Cause:</strong> one or more required API parameters were missing. </p><p><strong>Solution:</strong> check <code>detail\_message</code> for the missing parameter.</p>                                                                                                                            |
| `error_invalid_parameters` | <p><strong>Cause:</strong> one or more API parameters were invalid. </p><p><strong>Solution:</strong> check <code>detail\_message</code> for the offending parameter.</p>                                                                                                                                   |
| `error_invalid_request`    | <p><strong>Cause:</strong> the request contains a combination of API version and parameters that does not exist. </p><p><strong>Solution:</strong> check the version in the endpoint path and the parameter combination against the <a href="/api-reference/choosing-an-endpoint.md">API Reference</a>.</p> |
| `error_key_expired`        | <p><strong>Cause:</strong> your API key is not active. </p><p><strong>Solution:</strong> check your subscription status or contact <code><support@speechace.com></code>.</p>                                                                                                                                |

### Audio

| Error                  | Cause & solution                                                                                                                                                                                                                                                                                                                                       |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `error_audio_missing`  | <p><strong>Cause:</strong> the audio file was not correctly passed or is missing. </p><p><strong>Solution:</strong> check the audio form-data field in the request body.</p>                                                                                                                                                                           |
| `error_audio_empty`    | <p><strong>Cause:</strong> an audio file was received but contains no audio (zero bytes or no samples). Distinct from <code>error\_audio\_missing</code> (no file at all) and <code>error\_no\_speech</code> (audio present but no voice). </p><p><strong>Solution:</strong> verify your recording/upload pipeline is capturing and sending audio.</p> |
| `error_convert_audio`  | <p><strong>Cause:</strong> the audio is corrupt or not in a valid format (mp3, wav, webm, aac, etc.). </p><p><strong>Solution:</strong> check that the file is not corrupt and is in an accepted <a href="/getting-started/api-limits.md">format</a>.</p>                                                                                              |
| `error_audio_too_long` | <p><strong>Cause:</strong> your <a href="/getting-started/api-limits.md">audio duration</a> exceeds your API license limit. </p><p><strong>Solution:</strong> limit the recording length, or contact <code><support@speechace.com></code> to upgrade.</p>                                                                                              |
| `error_file_too_large` | <p><strong>Cause:</strong> your <a href="/getting-started/api-limits.md">audio file size</a> exceeds your API license limit. </p><p><strong>Solution:</strong> record at the required <a href="/getting-started/api-limits.md">sample rate</a> and no higher to optimize file size.</p>                                                                |

### Speech & content

| Error                    | Cause & solution                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `error_no_speech`        | **Cause:** no human voice detected in the audio. **Solution:** ensure the audio contains clear human speech; this often signals a recording-logic failure.                                                                                                                                                                                                               |
| `error_other_speech`     | <p><strong>Cause:</strong> the audio is entirely different from the expected text. </p><p><strong>Solution:</strong> ensure the speaker is reading the intended text and that the correct text is being passed.</p>                                                                                                                                                      |
| `error_word_alignment`   | <p><strong>Cause:</strong> the audio did not align with any of the words in the intended text (often background noise or unclear speech). </p><p><strong>Solution:</strong> check for background noise and ensure the speech is clear.</p>                                                                                                                               |
| `error_no_word`          | **Cause:** the request's text contained no scorable words (e.g. empty, special characters, or whitespace-only text). **Solution:** supply non-empty text with at least one recognizable word.                                                                                                                                                                            |
| `error_unknown_words`    | <p><strong>Cause:</strong> one or more words are outside the Speechace lexicon. </p><p><strong>Solution:</strong> use the <a href="/api-reference/validate-text.md">Validate Text API</a> at authoring time to catch these, or pass <a href="/interpreting-results/automatic-handling-of-unknown-words.md">include\_unknown\_words</a> to handle them automatically.</p> |
| `error_unknown_phonemes` | <p><strong>Cause:</strong> the phoneme sequence supplied (<code>score/phone\_list</code>, or <code>arpa\_mark</code> markup) contains phonemes that are not in the target dialect's phoneme set. </p><p><strong>Solution:</strong> use only phonemes from the dialect's ARPABET — see <a href="/reference-data/phonetic-notation.md">Phonetic notation</a>.</p>          |
| `error_text_too_long`    | <p><strong>Cause:</strong> the submitted text is longer than 1500 characters. </p><p><strong>Solution:</strong> shorten the text to meet the limit.</p>                                                                                                                                                                                                                  |
| `error_answer_too_long`  | <p><strong>Cause:</strong> a <a href="/api-reference/score-writing.md">Score Writing</a> submission (<code>answer</code>) exceeds the maximum length for its <code>task\_type</code>. </p><p><strong>Solution:</strong> keep the answer within the <code>task\_type</code>'s word range.</p>                                                                             |

### Dialect & features

| Error                           | Cause & solution                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `error_feature_unavailable`     | <p><strong>Cause:</strong> you attempted to use a feature not provided in your subscription. </p><p><strong>Solution:</strong> contact <code><support@speechace.com></code> to upgrade your plan.</p>                                                                                                                                                                                                                                                                               |
| `error_not_supported`           | <p><strong>Cause:</strong> the request contains a feature parameter for a feature not supported in the current API region or dialect. </p><p><strong>Solution:</strong> check the <a href="/getting-started/supported-languages.md">Supported languages</a> coverage matrix and your key's region; use a region/dialect that supports the feature.</p>                                                                                                                              |
| `non_dialect_language_detected` | <p><strong>Cause:</strong> with language detection (<code>detect\_dialect</code> / <code>enforce\_dialect</code>), the language detected in the audio is not one of Speechace's supported dialects. With <code>enforce\_dialect=1</code> this is returned as an error. </p><p><strong>Solution:</strong> have the speaker respond in a supported dialect, or omit <code>enforce\_dialect</code> to score anyway. See <a href="/api-reference/score-speech.md">Score Speech</a>.</p> |

### Limits & quota

| Error                     | Cause & solution                                                                                                                                                            |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `error_too_many_requests` | **Cause:** you exceeded the allowed concurrent request volume and are being throttled. **Solution:** back off and retry with exponential backoff (see [Retries](#retries)). |

### Server

| Error            | Cause & solution                                                                                                                                                                                      |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `error_timeout`  | <p><strong>Cause:</strong> the request took too long to process and timed out on the server. </p><p><strong>Solution:</strong> retry; if it persists, reduce the audio length or contact support.</p> |
| `error_internal` | <p><strong>Cause:</strong> a catch-all for unforeseen server-side errors. </p><p><strong>Solution:</strong> contact <code><support@speechace.com></code> for assistance.</p>                          |

## Retries

On `429 Too Many Requests` (`error_too_many_requests`), back off and retry with exponential backoff. `error_timeout` and the `5xx` / `error_internal` server errors may also be retried. Handle `status: "error"` responses gracefully by reading `short_message` and `detail_message`. If you can't resolve an error, [raise a support ticket](/resources/requesting-support.md).
