Skip to content
API Rates Per-unit API pricing — verified, dated, and logged when it changes
LLM inference APIs
GOOGLE GEMINI, META LLAMA, QWEN (ALIBABA)

Gemma, Llama, and Qwen: the cheapest open models by API cost

Published Pricing verified

You’ve hit the point where every token matters, and the price gap between the tiniest Gemini‑4 flash and the entry‑level Qwen‑3.7 flash is enough to shift your burn by tens of thousands of dollars a month. Below we break down the raw per‑million‑token rates for the smallest models each vendor offers, then weigh the practical implications for a startup that needs a cheap, responsive LLM.

### Token‑by‑token price sheet
| Vendor | Model | Input | Cached input | Output |
|--------|-------|-------|--------------|--------|
| Google Gemini | gemma-4-26b-a4b-it | $0.042 per 1M tokens | – | $0.22 per 1M tokens |
| Google Gemini | gemma-3-4b-it | $0.05 per 1M tokens | – | $0.1 per 1M tokens |
| Meta Llama | llama-3.2-1b-instruct | $0.027 per 1M tokens | – | $0.201 per 1M tokens |
| Meta Llama | llama-3.2-3b-instruct | $0.05 per 1M tokens | – | $0.33 per 1M tokens |
| Alibaba Qwen | qwen3.7-flash | $0.03 per 1M tokens | $0.006 per 1M tokens | $0.13 per 1M tokens |
| Alibaba Qwen | qwen-2.5-7b-instruct | $0.1 per 1M tokens | – | $0.2 per 1M tokens |

The table shows that Qwen’s flash model is the outright cheapest on both input and output, with $0.03 for raw input and $0.13 for output. Gemini’s smallest offering, gemma‑3‑4b‑it, is slightly more expensive on input ($0.05) but still under half the cost of Llama’s 1‑b instruct input ($0.027) while offering a lower output price ($0.1 vs $0.201). If you can cache prompts, Qwen’s $0.006 cached‑input rate gives an extra edge, whereas Gemini’s cached rates only appear on larger models.

### How the numbers translate to real‑world usage
When you run a batch job that consumes 10 M input tokens and produces 8 M output tokens, Qwen’s flash model would cost roughly $0.30 for input plus $1.04 for output, totaling $1.34. Gemini’s gemma‑3‑4b‑it would be $0.50 input and $0.80 output, for $1.30 total – almost identical, but without any cached‑input discount. Llama’s 1‑b instruct lands at $0.27 input and $1.61 output, a clear $0.94 premium over Qwen for the same workload.

For developers who can reuse prompts across calls, Qwen’s cached‑input discount can shave another 20 % off the input bill, making it the most economical choice for high‑throughput pipelines that repeat the same system prompts. Gemini’s flash‑lite tier (gemini‑3.1‑flash‑lite) offers a $0.025 cached‑input rate but its base input price of $0.25 per 1 M tokens makes it unsuitable for cost‑conscious workloads.

If you value ecosystem maturity, safety tooling, and broader language coverage, Gemini’s broader model family may be worth the modest premium, especially when you need a model that scales beyond the smallest tier. Llama’s 1‑b instruct is the cheapest of the Meta lineup, but its output price sits at $0.201 per 1 M tokens, which quickly erodes any input savings as generation volume grows. For pure token‑cost efficiency at the smallest scale, Qwen’s flash model wins, followed closely by Gemini’s gemma‑3‑4b‑it, with Llama trailing behind.

In short, pick Qwen if you need the lowest per‑token spend and can benefit from cached prompts. Choose Gemini’s gemma‑3‑4b‑it when you prefer Google’s ecosystem and need a solid balance between input and output rates. Llama’s smallest model is best only if you already have a Meta‑centric stack and can tolerate higher output fees. Pricing verified on 2026-09-12.

Common questions

Is there a free tier for any of these models?

The provided pricing tables do not list a free tier, so no free tier is documented.

What is the cheapest input price among the three vendors?

Qwen’s qwen3.7-flash charges $0.03 per 1M input tokens, the lowest listed input price.

Do any of the models offer cached‑input discounts?

Yes, Qwen’s qwen3.7-flash offers $0.006 cached input, Gemini’s gemma‑4‑31b‑it offers $0.05 cached input, and Gemini’s gemini‑3.1‑flash‑lite offers $0.025 cached input.

Sources
  1. Google Gemini — pricing
  2. Meta Llama — pricing
  3. Qwen (Alibaba) — pricing