Gemma 3n 4B

API ID: google/gemma-3n-e4b-it

Input Price
$0.06
/1M tokens
Output Price
$0.12
/1M tokens

About Gemma 3n 4B

Gemma 3n E4B-it is optimized for efficient execution on mobile and low-resource devices, such as phones, laptops, and tablets. It supports multimodal inputs—including text, visual data, and audio—enabling diverse tasks such as text generation, speech recognition, translation, and image analysis. Leveraging innovations like Per-Layer Embedding (PLE) caching and the MatFormer architecture, Gemma 3n dynamically manages memory usage and computational load by selectively activating model parameters, significantly reducing runtime resource requirements. This model supports a wide linguistic range (trained in over 140 languages) and features a flexible 32K token context window. Gemma 3n can selectively load parameters, optimizing memory and computational efficiency based on the task or device capabilities, making it well-suited for privacy-focused, offline-capable applications and on-device AI solutions. [Read more in the blog post](https://developers.googleblog.com/en/introducing-gemma-3n/)

💰
Price Ranking
#633 lowest price among 1240 Chat models

Model Specifications

Context Length
33k
Max Output
—
Release Date
2025-05-20
Capabilities
chat
Input Modalities
text
Output Modalities
text

Best For

  • Conversations, content writing, general assistance

Consider Alternatives For

  • Image understanding (needs vision capability)

💰 Real-World Cost Examples

Estimated monthly costs for common use cases

Personal AI Assistant
$0.06
/month
50 conversations/day, ~500 tokens each
Customer Service Bot
$1.98
/month
1000 tickets/day, ~800 tokens each

Google Model Lineup

Compare all models from Google to find the best fit

Model Input Output Context Capabilities
Gemma 3n 4B Current Free Free 33k chat
Gemini 2.5 Flash Image Preview (Nano Banana) Free Free 33k chat vision image_gen
Gemma 3n 2B (free) Free Free 8k chat tool_use
Gemma 1 2B Free Free 8k chat
Gemma 1 2B Free Free 8k chat
Gemma 3 1B Free Free 32k chat vision

Similar Models from Other Providers

Cross-brand alternatives with similar capabilities

Mistral Devstral Small 2505
Input: $0.06
Output: $0.12
Context: 131k
Poolside Laguna XS 2.1
Input: $0.06
Output: $0.12
Context: 262k
Amazon Nova Micro 1.0
Input: $0.04
Output: $0.14
Context: 128k
Zhipu Ai GLM 4.1V 9B Thinking
Input: $0.04
Output: $0.14
Context: 66k

🚀 Quick Start

Get started with Gemma 3n 4B API

Google AI Python SDK
import google.generativeai as genai

genai.configure(api_key="YOUR_API_KEY")
model = genai.GenerativeModel("gemma-3n-e4b-it")

response = model.generate_content("Hello!")
print(response.text)