Gemma 3 (4B) API

Gemma 3 4B is a lightweight open language model from Google, suitable for on-device deployment and efficient inference.

Modalities
Text, ImageText
In / Out price
$0.0529/$0.1058per 1M
Context window
131K tokens
Released
Sep 9, 2025

Gemma 3 (4B) overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by Gemma 3 (4B) through AI/ML API

Gemma 3 (4B) by Google

Gemma 3 (4B) is Google's latest open AI model, designed for seamless text and visual content processing across over 140 languages.

Gemma 3 (4B) specs

Model ID
google/gemma-3-4b-it
Developer
Google
Context window
131,000 tokens
Max output
32,768 tokens
Input
Text, Image
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

Gemma 3 (4B) Description

Gemma 3 (4B) represents an advanced multimodal AI system that expertly combines capabilities in both text and visual comprehension. Equipped with a substantial 131,000-token context window, it is designed to handle extensive information processing and incorporates function calling to efficiently execute sophisticated tasks. Built for flexible deployment, Gemma 3 delivers a strong mix of high performance and resource efficiency, operating effectively across various platforms ranging from smartphones to high-end workstations.

Technical Specifications

  • Modality Support: Text and image processing
  • Language Coverage: Supports over 140 languages

Key Features

  • Multimodal Understanding: Combines visual and textual inputs to generate coherent, context-aware responses.
  • Extended Context Handling: Maintains coherence across very long documents and interaction sessions.
  • Multilingual Processing: Enables seamless communication and translation across diverse languages.‍
  • Deployment Optimization: Efficient operation on hardware-limited environments including single-GPU systems


Ethical Guidelines

Google prioritizes ethical AI development, emphasizing transparency about Gemma 3’s capabilities and limitations. Responsible usage is strongly encouraged to mitigate risks of misuse or harmful applications related to generated outputs.

Licensing

Gemma 3 is distributed under the Gemma Terms of Use with a commercially-friendly license model. This license supports both research and commercial applications while ensuring adherence to established ethical standards.

Use cases

  • AI assistants and chatbots with multimodal inputs
  • Multilingual content creation and summarization
  • Visual content analysis and captioning
  • Interactive educational and tutoring applications
  • Research and development with extended context capability
  • Intelligent automation and agentic workflows

Capabilities

  • Streaming

Gemma 3 (4B) benchmarks by Artificial Analysis

See how Gemma 3 (4B) scores on independent evaluations. Data retrieved Nov 3, 2026.

Benchmark results

Compare 13 models available on AI/ML API across 5 independent benchmarks.

Humanity's Last Exam

Expert-written questions across academic subjects.

Gemma 3 (4B) API pricing

Gemma 3 (4B) pricing in US dollars
UsagePriceUnit
Input$0.05291M tokens
Output$0.10581M tokens
Cached input$0.04231M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

Gemma 3 (4B) vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
Gemma 3 (4B)$0.0529$0.1058
Gemini 3.5 Flash Lite$0.3$2.5
Gemini 3.8 Flash$0.75$3.75
Gemini 3.7 Flash$0.75$3.75
Gemini 4 Argon$2$10

How to use the Gemma 3 (4B) API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "google/gemma-3-4b-it",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

Gemma 3 (4B) FAQ

What is the context window of Gemma 3 (4B)?

Gemma 3 (4B) has a 131,000 tokens context window and can return up to 32,768 tokens.

What inputs and outputs does Gemma 3 (4B) support?

Gemma 3 (4B) takes image, text as input and returns text.

What is the model ID for Gemma 3 (4B)?

Use google/gemma-3-4b-it as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

When was Gemma 3 (4B) released?

Gemma 3 (4B) became available on September 9, 2025.

How much does Gemma 3 (4B) cost?

Gemma 3 (4B) costs $0.0529 input and $0.1058 output per 1M tokens on AI/ML API, billed as you go with no subscription.

Does Gemma 3 (4B) support streaming?

Yes, Gemma 3 (4B) can stream responses as they are generated.

Can Gemma 3 (4B) read images?

Yes, Gemma 3 (4B) accepts image input alongside text.

Who created Gemma 3 (4B)?

Gemma 3 (4B) was built by Google.

Can Gemma 3 4B be deployed on local or on-device hardware?

Yes, it is designed for on-device deployment and efficient inference.

Start building with Gemma 3 (4B)

Gemma 3 (4B) API

google/gemma-3-4b-it

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "google/gemma-3-4b-it",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'