> For the complete documentation index, see [llms.txt](https://infronai.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infronai.gitbook.io/docs/llm-apis/api-guides/errors-code.md).

# Errors code

API Errors

```json
{
    "error": {
        "message": "",
        "type": "",
        "param": "",
        "code": 422
    }
}
```

For errors, Infron returns a JSON response with the following shape:

```typescript
type ErrorResponse = {
  error: {
    code: number;
    message: string;
    type: string;
    param: string;
  };
};
```

The HTTP Response will have the same status code as `error.code`, forming a request error if:

* Your original request is invalid
* Your API key/account is out of credits

Otherwise, the returned HTTP response status will be `200` and any error occurred while the LLM is producing the output will be emitted in the response body or as an SSE data event.

### Error Codes <a href="#error-codes" id="error-codes"></a>

*For the specific cause, check the error message in Logs.*

* **200:** OK (logged as error). The response had HTTP status 200, but an error was recorded during request processing.
* **400:** Bad Request. The request contains malformed JSON or missing, invalid, or unsupported parameters.
* **401:** Unauthorized. Authentication failed because the API key or session is missing, invalid, expired, or unavailable.
* **402:** Payment Required. The request cannot proceed because payment is required or available credits are insufficient.
* **403:** Forbidden. The request is blocked by access restrictions, content moderation, insufficient credits, or budget limits.
* **404:** Not Found. The requested endpoint, model, or other resource could not be found.
* **405:** Method Not Allowed. The endpoint does not support the HTTP method used for this request.
* **407:** Proxy Authentication Required. A proxy handling the request requires valid authentication credentials.
* **408:** Request Timeout. The request could not be completed within the allowed time.
* **410:** Gone. The requested resource has been removed or is no longer available.
* **413:** Payload Too Large. The request body or uploaded content exceeds the size accepted by the service.
* **422:** Unprocessable Entity. The request is well-formed, but its content or parameter values cannot be processed.
* **424:** Failed Dependency. The request could not be completed because a required operation or dependency failed.
* **429:** Too Many Requests. A request, token usage, or concurrency limit has been reached.
* **432:** Non-standard (custom). A non-standard or custom status code was recorded, with details provided in the error message.
* **499:** Client Closed Request. The client closed the connection before the server finished processing the request.
* **500:** Internal Server Error. An unexpected internal error occurred in the platform or upstream service.
* **501:** Not Implemented. The requested endpoint or operation is not supported.
* **502:** Bad Gateway. The upstream service returned an invalid or unreadable response.
* **503:** Service Unavailable. No suitable provider is available, or the service is temporarily unable to process the request.
* **504:** Gateway Timeout. A gateway timed out while waiting for the upstream service to respond.
* **507:** Insufficient Storage. The responding service does not have enough storage to complete the request.
* **520:** Cloudflare Unknown Error. The origin server returned an unexpected or invalid response to Cloudflare.
* **522:** Cloudflare Connection Timeout. Cloudflare could not connect to the origin server within the allowed time.
* **524:** Cloudflare Origin Timeout. Cloudflare connected to the origin server, but the request did not complete within the allowed time.
* **529:** Anthropic Overloaded. The upstream service is overloaded and temporarily unable to process the request.

### When No Content is Generated <a href="#when-no-content-is-generated" id="when-no-content-is-generated"></a>

Occasionally, the model may not generate any content. This typically occurs when:

* The model is warming up from a cold start
* The system is scaling up to handle more requests

Warm-up times usually range from a few seconds to a few minutes, depending on the model and provider.

If you encounter persistent no-content issues, consider implementing a simple retry mechanism or trying again with a different provider or model that has more recent activity.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://infronai.gitbook.io/docs/llm-apis/api-guides/errors-code.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
