Cost per coding-agent request

Is Gemini 3.1 Pro or Grok 4.20 cheaper for coding agents?

For coding agents, Gemini 3.1 Pro costs 1.4x as much as Grok 4.20 per request ($0.095 vs $0.068 on our measured traffic), because Gemini 3.1 Pro lists at $2 input, $0.20 cached input and $12 output per million tokens against $1.25, $0.20 and $2.50 for Grok 4.20, and both charge more for long prompts.

List prices: Gemini API pricing, xAI models and pricing, checked 2026-10-13. Request costs: Standard Compute gateway data, 79,301 coding-agent requests from 75 users, Sep 13 to Oct 12, 2026. How we compute this

Run Gemini 3.1 Pro in your agent

Or let the router send each step to the cheapest model that can do it, on providers we vet for price, uptime and speed. Plans from $19 a month.

See plans

Cost per coding-agent request, side by side

Cost at list priceGrok 4.20Gemini 3.1 Pro
Prompt under 100K tokens50% of requests, 87% of input cached$0.021$0.032
Prompt of 100K to 272K39% of requests, 88% of input cached$0.077$0.11
Prompt over 272K tokens11% of requests, 86% of input cached$0.26$0.34
Average request$0.068$0.095
100 requests$6.84$9.48
Median session16 requests; a session ends after 10 idle minutes$0.61$0.93
A month of regular usemedian of 20 users active on 5+ days$103$135

Each logged request priced at the vendor’s list rates for its own token counts, including cache reads and any higher rate for long prompts. Average output: 698 tokens per request.

Benchmarks, speed and latency, side by side

Artificial AnalysisGrok 4.20Gemini 3.1 Pro
Intelligence Index10 evaluations, 0 to 10026 (estimate)30
Terminal-Bench 4.0agentic coding in a terminaln/a4.0%
Output speedmedian95 tokens/s144 tokens/s
Time to first answer tokenincludes thinking time21 s23 s

Source: Artificial Analysis (artificialanalysis.ai). Measured variants: Grok 4.20 0309 v2 (Reasoning), speed on SpaceXAI; Gemini 3.1 Pro Preview, speed on Google. Fetched October 13, 2026. Artificial Analysis runs Terminal-Bench 4.0 in its own setup, so its scores differ from the tbench.ai leaderboard.

What to watch for

Grok 4.20 scores close to it on the benchmarks above, so the cheaper request is not bought with much lower ability.

FAQ

Is Grok 4.20 cheaper than Gemini 3.1 Pro for coding agents?
Yes, at list prices. 100 average coding-agent requests cost $6.84 on Grok 4.20 and $9.48 on Gemini 3.1 Pro. A median 16-request session costs $0.61 vs $0.93. Measured on 79,301 real coding-agent requests (Sep 13 to Oct 12, 2026).
How much does a month of Gemini 3.1 Pro vs Grok 4.20 cost?
For the median regular user in our data (1,478 requests in 30 days), about $135 on Gemini 3.1 Pro and $103 on Grok 4.20 at list price. Heavier users pay proportionally more.
Gemini 3.1 Pro vs Grok 4.20: which is better for agents?
Gemini 3.1 Pro scores higher on output quality (6.4/10 vs 5.8/10), while Grok 4.20 is the cheaper option. Gemini 3.1 Pro is best for long multimodal inputs and Gemini CLI setups that still pin 3.1 Pro; Grok 4.20 is best for runs that need more than 1M tokens of context. Live community votes on this page show what people actually prefer.
Can I switch between Gemini 3.1 Pro and Grok 4.20 in the same agent?
Yes. Model-agnostic agents (Cline, Aider, OpenClaw, Hermes Agent, Kilo Code, OpenCode) let you swap models per task. Many people route hard tasks to the stronger model and routine work to the cheaper one.

Community vote

Pick a winner in each dimension. You can change your vote any time.

Output Quality

Correctness and depth of what it produces

Agentic Ability

Tool calls, instruction-following, and multi-step tasks

Speed

Tokens per second and time-to-first-token

Value for Money

How much capability you get per dollar

Reliability

Consistent results: fewer refusals, loops and format breaks

Related comparisons

Setting it up? Gemini 3.1 Pro: model ID, providers and agent config

The agent matters as much as the model. Compare AI agents →

Current Claude, GPT, Gemini and open models run on Standard Compute

Standard Compute

Current frontier models Claude Fable 5.1 · GPT-6 Astra

More intelligence
per dollar.

Each step goes to the cheapest model that can do it, on providers we vet for price, uptime and speed, with automatic fallback when one fails.

Compliance
Opt-in rules keep a company, team or key on European or US providers
Privacy
We don’t train on your prompts or store them

Fixed monthly plans from $19 · cancel anytime

7-day fair refund Free trial, no card Billing by Stripe4,100+ agent users