While testing API with postman I keep getting “400 Bad Request”, although the same request worked from cURL console… I’m pretty sure it’s something stupid, but already lost 12 hours and cant seem to fix it…
First, what are you trying to achieve? Are you Running the thread? Or retrieving the Run? The Endpoint you’re using is not something I’ve seen in documentation. Can you check if you’re using the correct one?
Yup, I’m trying the “Create and Run” method. It worked through cURL console, but I can’t seem to find what I’m missing while using Postman.
My final goal is to integrate my agent to Instagram using ManyChat, witch, also, doesn’t work, replying the same 400 Bad Request error, as Postman
The accented character should be escaped UTF-8 bytes. Additionally, you can check for directional quotes, mismatched containers, remove all the white space such as linefeeds and possible tabs, and run the body through a JSON validator.
It seems I was missing the header “Host”, witch is not under the API Reference, although it worked since I’ve added… Could you guys enlighten me on why?
My customers set up their own websites on my host, like superduper.ai or ratemygpt.biz.
When a request is sent to my server’s IP address, there’s no clue which virtual host it is meant for. I’ll just send back an error for api.superduper.ai.
The Host header is required.
Most libraries handle this header for you because it is almost mandatory on the modern web.
===
What the playground sends for headers to the API for chat completions: