# Payload Limits

To ensure optimal performance and reliability of the **CSA Prediction Engine API**, payload limits are enforced on all HTTP <mark style="color:red;">POST</mark> requests. This helps prevent excessive memory usage and ensures that the API can handle requests consistently for all users.

### Maximum Payload Size

The payload size for any HTTP POST request to the CSA Prediction Engine API must not exceed **10 MB**. Requests exceeding this limit will be rejected with a 413 Payload Too Large error response.

{% hint style="info" %}
If you are using the [**CSA Python API Client**](/python-api-package/introduction.md), our package automatically handles large input objects by uploading them through an alternative channel before executing the `HTTP POST` request for your prediction task.

Limitations described below are specific to users accessing the API via `curl` or other direct integration methods.
{% endhint %}

### Recommendations for Managing Payload Size

To avoid exceeding the payload limit:

#### Optimize Data:&#x20;

Consider optimizing the data sent in the request. Exclude any redundant or non-essential information.

#### Check Data Encoding&#x20;

Ensure that all data in the request payload is appropriately encoded and formatted to prevent unnecessary size increases due to encoding inefficiencies. Since the API uses [single precision](/getting-started/single-precision-and-performance.md), you could choose to encode your json payload accordingly, remove indents and use lean separators without spaces.

{% code title="Example in Python:" fullWidth="false" %}

```python
payload = json.dumps(variables, indent=None, separators=(',', ':'), cls=Float32Encoder)
```

{% endcode %}

### Handling Payload Errors

If you receive a 413 Payload Too Large error:

* Review Payload: Confirm the size of your payload before retrying the request. If necessary, trim the data.
* Monitor API Usage: Consistently monitor and manage the data sent to ensure it aligns with the payload limits.


---

# 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.csanalytics.io/getting-started/payload-limits.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.
