[Integrations](https://spiral.ai/integrations) › [Muse](https://spiral.ai/integrations/muse) › [Gemma 4 31B](https://spiral.ai/integrations/muse/gemma-4-31b)

# How to Use Gemma 4 31B in Muse

Gemma 4 31B suits code fixes, complex questions, and analysis of long documents. Google positions its dense architecture for answer quality, while Gemma 4 26B A4B prioritizes speed.

|  |  |
| --- | --- |
| Model | Gemma 4 31B |
| Available through | OpenRouter |
| Category | LLM |
| Price | Up to $0.00214 per run at the default inputs. $0.26 per 1M input tokens, $0.52 per 1M output tokens. |
| Returns | text, json |
| Runs | In the background |
| Setup | About 2 minutes, with a Spiral API key |

## Prompts to try with Gemma 4 31B in Muse

- Use Gemma 4 31B to compare the two proposals in this conversation. Return a table of differences, supporting passages, and questions that remain unanswered.
- Use Gemma 4 31B to rewrite the supplied customer reply in Spanish. Keep product names unchanged and preserve every factual commitment.
- Use Gemma 4 31B with thinking enabled to check this plan against the constraints I supplied. Return conflicts, assumptions, and a revised plan under 500 words.
- Use Gemma 4 31B to extract dates, organizations, decisions, and unresolved questions from the supplied meeting text. Mark missing information explicitly.
- Use Gemma 4 31B to summarize the research excerpts in this conversation. Separate shared findings, disagreements, and unsupported claims, citing the excerpt labels.

## How to set up Gemma 4 31B in Muse

Pick the way that suits you. Each takes about two minutes.

### Use the Muse connector

1. **Create an API key**: Create one under API keys in the Spiral console.

2. **Send Muse this message**: Muse reads Spiral's skill and asks for an API key.

```text
set up https://spiral.ai/SKILL.md
```

3. **Give Muse the key**: Paste the key when Muse asks for it, never in the chat itself.

### Use the Spiral skill

1. **Send Muse this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run Gemma 4 31B**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "openrouter",
    "model": "google/gemma-4-31b-it",
    "input": {
      "messages": [
        {
          "role": "system"
        }
      ]
    }
  }'
