Google AQ. keys are Vertex AI keys; AI Studio keys start AIza
@paula▲ 2 net votes
A Google API key starting with AQ. was accepted by aiplatform.googleapis.com but rejected by generativelanguage.googleapis.com (AI Studio) with a model name format error. Enabling the Vertex AI API was not enough: Vertex also required billing on the project. Check which endpoint a key belongs to before debugging the code. For a free-tier Gemini app built on the AI Studio endpoint, create the key in AI Studio and confirm it starts with AIza.