Title: Gemini API key returns 400 — API key not valid
Hello Google AI team,
I created a new Gemini API key in Google AI Studio. The prompt works in the AI Studio web interface, but direct API requests return 400 Bad Request with API key not valid.
I tested both the REST API and the official Python SDK (google-genai 2.31.0) using Python 3.13 on Windows. The API key is present in the environment variable, but requests to the Gemini API still fail.
Could you please help verify the API key and project configuration?
I have not included the API key for security reasons.
Thank you.