It took me a while to understand why my code was not working, but I was not getting any error back…
Basically, my “threadId” was an empty string and I was not getting back any response, at all, and any error from the API.
Is it the supposedly correct behavior? If I specify “DELETE” in the curl, even without a threadId, shouldn’t I get back an error?
I am using PHP and as said, $threadId was unfortunately empty:
curl_setopt_array($curl, [
CURLOPT_URL => “https://api.openai.com/v1/threads/” . $threadId,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “DELETE”,
CURLOPT_HTTPHEADER => [
“Content-Type: application/json”,
“Authorization: Bearer $apiKey”,
“OpenAI-Beta: assistants=v2”
],
]);