Issue with using gpt-40-mini model

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

The usage page isn’t quite real-time, it’s possible you’re just not yet seeing the amount of gpt-4o-mini usage you’re expecting.

Hi, thanks for the reply. I would like to mention that i am checking it in dashboard after 3 days of usage. When I use the tool defining gpt 3.5 turbo and check the usage it is reflected after 2-3 minutes. And Even, when i check it after defining got-4o-mini and using the tool. Usage are still being updated for gpt 3.5 turbo.

maybe you are using the playground with 3.5 turbo?