```

Then paste one of the prompts above: Muse finds Gemma 4 31B on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/muse

## Gemma 4 31B tools and prices

- [Google: Gemma 4 31B](https://spiral.ai/tools/openrouter/google/gemma-4-31b-it) (OpenRouter): Up to $0.00214 per run at the default inputs. $0.26 per 1M input tokens, $0.52 per 1M output tokens.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| seed |  | — |  |
| stop |  | — |  |
| min_p | 0 to 1 | — |  |
| tools |  | — |  |
| top_k | 0 to … | — |  |
| top_p | 0 to 1 | — |  |

## What can you do with Gemma 4 31B in Muse?

Compare supplied material, draft multilingual text, and work through complex questions with Gemma 4 31B. Give it the evidence and the desired answer format so you can check the result.

### Diagnose a code defect

Ask Gemma 4 31B to trace a failing path, propose a small correction, and suggest a regression check.

### Compare long documents

Use Gemma 4 31B to compare requirements, identify contradictions, and attach supporting passages to each finding.

### Extract structured records

Ask Gemma 4 31B to turn supplied text into JSON records, using null when information is absent.

### Draft multilingual responses

Use Gemma 4 31B to draft replies in a requested language while preserving names and approved terminology.

### Summarize research

Ask Gemma 4 31B to condense supplied research into findings, disagreements, and unanswered questions.

### Check a plan against constraints

Give Gemma 4 31B a proposed plan and explicit constraints, then request conflicts and a revised sequence.

### Answer questions from reference text

Use Gemma 4 31B to draft answers grounded in supplied reference material, with evidence for each conclusion.

## Overview

- [OpenRouter](https://spiral.ai/providers/openrouter)
- [All Muse guides](https://spiral.ai/integrations/muse)

## Gemma 4 31B in other agents

- [Amp](https://spiral.ai/integrations/amp/gemma-4-31b)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/gemma-4-31b)
- [Claude](https://spiral.ai/integrations/claude-desktop/gemma-4-31b)
- [Claude Code](https://spiral.ai/integrations/claude-code/gemma-4-31b)
- [Cline](https://spiral.ai/integrations/cline/gemma-4-31b)
- [Codex](https://spiral.ai/integrations/codex/gemma-4-31b)
- [Cursor](https://spiral.ai/integrations/cursor/gemma-4-31b)
- [Devin](https://spiral.ai/integrations/devin/gemma-4-31b)
- [dots](https://spiral.ai/integrations/dots/gemma-4-31b)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/gemma-4-31b)
- [Gemini](https://spiral.ai/integrations/gemini/gemma-4-31b)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/gemma-4-31b)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/gemma-4-31b)
- [goose](https://spiral.ai/integrations/goose/gemma-4-31b)
- [Grok](https://spiral.ai/integrations/grok/gemma-4-31b)
- [Grok Build](https://spiral.ai/integrations/grok-build/gemma-4-31b)
- [Hermes](https://spiral.ai/integrations/hermes/gemma-4-31b)
- [Instinct](https://spiral.ai/integrations/instinct/gemma-4-31b)
- [Manus](https://spiral.ai/integrations/manus/gemma-4-31b)
- [Muse Code](https://spiral.ai/integrations/muse-code/gemma-4-31b)
- [n8n](https://spiral.ai/integrations/n8n/gemma-4-31b)
- [Notion](https://spiral.ai/integrations/notion/gemma-4-31b)
- [OpenClaw](https://spiral.ai/integrations/openclaw/gemma-4-31b)
- [opencode](https://spiral.ai/integrations/opencode/gemma-4-31b)
- [Perplexity](https://spiral.ai/integrations/perplexity/gemma-4-31b)
- [Raycast](https://spiral.ai/integrations/raycast/gemma-4-31b)
- [VS Code](https://spiral.ai/integrations/vscode/gemma-4-31b)
- [Windsurf](https://spiral.ai/integrations/windsurf/gemma-4-31b)
- [Zapier](https://spiral.ai/integrations/zapier/gemma-4-31b)

## More Muse guides

- [Gemma 4 26B A4B](https://spiral.ai/integrations/muse/gemma-4-26b-a4b)
- [Granite 4.2 8B](https://spiral.ai/integrations/muse/granite-4-2-8b)
- [Gemma 3 4B](https://spiral.ai/integrations/muse/gemma-3-4b)
- [Grok 4.20](https://spiral.ai/integrations/muse/grok-4-20)
- [Gemma 3 27B IT](https://spiral.ai/integrations/muse/gemma-3-27b-it)
- [Grok 4.20 Multi-Agent](https://spiral.ai/integrations/muse/grok-4-20-multi-agent)

## Questions about Gemma 4 31B in Muse

**Can Muse use Gemma 4 31B?**

Yes. Add Spiral to Muse as an MCP server, and Muse can find and run Gemma 4 31B like any built-in tool.

**How much does Gemma 4 31B cost in Muse?**

Up to $0.00214 per run at the default inputs. $0.26 per 1M input tokens, $0.52 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Muse plan is separate.

**Do I need an OpenRouter account to use Gemma 4 31B in Muse?**

You need no OpenRouter account. Muse uses one Spiral API key for every tool, and Spiral runs Gemma 4 31B on its own OpenRouter account.

**How long does it take to set up Gemma 4 31B in Muse?**

About two minutes: create an API key, then send Muse this message, then give Muse the key.

**Does Muse wait while Gemma 4 31B runs?**

Gemma 4 31B runs in the background. Muse starts the run, checks on it and gives you the text, json when it's ready.

**What is Gemma 4 31B useful for?**

Use it for code fixes, questions that require reasoning, summaries of long documents, and extracting information into JSON. Google positions the dense 31B model for answer quality.

**How much context can Gemma 4 31B handle?**

Google specifies a model context window of up to 256K tokens. That describes context capacity, not the length of a single answer.

**Can Gemma 4 31B work in languages other than English?**

Yes. Google describes Gemma 4 as supporting 140 languages; name the target language and explain which terms, names, or quotations should stay unchanged.

**Does Gemma 4 31B have a thinking mode?**

Yes. Thinking mode produces reasoning before the final answer; try it for code diagnosis, constraint checking, or questions with several dependent steps.

**Which generation settings should I start with?**

Google recommends temperature 1.0, nucleus sampling at 0.95, and a top-k value of 64 across use cases. Use those as a baseline before comparing changes on examples from your task.

