[wp-trac] [WordPress Trac] #65168: AI Client: Unable to reliably select model for providers (model preference ignored / inconsistent API)

WordPress Trac noreply at wordpress.org
Wed May 6 19:27:18 UTC 2026


#65168: AI Client: Unable to reliably select model for providers (model preference
ignored / inconsistent API)
--------------------------+---------------------
 Reporter:  jabir20       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  7.0
Component:  AI            |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+---------------------

Comment (by jabir20):

 Thanks for the clarification.

 I retested on WordPress 7.0-RC2 and realized my earlier report mixed two
 different things.

 First, I incorrectly tried `->model()`. I now understand the correct API
 is `->using_model()`.

 I tested with:

 ``php
 $model =
 \WordPress\AiClient\AiClient::defaultRegistry()->getProviderModel(
     'google',
     'gemini-2.5-flash'
 );

 $result = wp_ai_client_prompt( 'Say hello' )
     ->using_model( $model )
     ->generate_text();
 ``

 This does appear to explicitly select the requested model in RC2.

 The new error I receive is:

 ``text
 Forbidden (403) - Your project has been denied access. Please contact
 support.
 ``

 So I believe the explicit model selection issue is not a Core bug. This
 now looks more like a Google/Gemini API project access or provider
 configuration issue on my side.

 I will continue testing `using_model_preference()` separately, but for now
 I think the `->model()` part of my report can be ignored as my
 misunderstanding.

 Thanks for helping point me in the right direction.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/65168#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list