We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.
Google: Gemma 3 4B
google/gemma-3-4b-itTry Google: Gemma 3 4B now
Runs on your balance at the prices above. New accounts start with free usage.
One API. Every model.
Session cost $0.00
Settings
Advanced parameters
Google: Gemma 3 4B at a glance
- Input price is 91% lower than the median of 434 Text models.
- Context window of 131,072 tokens, enough for long documents and multi-turn conversations.
- Supports structured JSON output with a schema.
- Accepts images as input (vision).
- A typical request (1,000 input / 500 output tokens) costs about $0.000228.
About Google: Gemma 3 4B
Google: Gemma 3 4B is a text generation model from Google, released on 13 March 2025. It belongs to the Gemma 3 family, which Google describes as introducing multimodality, meaning these models accept vision and language input rather than text alone. The 4B in the name refers to the model's size class within that family, and the it suffix marks the instruction-tuned variant, so it is built to follow prompts and hold conversations rather than only continue raw text.
The model accepts text and image input and produces text output. Its context window is 131072 tokens, and the maximum output length is 16384 tokens. Google states that it handles context windows up to 128k tokens, understands over 140 languages, and offers improved math, reasoning, and chat capabilities compared with earlier Gemma generations. The knowledge cutoff is 31 August 2024, so anything after that date is outside what the model learned during training. Because input can include images, prompts can combine screenshots, photos, diagrams or scanned pages with written instructions.
Those capabilities point to a fairly broad set of practical uses. The long context window suits work over large documents, such as summarising long reports, answering questions against a full codebase or contract, or keeping a lengthy conversation coherent without trimming history. Multimodal input makes it useful for tasks like describing or extracting information from images, reading charts and diagrams, or handling document images alongside text questions. Multilingual support across more than 140 languages fits translation, localisation drafts and customer-facing chat in many markets. The instruction-tuned chat behaviour and improved reasoning and math make it a reasonable fit for assistants, structured extraction and step by step problem solving where the task does not demand the largest available model.
You call the model through api14's OpenAI-compatible API using the model id "google/gemma-3-4b-it". Because the interface follows the OpenAI chat completions shape, you send a request to the chat completions endpoint with that id in the model field and your messages in the messages array, including image content where relevant. The model supports these request parameters: frequency_penalty, logit_bias, max_tokens, min_p, presence_penalty, repetition_penalty, response_format, seed, stop, structured_outputs, temperature, top_k and top_p. Structured outputs and response_format are useful when you need JSON or another defined shape back, and seed helps when you want more repeatable sampling.
One limit worth noting is the knowledge cutoff of 31 August 2024, so questions about later events will not be answered from training data alone. The 4B size also means it sits below larger Gemma 3 variants, so if a task needs the strongest reasoning or the widest general knowledge, a bigger model may fit better. For long-context, multilingual and image-aware work at a smaller scale, this model is a sensible starting point.
How to call the Google: Gemma 3 4B API
- Create an API key in your dashboard.
- Install the official openai SDK for your language.
- Set baseURL to https://api14.com/api/v1 and model to "google/gemma-3-4b-it".
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api14.com/api/v1",
apiKey: process.env.API14_API_KEY,
});
const result = await client.chat.completions.create({
"model": "google/gemma-3-4b-it",
"messages": [
{
"role": "user",
"content": "Explain vector databases in two sentences."
}
]
});
console.log(result.choices[0].message.content);
Supported parameters
frequency_penaltylogit_biaslogprobsmax_tokensmin_ppresence_penaltyrepetition_penaltyresponse_formatseedstopstructured_outputstemperaturetop_ktop_logprobstop_pSpecifications
- Context length
- 131,072
- Max output
- 117,964
- Input
- text, image
- Output
- text
- Knowledge cutoff
- 2024-08-31
Requests on api14 · last 7 days
Google: Gemma 3 4B: frequently asked questions
- How much does the Google: Gemma 3 4B API cost?
- Google: Gemma 3 4B costs Input $0.14 / 1M tokens. It is charged from your USD balance only for successful requests; failed requests are free.
- What is the context window of Google: Gemma 3 4B?
- Google: Gemma 3 4B reads up to 131,072 tokens per request: prompt, history and documents together. It writes up to 117,964 output tokens per response.
- What can Google: Gemma 3 4B do?
- Google: Gemma 3 4B accepts text, image and returns text. It supports structured JSON output.
- How do I call Google: Gemma 3 4B from my code?
- Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "google/gemma-3-4b-it". No other code changes. Copy a ready example from the code panel on this page.
- What are alternatives to Google: Gemma 3 4B?
- Comparable Text models at a similar price: Sao10K: Llama 3 8B Lunaris, inclusionAI: Ling 3.0 Flash, OpenAI: gpt-oss-20b. Each runs through the same API key, so switching is one string.
Google: Gemma 3 4B community
New topicThis community has no topics yet. Open the first one about Google: Gemma 3 4B.