Gemma 4 31B IT API Pricing
As of October 10, 2026, Gemma 4 31B IT is free to use on Google AI Studio. Across 11 providers on LiteLLM, the input price ranges from $0 to $0.40. It has a 262,144-token context window and returns up to 32,768 tokens per response.
- Price
- Free
- Context window
- 262,144 tokens
- Max output
- 32,768 tokens
- Providers
- 11
- Added to LiteLLM
- June 2026
Gemma 4 31B IT pricing by provider
12 listings across 11 providers. Token prices are in US dollars per 1M tokens. The highlighted row is the price quoted above.
| Provider | Model name in LiteLLM | Input | Output | Cache read | Context |
|---|---|---|---|---|---|
| Google AI Studio | gemini/gemma-4-31b-it | $0 | $0 | – | 256K |
| AIHubMix | aihubmix/gemma-4-31b-it | $0.14 | $0.40 | – | 256K |
| DeepInfra | deepinfra/google/gemma-4-31B-it | $0.13 | $0.38 | – | 256K |
| FriendliAI | friendliai/google/gemma-4-31B-it | $0.14 | $0.40 | – | 256K |
| LibertAI | libertai/gemma-4-31b-it | $0.15 | $0.40 | – | 256K |
| Novita AI | novita/google/gemma-4-31b-it | $0.14 | $0.40 | – | 256K |
| Sail | sail/google/gemma-4-31B-it | $0.40 | $0.60 | $0.20 | 256K |
| SambaNova | sambanova/gemma-4-31B-it | $0.38 | $1.15 | – | 128K |
| Tensormesh | tensormesh/google/gemma-4-31B-it | $0.14 | $0.56 | $0 | 32K |
| Together AI | together_ai/google/gemma-4-31B-it | $0.39 | $0.97 | – | 256K |
| Weights & Biases | wandb/google/gemma-4-31B-it | $0.10 | $0.34 | – | 262K |
| Sailnvfp4 | sail/nvidia/Gemma-4-31B-IT-NVFP4 | $0.14 | $0.40 | $0.07 | 256K |
What Gemma 4 31B IT costs in practice
1,000 requests with 2,000 input and 500 output tokens each
| Google AI Studio | $0 |
| Weights & Biases | $0.37 |
| DeepInfra | $0.45 |
| AIHubMix | $0.48 |
100 long-document requests with 100,000 input and 2,000 output tokens each
| Google AI Studio | $0 |
| Weights & Biases | $1.068 |
| DeepInfra | $1.376 |
| AIHubMix | $1.48 |
Gemma 4 31B IT features
- Function calling
- Parallel tool calls
- Structured output
- Image input
- Reasoning
- Prompt caching
Use Gemma 4 31B IT with LiteLLM
Call Gemma 4 31B IT through the LiteLLM Python SDK, or put it behind the LiteLLM proxy and send OpenAI-format requests to /v1/chat/completions. LiteLLM tracks the cost of every request at these prices.
from litellm import completion
response = completion(
model="gemini/gemma-4-31b-it",
messages=[{"role": "user", "content": "Hello!"}],
)model_list:
- model_name: gemma-4-31b-it
litellm_params:
model: gemini/gemma-4-31b-it
api_key: os.environ/GEMINI_API_KEYcurl http://0.0.0.0:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-d '{
"model": "gemma-4-31b-it",
"messages": [{"role": "user", "content": "Hello!"}]
}'Gemma 4 31B IT FAQ
How much does Gemma 4 31B IT cost?
Gemma 4 31B IT is free to use on Google AI Studio. Across 11 providers on LiteLLM, the input price ranges from $0 to $0.40.
What is the context window of Gemma 4 31B IT?
Gemma 4 31B IT has a 262,144-token context window and returns up to 32,768 tokens per response.
Which providers offer Gemma 4 31B IT?
Gemma 4 31B IT is available from 11 providers through LiteLLM: Google AI Studio, AIHubMix, DeepInfra, FriendliAI, LibertAI, Novita AI, Sail, SambaNova, Tensormesh, Together AI and Weights & Biases. The lowest price is on Google AI Studio.
How do I call Gemma 4 31B IT with an OpenAI-compatible API?
Use the LiteLLM Python SDK with model="gemini/gemma-4-31b-it", or add the model to the LiteLLM proxy's config.yaml and send requests to /v1/chat/completions from any OpenAI client. LiteLLM tracks the cost of every request at the prices on this page.
What features does Gemma 4 31B IT support?
Gemma 4 31B IT supports function calling, parallel tool calls, structured output, image input, reasoning and prompt caching.
When did LiteLLM add Gemma 4 31B IT?
Gemma 4 31B IT was added to LiteLLM's model price file in June 2026.
Sources
Prices come from LiteLLM's open-source model_prices_and_context_window.json, which LiteLLM uses to calculate the cost of every request. Provider pricing pages:
- ai.google.dev/gemini-api/docs/pricing
- aihubmix.com/api/v1/models
- deepinfra.com/pricing
- api.friendli.ai/serverless/v1/models
LiteLLM docs: Google AI Studio, AIHubMix, DeepInfra, FriendliAI, LibertAI, Sail.
Provider pages: Google AI Studio, AIHubMix, DeepInfra, FriendliAI, LibertAI, Novita AI, Sail, SambaNova, Tensormesh, Together AI, Weights & Biases.
