Llama Guard 4 12B vs Grok 4.7: API pricing

Compare Llama Guard 4 12B vs Grok 4.7 API pricing, context windows, and monthly workload costs side by side; via OpenRouter, as of 2026-11-13.

Prices via OpenRouter · as of 13 Nov 2026. USD per million tokens.

Llama Guard 4 12B and Grok 4.7 API prices, USD per million tokens
Llama Guard 4 12BGrok 4.7
LabMetaSpaceXAI
Input$0.18$2.00
Output$0.18$6.00
Cached inputnot listed$0.50
Context window164K tokens500K tokens
Maximum output16K tokens450K tokens
Input typesimage, texttext, image, file

Monthly cost for common workloads

WorkloadAssumptionsLlama Guard 4 12B per monthGrok 4.7 per monthCheaper
Chat assistant1,000 requests a day, 2,000 input and 500 output tokens each, 30% of input cached$13.50$183.00Llama Guard 4 12B
Support bot2,000 requests a day, 3,000 input and 300 output tokens each, 60% of input cached$35.64$306.00Llama Guard 4 12B
Document summaries200 requests a day, 20,000 input and 800 output tokens each, 0% of input cached$22.46$268.80Llama Guard 4 12B
Coding agent500 requests a day, 60,000 input and 2,000 output tokens each, 85% of input cached$167.40$832.50Llama Guard 4 12B
Bulk classification100,000 requests a day, 300 input and 5 output tokens each, 50% of input cached$164.70$1,215.00Llama Guard 4 12B

Verdict

Llama Guard 4 12B is 11x cheaper than Grok 4.7 for input ($0.18 against $2.00 per million tokens). Llama Guard 4 12B is 33x cheaper than Grok 4.7 for output ($0.18 against $6.00 per million tokens). Grok 4.7 has the larger context window, 500K tokens against 164K tokens. Llama Guard 4 12B works out cheaper for all 5 workloads below. For a chat assistant the bill is about $13.50 a month with Llama Guard 4 12B and $183.00 with Grok 4.7.

Keep exploring

Enable JavaScript to use the interactive ModelCost app and calculator.