Annoying "Too Many Request" Error

Hello there,

I was newly signed up openai platform and i topup my account $10 and I’m not free user.

I also run simple PHP code which is

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$api_key = '..'; 


function sendChatGPTRequest($prompt, $max_tokens = 50) {
    global $api_key;
    $url = 'https://api.openai.com/v1/engines/text-davinci-003/completions';

    $data = array(
        'prompt' => $prompt,
        'max_tokens' => $max_tokens
    );

    $data_string = json_encode($data);

    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
            'Content-Type: application/json',
            'Authorization: Bearer ' . $api_key,
            'Content-Length: ' . strlen($data_string))
    );

    $result = curl_exec($ch);
    if ($result === false) {
        echo 'Curl error: ' . curl_error($ch);
    } else {
        $response = json_decode($result, true);
        if ($response === null || !isset($response['choices'])) {
            echo 'Invalid or unexpected JSON format received.<br>';
            echo 'Response: <pre>' . print_r($response, true) . '</pre>';
        } else {
            return $response['choices'][0]['text'] ?? 'No response';
        }
    }

    curl_close($ch);
}


$generated_text = sendChatGPTRequest("Q: What is the meaning of life?");
echo $generated_text;

?>

And please always said: “You exceeded your current quota, please check your plan and billing details”.

The problem is

1- I have still $10 and enough balance
2- I only push 1 REQUEST
3- I already set up billing details and info’s
4- Already contacted a support and they cannot help me!
//Edited: 5- I already created a NEW lot of API KEYS AND STILL DOESNT WORK

Can somebody help me?

Check the above site, and you will find your answer is there.

Hello there. Thanks for your reply. But my credit successfully credited.

Aha, but it didn’t get successfully credited if you can’t spend it!

The same symptom as hundreds of others that just added to their empty account.

It might be. Thanks for your reply :slight_smile: