Roar AI
DiscordGet started
Head to head

Qwen 3.8 27B vs Gemma 4 31B

The two strongest small dense open models. On Roar AI, Qwen 3.8 27B costs $0.455 and Gemma 4 31B costs $0.182 per million input tokens.

Pricing and specs

Qwen 3.8 27B and Gemma 4 31B: pricing and specs
FeatureQwen 3.8 27BGemma 4 31B
Made byAlibabaGoogle
ReleasedAugust 2026April 2026
Input price, per 1M tokens$0.455$0.182
Output price, per 1M tokens$2.73$0.52
Cached input, per 1M tokens$0.117—
Batch (usually about half price)NoYes
Context window262K tokens256K tokens
Longest answer131K tokens—
ReadsText, images, videoText, images, video
Thinks before answeringYes, adjustableYes, adjustable
Open weightsYes: Apache 2.0Yes: Apache 2.0

Prices are Roar AI’s published rates, live from our price list. Specs are each lab’s own published figures.

Verdict

Qwen 3.8 27B or Gemma 4 31B?

Qwen 3.8 27B is the better coder and computer-use agent; Gemma 4 31B, from Google’s Gemini research line, is a solid, well-documented choice for reading documents and images.

Choose Qwen 3.8 27B if

  • Coding: 61.7% on SWE-bench Pro, by Alibaba’s count.
  • Operating desktop software.
About Qwen 3.8 27B

Choose Gemma 4 31B if

  • Reading forms, documents and images.
  • Maths for its size: 89.2% on AIME 2026.
  • A model from Google under Apache 2.0.
About Gemma 4 31B

Cost comparison

Take 1,000 requests, each about 3,000 tokens in and 1,000 out: a long prompt and a page of answer.

Qwen 3.8 27B$4.09
Gemma 4 31B$1.07

Gemma 4 31B is 3.8× cheaper for the same job. Models that think before answering spend extra output tokens doing it, so on hard prompts the gap can be wider than the rates suggest.

Use both with one API key

On Roar AI both are on the same key and the same monthly invoice. Trying the other one is a one-word change:

client.chat.completions.create(model="qwen3.8-27b", …)
client.chat.completions.create(model="gemma-4-31b-it", …)

Send the same prompts to both and compare the answers on your own work. Read the docs.

FAQ

Which is cheaper, Qwen 3.8 27B or Gemma 4 31B?

On Roar AI, Qwen 3.8 27B costs $0.455 per million input tokens and $2.73 per million output tokens, and Gemma 4 31B costs $0.182 per million input tokens and $0.52 per million output tokens. For 1,000 requests of about 3,000 tokens in and 1,000 out, that is $4.09 and $1.07.

Which has the larger context window, Qwen 3.8 27B or Gemma 4 31B?

Qwen 3.8 27B reads up to 262K tokens at once, against 256K tokens for Gemma 4 31B.

Can I use Qwen 3.8 27B and Gemma 4 31B with one API key?

Yes. On Roar AI both models answer on the same OpenAI-compatible API, with one key and one monthly bill, so switching between them is a change to the model name.

Compare them on your own prompts

Create a free account and call both models with one API key.