Hi Devs,
I need help with finding an issue related to use of gpt-4o-mini model via API.
Actually I was trying to create an php based web app, let say an ‘ai caption generator’ using chat completions curl method for php.
Here is the part of api.php file where I define gpt-4o-mini model:
api_key = _SERVER[‘OPENAI_API_KEY’];
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $api_key
];
$body = json_encode([
'model' => 'gpt-4o-mini',
'messages' => [['role' => 'user', 'content' => $prompt]],
'temperature' => $temperature
]);
$ch = curl_init('https://api.openai.com/v1/chat/completions');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
$response = curl_exec($ch);
curl_close($ch);
The issue I am facing is that even I have defined the gpt-4o-mini model here when I check the model uses in API dashboard, I see that chatgpt 3.5 Turbo is being used somehow instead of gpt-4o-mini??
Can anyone help me with this, why this is happening, what wrong I am doing??
Thanks in advance!!
Harvansh