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' );
Thread Starter
Anonymous User 18191698
(@anonymized-18191698)
Thanks for this reply. Just shows that the French are smarter than the Irish haha. Regarding the code above, do I add that to functions.php and what about the existing api key in the backend, is that included in the array?
Here is the rate guide:
https://platform.openai.com/docs/guides/rate-limits
Oh, are you Irish? :p Based on your name, I thought you were a bit closer to where I live 😉
No, the default API is not included; but we could modify the code in a way it is; or you could simply add your own API Key in the array to make it straightforward.
About the rates, I wonder if it’s linked to an account, or an API key however! Of course, you could also create different accounts, but I am not sure they would like that 😜