Google Gemma 4 31B inference overview

Price per 1M tokens

$0.30 (input)
$1.25 (output)

Parameters

31B (total)

Context Window

262K

Release Date

Apr 2026

Google Gemma 4 31B inference details

Gemma 4 31B Dense is the strongest Gemma 4 model best for advanced reasoning, agentic workflows, code generation, vision, and longer context and is natively trained on 140+ languages.

Created by: 

Google

License: 

License: apache-2.0

Model card: 

				
					import openai
import weave

# Weave autopatches OpenAI to log LLM calls to W&B
weave.init("<team>/<project>")

client = openai.OpenAI(
    # The custom base URL points to W&B Inference
    base_url='https://api.inference.wandb.ai/v1',

    # Get your API key from https://wandb.ai/authorize
    # Consider setting it in the environment as OPENAI_API_KEY instead for safety
    api_key="<your-apikey>",

    # Optional: Team and project for usage tracking
    project="<team>/<project>",
)

response = client.chat.completions.create(
    model="google/gemma-4-31B-it",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Tell me a joke."}
    ],
)

print(response.choices[0].message.content)
				
			

Google Gemma 4 31B resources