since you've received this response from the server:
{'message': '400: Bad Request', 'code': 0}
It indicates that you have actually hit a server endpoint, so you've probably just not included all the data that the server was expecting for the request.
Note that the docs specify that 'data' should be "(optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the Request", so probably best practice to encode your text beforehand like:
my_text = "some json encoded text"
requests.post(api_url, my_text.encode("ascii"), headers = headers)
Double check the data you are sending (especially spelling) matches what the server requires for the request.