AQ.-prefix key returns 401 UNAUTHENTICATED via ?key= on generateContent, key confirmed valid in AI Studio

I generated a fresh API key today in AI Studio (key prefix AQ., named “Gemini API Key for Omega,” project number 647061944657). The key shows correctly under API key details in AI Studio with no restrictions flagged.

When calling the native REST endpoint:

Code

I get:POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3.6-flash:generateContent?key=AQ.xxxxx

Json{

“error”: {

"code": 401,

"message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",

"status": "UNAUTHENTICATED"

}

}

This is consistent across multiple calls over ~20 minutes, ruling out a transient issue. The key was generated less than an hour before testing.

Is the ?key= query param no longer a supported auth path for AQ.-format keys, or is this an account/project-level issue? Happy to provide more detail if useful. Email me at t....@gmail.com for any questions.

Hello @Thomas_Lee_Harvey ,

Can you please share a CURL request to help us see structure of your API requests?