# 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 success. Codes in the `4xx` range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the `5xx` range indicate an error with Speechace's servers (these are rare).

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

<table><thead><tr><th width="139.33333333333331">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 (perhaps due to using the same idempotent key).</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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.speechace.com/getting-started/error-handling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
