• Resolved athimm

    (@athimm)


    Hello,

    on a WP 6.7.2 setup the following is displayed when adding a Google AI Studio key.

    An error occurred

    Google API Error: We encountered a problem registering your GoogleAI API key. Please check your API Key.

    I know the key works as I have used it with a different WP AI plugin for example.

    All I get from debug.log is

    [04-Apr-2025 05:51:18 UTC] PHP Warning: foreach() argument must be of type array|object, null given in /var/www/html/wp-content/plugins/aibuddy-openai-chatgpt/src/OpenAi/Api.php on line 302

    Is this warning relevant? How can I further debug this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @athimm ,

    Thanks for your report!
    We have fixed the Google API Error issue, also while we are fixing it, we added 2.0 and 2.5 models as well. Could you please update your plugin to latest version and check again?

    Thanks for your understanding!

    Thread Starter athimm

    (@athimm)

    Thank you for the fast turnaround!

    The key now registers, but trying to use it fails with error 500. The UI displays

    An error occurred
    There may be issues with the server or internet connection, or it’s possible that an incorrect API KEY has been specified.

    debug.log traces out with

    [05-Apr-2025 05:03:22 UTC] PHP Warning:  Undefined array key "error" in <path to plugins>/aibuddy-openai-chatgpt/src/OpenAi/Api.php on line 229
    [05-Apr-2025 05:03:53 UTC] PHP Warning: Undefined array key "error" in <path to plugins>/aibuddy-openai-chatgpt/src/OpenAi/Api.php on line 229
    [05-Apr-2025 05:09:36 UTC] PHP Warning: Undefined array key "error" in <path to plugins>/aibuddy-openai-chatgpt/src/OpenAi/Api.php on line 229
    [05-Apr-2025 05:09:36 UTC] PHP Warning: Undefined array key "data" in <path to plugins>/aibuddy-openai-chatgpt/src/AiContentGenerator.php on line 81
    [05-Apr-2025 05:09:36 UTC] PHP Fatal error: Uncaught TypeError: array_column(): Argument #1 ($array) must be of type array, null given in <path to plugins>/aibuddy-openai-chatgpt/src/AiContentGenerator.php:81
    Stack trace:
    #0 <path to plugins>/aibuddy-openai-chatgpt/src/AiContentGenerator.php(81): array_column(NULL, 'url')
    #1 <path to plugins>/aibuddy-openai-chatgpt/src/Rest.php(500): AiBuddy\AiContentGenerator->exec(Object(AiBuddy\OpenAi\ImageQuery))
    #2 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(1292): AiBuddy\Rest->generate_images(Object(WP_REST_Request))
    #3 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/ai-buddy/v1/ai...', Array, NULL)
    #4 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch(Object(WP_REST_Request))
    #5 /var/www/html/wp-includes/rest-api.php(449): WP_REST_Server->serve_request('/ai-buddy/v1/ai...')
    #6 /var/www/html/wp-includes/class-wp-hook.php(324): rest_api_loaded(Object(WP))
    #7 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
    #8 /var/www/html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
    #9 /var/www/html/wp-includes/class-wp.php(418): do_action_ref_array('parse_request', Array)
    #10 /var/www/html/wp-includes/class-wp.php(813): WP->parse_request('')
    #11 /var/www/html/wp-includes/functions.php(1336): WP->main('')
    #12 /var/www/html/wp-blog-header.php(16): wp()
    #13 /var/www/html/index.php(17): require('/var/www/html/w...')
    #14 {main}
    thrown in <path to plugins>/aibuddy-openai-chatgpt/src/AiContentGenerator.php on line 81

    Hi @athimm ,

    Sorry for the trouble! I’ve tried but all the Google AI models works fine now on my side.

    When I check the debug.log I see that it is trying to send image query somehow. But Google AI works only content generator. Could you please share steps to replicate? So I can check quickly.

    If you feel comfortable, feel free to create a ticket from https://aibudwp.com/contact/ so we can handle it quickly.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘“problem registering your GoogleAI API key”’ is closed to new replies.