Payload Limits

To ensure optimal performance and reliability of the CSA Prediction Engine API, payload limits are enforced on all HTTP POST 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.

If you are using the CSA Python API Client, 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.

Recommendations for Managing Payload Size

To avoid exceeding the payload limit:

Optimize Data:

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

Check Data Encoding

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, you could choose to encode your json payload accordingly, remove indents and use lean separators without spaces.

Example in Python:
payload = json.dumps(variables, indent=None, separators=(',', ':'), cls=Float32Encoder)

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.

Last updated