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.
| Feature | Qwen 3.8 27B | Gemma 4 31B |
|---|---|---|
| Made by | Alibaba | |
| Released | August 2026 | April 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) | No | Yes |
| Context window | 262K tokens | 256K tokens |
| Longest answer | 131K tokens | — |
| Reads | Text, images, video | Text, images, video |
| Thinks before answering | Yes, adjustable | Yes, adjustable |
| Open weights | Yes: Apache 2.0 | Yes: Apache 2.0 |
Prices are Roar AI’s published rates, live from our price list. Specs are each lab’s own published figures.
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.
Take 1,000 requests, each about 3,000 tokens in and 1,000 out: a long prompt and a page of answer.
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.
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.
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.
Qwen 3.8 27B reads up to 262K tokens at once, against 256K tokens for Gemma 4 31B.
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.
Create a free account and call both models with one API key.