ApiSyntaxError: Could not parse API call kwargs as JSON

Custom GPT Action

Uses Code Interpreter to correctly construct and validate JSON, and is given strict instructions to use the validated JSON to send to the API.

When sending to the custom Actions API, the debug log shows a different, corrupted JSON is being sent that causes the ApiSytnaxError

E.g. Code Interpreters correct JSON snippet

Debug Logs JSON snippet where it fails to close the dataStored object with a closing }

Why is it not sending the JSON that is correctly constructed and validated by the Code Interpreter?

Is it again processing the message to be sent internally and corrupting it?

It seems to get corrupted with nested objects.

Exactly how does an Action internally generate the params{}?


Similar issue here. My API works when the amount of POST data is small. However, when I send 100+ lines of data, I get:

  "response_data": "ApiSyntaxError: Could not parse API call kwargs as JSON: exception=Unterminated string starting at: line 1 column 1717 (char 1716) url=my/api"

My logs don’t even show GPT hitting the API when the POST length is too long. API works fine with Postman.