# Error Handling

API responses are delivered in JSON format. The client applications must parse this JSON to extract the required data. Equally important is handling the HTTP status code returned with each response to determine success or failure.

**Common HTTP Status Codes:**

<table data-header-hidden><thead><tr><th width="112.921875" valign="top">Status Code</th><th valign="top">Meaning</th><th valign="top">What to Do</th></tr></thead><tbody><tr><td valign="top">400</td><td valign="top">Bad Request: Malformed request, invalid parameters or format</td><td valign="top">Check your request syntax and parameters</td></tr><tr><td valign="top">401</td><td valign="top">Unauthorized: Authentication failed (missing, invalid, or expired token)</td><td valign="top">Obtain or refresh your API Key</td></tr><tr><td valign="top">402</td><td valign="top">x402: Payment Required</td><td valign="top">Please make the payment for API request and try again</td></tr><tr><td valign="top">403</td><td valign="top">Forbidden: Auth succeeded, but no permission for resource</td><td valign="top">Ensure your account has access rights</td></tr><tr><td valign="top">404</td><td valign="top">Not Found: Resource or endpoint does not exist</td><td valign="top">Verify the endpoint path and resource identifiers</td></tr><tr><td valign="top">422</td><td valign="top">Unprocessable Content</td><td valign="top">Please verify your parameters</td></tr><tr><td valign="top">429</td><td valign="top">Too Many Requests: Rate limit exceeded</td><td valign="top">Slow down requests; respect rate limits</td></tr><tr><td valign="top">500</td><td valign="top">Internal Server Error: Unexpected server issue</td><td valign="top">Try again later; contact support if persistent</td></tr><tr><td valign="top">504</td><td valign="top">Gateway Timeout: Backend server did not respond in time</td><td valign="top">Retry after a short wait; check for heavy queries</td></tr></tbody></table>

<br>


---

# 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://docs.nansen.ai/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.
