Get a Gemini API Key
Step-by-step guide to create a Gemini API key in Google AI Studio.
Use this guide to generate a Gemini API key from Google AI Studio and add it to the app.
Video Tutorial
Step-by-Step Instructions
- Open Google AI Studio: https://aistudio.google.com
- Sign in with your Google account.
- In AI Studio, open the API key section.
- Click Create API key.
- Copy the generated key and store it securely.
- Open this app and go to the user menu in the sidebar.
- Click Backend API key and paste your Gemini API key.
- Save and start using chat features.
Important Notes
- Never share your API key publicly.
- Do not commit API keys into source code or git.
- If you think the key is exposed, revoke it and create a new one.
Troubleshooting
Invalid key error
- Verify there are no extra spaces when pasting.
- Regenerate the key in AI Studio and try again.
Requests still failing
- Check internet connectivity.
- Ensure your backend endpoint accepts the key through
x-api-key. - Confirm the selected Gemini model is available for your key/project.