AQ Authorization Key Returns Generic HTML 400 for GET /v1beta/models on Windows 11

Hello Google AI Developers team,

I am reporting a reproducible Gemini API request failure involving a newly created AQ-prefixed authorization API key.

Environment

  • Operating system: Windows 11

  • Key type: AQ-prefixed authorization key created through Google AI Studio

  • Key status: The console shows that the key is bound to a service account

  • Project: Default Gemini Project

  • Python HTTP client: requests

Tests performed

  1. GET request to https://generativelanguage.googleapis.com/v1beta/models, using the x-goog-api-key header.

  2. POST request to https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent, using the same authentication header and a minimal text-generation request.

Observed result

Both tests returned:

  • HTTP status: 400 Bad Request

  • Content-Type: text/html; charset=UTF-8

  • Response body: <html><title>Error 400 (Bad Request)!!1</title></html>

The response does not contain the usual structured JSON error message, so I cannot identify the cause from the returned response.

A separate PowerShell request also failed with a connection-closed error.

I have checked the project selection in Google Cloud Console and tested the requests using Python. I have not established the underlying cause.

Could you please advise on the following?

  1. How can I verify that this authorization key is correctly associated with the Gemini API rather than another Google API?

  2. What could cause a generic HTML 400 response on the model-list endpoint?

  3. Is there a recommended diagnostic procedure for this failure, or an account/project restriction that I should check?

I can provide further sanitized diagnostic output if required.

Thank you.

Hello @Zm_Semox ,

Could you please create a new API key in a new project in Google AI Studio and test it with the below request?

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent" \
  -H "x-goog-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{"contents": [{"parts": [{"text": "Say hello"}]}]}'


If you still get the 401 error, please share via Direct Message the complete error response and your project ID.