Using Gemma 4 via the Gemini API and Google AI Studio
Melvin Vivas · X post · 2026-04-08 · Open on X
Topics: LLM Fundamentals, AI Agents, Tool Use & MCP · Level: beginner
Summary
Gemma 4 is now available through the official Gemini API and Google AI Studio. You call it with the same google-genai SDK used for Gemini. The quoted announcement names the model IDs and lists example use cases: text generation, system instructions with function calling, and image understanding.
Key points
- Gemma 4 is available in the Gemini API and Google AI Studio.
- Model IDs:
gemma-4-26b-a4b-itandgemma-4-31b-it. - Use the same
google-genaiSDK as for Gemini; just swap the model name. - Text generation uses
generate_content. - Supports system instructions and function calling.
- Supports image understanding (multimodal input).
Resources mentioned
- Gemma 4 · tool · ai.google.dev · free
Google's family of open-weight models in several sizes, built to run on devices and offline, with multimodal and agentic abilities, and open to fine-tuning.
Also in: Gemma 4 Runs Locally On-Device in the Antigravity SDK (Melvin Vivas on X · notes), On-Device AI: Running Gemma 4 E2B Offline on an iPhone with LiteRT (Melvin Vivas on X · notes), Running Gemma 4 Models Offline on an iPhone (Melvin Vivas on X · notes), Fine-tuning Gemma4-E2B on your own tweet style with Unsloth (Melvin Vivas on X · notes) and 25 more - Google AI Studio · tool · aistudio.google.com · free
Google's web tool for prompting Gemini models and vibe-coding full apps, including real-time multiplayer apps, with a built-in coding agent.
Also in: Firebase Studio Shutdown: Move to Google AI Studio or Antigravity (Melvin Vivas on X · notes), Gemini 3.5 Live Translate: Real-Time Speech Translation via the Live API (Melvin Vivas on X · notes), Gemini 3.5 Live Translate: Real-Time Speech Translation via the Gemini Live API (Melvin Vivas on X · notes), Vibe-Coding Real-Time Multiplayer Apps in Google AI Studio (Melvin Vivas on X · notes) and 1 more - Gemini API · docs · ai.google.dev · free
Google's developer API and docs for calling Gemini and Gemma models.
Also in: Gemini 3.5 Live Translate: Real-Time Speech Translation via the Live API (Melvin Vivas on X · notes), Gemma 4 Now Available Through the Gemini API (Dev Use Only) (Melvin Vivas on X · notes) - google-genai SDK · repo · github.com · free
Google Gen AI Python SDK used to call Gemini and Gemma models (generate_content, function calling, images).
Try this
- Get an API key in Google AI Studio and call `gemma-4-31b-it` or `gemma-4-26b-a4b-it` with the google-genai SDK.
- Try text generation with generate_content, a system instruction with function calling, and image understanding.
- Build a small tool-calling assistant on Gemma 4 using system instructions and function calling through the google-genai SDK.
More in LLM Fundamentals
- Run Gemma 4 Offline on an iPhone with the Locally AI App
- OpenRouter Adds Video Generation: One API for Veo, Seedance, Wan and Sora
- Running Gemma 4 E2B Video Understanding Locally in WSL
- Run Gemma 4 on Your Phone with Google AI Edge Gallery
- Gemma 4 E4B: Local Image Understanding at 131K Context in 6GB VRAM
- A Visual Guide to Gemma 4 Architecture (Maarten Grootendorst)