Skip to content

Gemma 4 31B vs Grok 4.7

Gemma 4 31B (Google) and Grok 4.7 (SpaceXSI) are listed at different prices. Gemma 4 31B costs less: $0.30 per 1M input tokens and $0.60 per 1M output tokens, against $3.00 and $9.00 for Grok 4.7. Grok 4.7 has the larger context window, 500,000 tokens against 262,144 for Gemma 4 31B. Grok 4.7 charges $6.00 and $18.00 per 1M once a prompt passes 200,000 tokens; Gemma 4 31B keeps one price across its window. Gemma 4 31B accepts text, images and video and produces text; Grok 4.7 accepts text, images and files and produces text.

Google: Gemma 4 31B accepts text, images, and video, while SpaceXSI: Grok 4.7 accepts text, images, and files. Both produce text and support tools, structured outputs, response formats, and reasoning; Grok 4.7 has a 500,000-token context window, compared with Gemma 4 31B’s 262,144 tokens.

Compared from catalog data checked

Gemma 4 31B

$0.30 in
$0.60 out
Under 0.1¢ a message
262K context

Grok 4.7

$3.00 in
$9.00 out
About 1.1¢ a message
500K context

Side by side

0.00 the better figure in a row
Gemma 4 31B and Grok 4.7 specifications side by side
SpecificationGemma 4 31BGrok 4.7
Maker Google SpaceXSI
Added to catalog 2 Apr 2026 21 Sep 2026
Input, per 1M tokens $0.30 $3.00
Output, per 1M tokens $0.60 $9.00
Input above 200K tokensPer 1M; long prompts $0.30 $6.00
Output above 200K tokens $0.60 $18.00
Cached input read, per 1M n/a $0.75
Context windowTokens 262,144 500,000
Max outputTokens 16,384 450,000
Accepts image, text, video file, image, text
Produces text text
Tool calling Yes Yes
Structured outputs Yes Yes
Reasoning effort control No Yes

Prices on Upend, in US dollars. Each model's page has its variants, price history and sample outputs.

What the same task costs

The price of one request on Upend, from the token counts shown. The same four tasks are priced on every model page.

Check the provider's pageToken counts are estimates, and the two models count tokens differently.
Cost of the same task on Gemma 4 31B and Grok 4.7
TaskGemma 4 31BGrok 4.7
Answer a short question500 in / 300 out $0.0003 $0.0042
Summarise a 50-page PDF25,000 in / 800 out $0.0080 $0.082
Review a 2,000-line source file30,000 in / 2,000 out $0.010 $0.108
Read a 300-page contract set150,000 in / 1,500 out $0.046 $0.464

Which to choose

Choose Gemma 4 31B if

  • Input tokens cost less: $0.30 against $3.00 per 1M
  • Output tokens cost less: $0.60 against $9.00 per 1M
  • Your prompts often run past 200K tokens: $0.30 against $6.00 per 1M input tokens there
Gemma 4 31B details

Choose Grok 4.7 if

  • Cached input costs less: $0.75 against n/a per 1M
  • You need the larger context window: 500,000 tokens against 262,144
  • You need longer answers in one response: 450,000 tokens against 16,384
  • You want to set how much it reasons before it answers
Grok 4.7 details

Neither maker's quality claims are repeated here. The reliable test is your own task: ask both the same question and read the two answers.

Comparison questions

Is Gemma 4 31B cheaper than Grok 4.7?

Yes, Gemma 4 31B is the cheaper of the two. Gemma 4 31B costs $0.30 per 1M input tokens and $0.60 per 1M output tokens; Grok 4.7 costs $3.00 and $9.00 as checked on 23 Nov 2026.

Which has the larger context window, Gemma 4 31B or Grok 4.7?

Grok 4.7, at 500,000 tokens against 262,144 for Gemma 4 31B.

Which is better for coding, Gemma 4 31B or Grok 4.7?

This page does not rank models on quality, and it does not repeat either maker's claims. The table shows what each accepts, supports and costs; the reliable test is your own task: give both the same piece of code and compare the answers.

Can I use both Gemma 4 31B and Grok 4.7?

Grok 4.7 can be chosen in the Upend chat today; Gemma 4 31B is listed in the catalog but not offered in the chat.

Put the same question to both.

Open the chat with one, then switch model and ask again.

Sign in to Upend

Use an account you already have, or get a one-time code by email.

Use a password instead

For accounts that already have a password. Forgotten it? An emailed code signs you in just the same.