Skip to content

How to Get a Gemma 4 API Key for Free

Updated 27 October 2026.

In short: Google's Gemma 4 is free on its own Gemini API: 14,400 requests a day, with no credit card and no paid tier. Gemma 4 is also free on OpenRouter, Ollama Cloud, Cloudflare Workers AI and NVIDIA's API catalog.

Google's own API: free, with no paid tier

Google's Gemini API pricing page lists Gemma 4 31B and Gemma 4 26B A4B with input and output free of charge, and no paid tier. The free limits are 30 requests a minute, 16,000 tokens a minute and 14,400 requests a day per model. A key comes from Google AI Studio: how to get a Gemini API key for free shows each step.

Where Gemma models are free

WhereGemma modelFree allowanceWhat it needs
Google Gemini APIgemma-4-31b-it, gemma-4-26b-a4b-it14,400 requests a day, 30 a minuteA free Google account; no card
OpenRoutergoogle/gemma-4-31b-it:free, google/gemma-4-26b-a4b-it:free50 requests a dayA free account
Ollama Cloudgemma4:31bA starter amount each month, sharedA free account
Cloudflare Workers AI@cf/google/gemma-4-26b-a4b-itInside the 10,000 free Neurons a dayA free Cloudflare account
NVIDIA (build.nvidia.com)google/gemma-4-31b-itUp to 40 requests a minute, no daily limit statedPhone verification, not offered in every country

Gemma 4 31B answered on a free Ollama key on 26 October 2026. The full list of free AI APIs, with each limit and source, is on how to get AI API keys for free.

Use a free Gemma model in an app made for OpenAI

In the app, enter the service's key, its base URL and its Gemma model name:

ServiceBase URLModel name
Gemini APIhttps://generativelanguage.googleapis.com/v1beta/openai/gemma-4-31b-it
OpenRouterhttps://openrouter.ai/api/v1google/gemma-4-31b-it:free
Ollama Cloudhttps://ollama.com/v1gemma4:31b
Cloudflare Workers AIhttps://api.cloudflare.com/client/v4/accounts/YOUR_ACCOUNT_ID/ai/v1@cf/google/gemma-4-26b-a4b-it
NVIDIAhttps://integrate.api.nvidia.com/v1google/gemma-4-31b-it

To put several free keys behind one address on your own computer, the open-source OmniRoute gateway switches to the next key when one runs out.

Words to know

  • API key: the password an app uses to call a model. See what is an API key.
  • Gemma 4: Google's open-weight model family; 31B is the larger model, 26B A4B a mixture-of-experts model with 4B active parameters.
  • Base URL: the address an app sends its requests to.
  • Token: a piece of a word; the unit models read and write. See tokens and context windows.

Frequently asked questions

Is the Gemma 4 API free?+

Yes. On Google's Gemini API, Gemma 4 31B and 26B A4B are free of charge with no paid tier: 14,400 requests a day and 30 a minute per model, with no credit card.

How do I get a Gemma 4 API key?+

Create a free key in Google AI Studio; the same key works for Gemini and Gemma models. Use the model name gemma-4-31b-it.

Where else is Gemma 4 free?+

On OpenRouter (google/gemma-4-31b-it:free, 50 requests a day), Ollama Cloud (gemma4:31b), Cloudflare Workers AI (@cf/google/gemma-4-26b-a4b-it) and NVIDIA build.nvidia.com (google/gemma-4-31b-it).

What is the Gemma 4 base URL?+

On the Gemini API, https://generativelanguage.googleapis.com/v1beta/openai/ with a Google AI Studio key and the model name gemma-4-31b-it.

More free API key tutorials

By model: DeepSeek · OpenAI (GPT) · Claude · Grok · Perplexity · Mistral · Kimi · Qwen · GLM · MiniMax · Llama · Nemotron · gpt-oss

Want to use these APIs in a desktop app? OpenCode is a free, open-source AI coding app for Windows, Mac and Linux. How to add free API keys to OpenCode and pick a model.