
How to Get Your Gemini API Key
May 30, 2025About 2 min
How to Get Your Gemini API Key 관련
How to Build an AI-Powered Cooking Assistant with Flutter and Gemini
After soaking in everything shared at GoogleIO, I can’t lie - I feel supercharged! From What’s New in Flutter to Building Agentic Apps with Flutter and Firebase AI Logic, and the deep dive into How Flutter Makes the Most of Your Platforms, it felt li...
How to Build an AI-Powered Cooking Assistant with Flutter and Gemini
After soaking in everything shared at GoogleIO, I can’t lie - I feel supercharged! From What’s New in Flutter to Building Agentic Apps with Flutter and Firebase AI Logic, and the deep dive into How Flutter Makes the Most of Your Platforms, it felt li...
To use the Gemini model, you'll need an API key. You can obtain one by following these steps:
- Go to Google AI Studio.
- Sign in with your Google account.
- Click on "Get API key" or "Create API key in new project."
- Copy the generated API key.

Important Security Note:
In the provided HomeScreen code, the API key is directly embedded as String apiKey = "";. This is not a secure practice for production applications. Hardcoding API keys directly into your client-side code (like a Flutter app) exposes them to reverse engineering and potential misuse.
To secure your API keys in a Flutter application, I highly recommend referring to my article: How to Secure Mobile APIs in Flutter. This article covers various best practices, including:
- Using environment variables or build configurations.
- Storing keys in secure local storage (though still client-side).
- Proxying API requests through a backend server to truly hide your API key.
- Using Firebase Extensions or Cloud Functions for server-side logic that interacts with AI models, without exposing the key to the client.
For this tutorial, we'll keep it simple, but always prioritize API security in your real-world projects!