We will learn today how we can get a free Google Gemini API for AI, but with limitations.
1. Go to this URL: aistudio.google.com
2. Log in with your Google account
3. Click on “Get API Key” → Create API key
Now it will ask to create a new project, let’s do that.
We can try the key with this code:
curl https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-lite:generateContent?key=TU_API_KEY \ -H 'Content-Type: application/json' \ -X POST \ -d '{ "contents": [{ "parts": [{"text": "Hello in Spanish"}] }] }'
In TU_API_KEY, you add the key obtained.
