You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are the code samples from the 5th post in the Gemini API series. More information about the scripts will be found there.
❗ API key required
An API key is required to use the Gemini API. Follow the instructions below. The app will not run without being added to the GEMINI_API_KEY environment variable or saved to a local file, .env (Node.js) or settings.py (Python).
(optional) If using uv: uv pip install -Ur requirements.txt
Create API key and either save to settings.py file as GEMINI_API_KEY = 'YOUR_API_KEY' or to GEMINI_API_KEY environment variable.
Run python gem20-image.py (or python3)
📝 Gemini API also accessible from GCP Vertex AI
While these sample scripts access the Gemini API from Google AI, a great place for beginners and those experimenting with it, the API is also accessible from GCP's Vertex AI platform for those ready to use Gemini in production workloads.