Add multiple open AI keys

[ad_1]

Hi,

As you may know, there are limits on the number of concurrent requests and with the success of chatgpt, there are probably more strains on their servers. 

Actually, I don’t know 🙂 Are you sure they have limits on the OpenAI API? Of course, they do have on ChatGPT, but that’s different.

If you could add a feature which would make it possible to add more api keys, and have the system randomly choose an api key on each request, this would benefit many users and also give u a competitive advantage

You actually do this already 🙂

$api_keys = array(
    '1234567890',
    '0987654321',
    'qwertyuiop',
    'asdfghjkl',
    'zxcvbnm',
);

function assign_random_api_key( $query ) {
    global $api_keys;
    $index = array_rand( $api_keys );
    $query->setApiKey( $api_keys[$index] );
    return $query;
}

add_filter( 'mwai_ai_query', 'assign_random_api_key' );

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer