# How To Create API Key for Google Gemini

API Key Creation Steps

1. **Go to Google AI Studio**: Navigate to [aistudio.google.com](http://aistudio.google.com) and sign in with your Google account.
    
2. **Accept Terms**: If it's your first time, you'll be prompted to review and accept the Google AI and Gemini API terms of service.
    
3. **Find the API Key Section**: Look for the "Get API key" button or link, often located in the navigation menu or on the main dashboard.
    
4. **Create the Key**: Click "Create API key". You will typically have an option to create the key in a new project (recommended for quick starts and beginners) or an existing Google Cloud project.
    
5. **Copy and Secure the Key**:
    
    * Once generated, the API key string will be displayed. Copy this key immediately and store it in a secure location.
        
    * For security, it is best practice to use the key as an environment variable in your code rather than hardcoding it directly. You can also manage and view your existing keys, check usage, and set restrictions (like limiting the key to certain APIs) within the Google AI Studio interface.
        
6. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1764694186925/a78c8387-6ec1-40b9-ad20-c42f1e213862.png align="center")
