Can you share link to API doc for the endpoint you are trying to reach? Pretty sure you don’t have the correct uRL. Also, there’s an endpoint to create threads and run it in a single call…

https://platform.openai.com/docs/api-reference/runs/createThreadAndRun