Gemini 3 Pro Pricing Queries: Verify the Model Version and Recheck 3.1 Pro
A current gemini-3.1-pro gateway rate check, two live JSON requests and five Decimal fixtures separate usage estimates from actual billing and untested discounts.

To estimate gemini-3.1-pro API cost, keep ordinary input, cached input and output separate, then apply the exact route and account-group rate. This guide checks the public configuration and runs two small requests; calculated amounts are estimates, not retrieved account charges.
Crazyrouter was the gateway for this 2-case experiment: 2 cases met the declared complete-output criterion; the results below retain the failures and their limits.
By Brian J · Tested November 3, 2026
gemini 3 pro api pricing per million tokens#
The legacy gemini-3-pro-preview ID is absent from this credential catalog. The explicitly selected gemini-3.1-pro route is visible and has default-group gateway rates of USD 1.10 input, USD 0.275 cached input and USD 6.60 output per million in the inspected configuration. These are rates for a different model version, not a quote that makes the old preview available again.
November 3 experiment and observed results#
The scripts ran on Windows with Python 3.10.2 and synthetic inputs. Gateway generation and catalog requests use https://api.crazyrouter.com; paths and complete payloads appear in the code. Each result describes this run only. A test program exiting successfully means its observations were recorded, not that every model response passed.
| Requested model ID | Visible to this credential |
|---|---|
| gemini-3.1-pro | Yes |
| gemini-3-pro-preview | No; not called |
| Service / group | Tier | Input USD / 1M | Cached input USD / 1M | Output USD / 1M |
|---|---|---|---|---|
| Crazyrouter / default | standard | 1.1 | 0.275 | 6.6 |
| Route / case | HTTP or turns | Finish / outcome | Accepted | Observed output or error |
|---|---|---|---|---|
| gemini-3.1-pro / short answer | 200 | stop | Yes | {"quantity":4} |
| gemini-3.1-pro / empty record | 200 | stop | Yes | {"quantity":0} |
| Case | Prompt | Completion | Reported cached | Calculated USD by rate scenario |
|---|---|---|---|---|
| short answer | 9 | 203 | 0 | standard = 0.0013497 |
| empty record | 9 | 156 | 0 | standard = 0.0010395 |
Observed successful-envelope response IDs (failed acceptance can still have an ID):
chatcmpl-2474e4a3d6bc4e32a5a0358acdbdc6b7
chatcmpl-22c2e65dd35348b3a8ed2693106ede0a
| Executed local case | Expected behavior met |
|---|---|
| uncached | Yes |
| cached subset | Yes |
| empty | Yes |
| cached exceeds input | Yes |
| boolean rejected | Yes |

The retired preview is a separate lifecycle question#
Google’s official Gemini 3 Pro Preview page, checked November 3, says that preview shut down on March 9, 2026 and currently directs readers to Gemini 4 Argon. This is native-service lifecycle guidance. The present gateway experiment explicitly uses 3.1 Pro to recheck the route discussed in the earlier article; it does not test Argon or claim that 3.1 Pro is Google’s current recommended replacement.
What the live usage actually shows#
Both 3.1 Pro requests returned the expected JSON. They used 9 prompt tokens each and 203/156 completion tokens, including 198/151 reasoning tokens. The resulting estimates are USD 0.0013497 and USD 0.0010395. The two short prompts do not test long-context pricing or prove that the gateway follows every tier in Google’s native schedule.
Calculate from counters without inventing extra usage#
The estimator computes (prompt minus cached) × input rate + cached × cache rate + completion × output rate, then divides by one million. Cached tokens are a subset of prompt tokens in this contract. Completion reasoning counters are diagnostic subsets and are not added again.
Five local cases check ordinary usage, a cached subset, zero usage, cached tokens exceeding the prompt and boolean values masquerading as integer counters. The last two are rejected. Missing cached-token details are treated as zero for this estimate; if your billing source reports cache usage separately, reconcile that source rather than assuming this fallback is a proven cache miss.
Know when this estimate stops applying#
The rate loader reads the default group. Another account group, custom arrangement or changed billing rule can produce a different result. The program recognizes only the inspected billing modes and static expression shape. It never executes a remote pricing expression with eval.
No tool charges, taxes, storage, retries or separately billed services were exercised. Two correct small JSON outputs do not validate long context, streaming, tools, vision or workload-wide quality. Verify those features and reconcile actual usage against the ledger before using the estimate as an invoice forecast.
Reproduce the experiment#
Install requests, set CRAZYROUTER_API_KEY in the process environment, save this complete script and run it with Python 3.10 or later. Requests use your authorized credential and can consume usage. Authorization headers are not printed.
import json
import os
import time
import requests
BASE = "https://api.crazyrouter.com/v1"
def catalog(models):
with requests.Session() as s:
s.trust_env=False
r=s.get(BASE+"/models",headers={"Authorization":"Bearer "+os.environ["CRAZYROUTER_API_KEY"]},timeout=(10,40),allow_redirects=False)
r.raise_for_status();names={x["id"] for x in r.json()["data"]}
return {m:m in names for m in models}
def chat(model,prompt,**options):
payload={"model":model,"messages":[{"role":"user","content":prompt}],**options}
record={"model":model,"request":payload};start=time.perf_counter()
try:
with requests.Session() as s:
s.trust_env=False
r=s.post(BASE+"/chat/completions",headers={"Authorization":"Bearer "+os.environ["CRAZYROUTER_API_KEY"]},json=payload,timeout=(10,65),allow_redirects=False)
record["http"]=r.status_code
if r.status_code==200:
d=r.json();c=d["choices"][0];record.update(response_id=d.get("id"),output=c["message"].get("content"),finish=c.get("finish_reason"),usage=d.get("usage",{}))
else:record["error"]="HTTP_"+str(r.status_code)
except (requests.RequestException,ValueError,KeyError,IndexError) as e:record["error"]=type(e).__name__
record["seconds"]=round(time.perf_counter()-start,3)
return record
def parsed(row):
if row.get("finish")!="stop":return None
try:return json.loads(row.get("output") or "null")
except (ValueError,TypeError):return None
def emit(**data):print(json.dumps(data,ensure_ascii=False))
from decimal import Decimal as D
import re
MODEL='gemini-3.1-pro'
LEGACY='gemini-3-pro-preview'
def rates(document,model):
row=next(x for x in document["data"] if x["model_name"]==model)
factor=D(str(document["group_ratio"]["default"]))*D(str(row["group_discounts"]["default"]))
mode=row.get("billing_mode","")
if mode=="time_tiered":
tiers={k:{"input":str(D(str(v["input_per_1m_tokens"]))*factor),"output":str(D(str(v["output_per_1m_tokens"]))*factor),"cache":str(D(str(v["cache_read_per_1m_tokens"]))*factor)} for k,v in row["time_pricing"].items() if k in ["off_peak","peak"]}
elif mode=="tiered_expr":
# Recognize only these inspected static rule shapes, never eval a remote expression.
match=re.fullmatch(r'tier\("standard", p \* ([0-9.]+) \+ cr \* ([0-9.]+)(?: \+ cc \* 0)? \+ c \* ([0-9.]+)\)',row["billing_expr"])
if not match:raise ValueError("Unreviewed pricing expression")
a,b,c=match.groups();tiers={"standard":{"input":str(D(a)*factor),"cache":str(D(b)*factor),"output":str(D(c)*factor)}}
elif mode in ("","per_token"):
base=D(str(row["model_ratio"]))*2*factor
tiers={"standard":{"input":str(base),"cache":str(base*D(str(row["cache_ratio"]))),"output":str(base*D(str(row["completion_ratio"])))}}
else:raise ValueError("Unreviewed billing mode")
return row,tiers
def estimate(usage,rate):
prompt=usage.get("prompt_tokens");completion=usage.get("completion_tokens")
cached=usage.get("prompt_tokens_details",{}).get("cached_tokens",0)
if any(type(x) is not int or x<0 for x in [prompt,completion,cached]) or cached>prompt:raise ValueError("Invalid usage")
return (D(prompt-cached)*D(rate["input"])+D(cached)*D(rate["cache"])+D(completion)*D(rate["output"]))/D(1000000)
fixture={"input":"2","cache":"0.5","output":"8"};tests=[]
for name,usage,expected in [("uncached",{"prompt_tokens":100,"completion_tokens":10},"0.00028"),("cached subset",{"prompt_tokens":100,"completion_tokens":10,"prompt_tokens_details":{"cached_tokens":40}},"0.00022"),("empty",{"prompt_tokens":0,"completion_tokens":0},"0")]:
assert estimate(usage,fixture)==D(expected);tests.append({"case":name,"passed":True})
for name,usage in [("cached exceeds input",{"prompt_tokens":2,"completion_tokens":0,"prompt_tokens_details":{"cached_tokens":3}}),("boolean rejected",{"prompt_tokens":True,"completion_tokens":0})]:
try:estimate(usage,fixture);raise AssertionError("invalid usage accepted")
except ValueError:tests.append({"case":name,"passed":True})
with requests.Session() as s:
s.trust_env=False;r=s.get("https://crazyrouter.com/api/pricing",timeout=(10,40));r.raise_for_status();document=r.json()
row,tiers=rates(document,MODEL);available=catalog([MODEL]+([LEGACY] if LEGACY else []));rows=[]
if available[MODEL]:
for name,prompt,expected in [("short answer",'Return only JSON {"quantity":4}.',{"quantity":4}),("empty record",'Return only JSON {"quantity":0}.',{"quantity":0})]:
options={"max_completion_tokens":1024,"reasoning_effort":"minimal"} if MODEL.startswith("gpt-5") else {"max_tokens":2048}
rec=chat(MODEL,prompt,**options);rec.update(case=name,passed=parsed(rec)==expected)
if rec.get("usage"):
try:rec["estimated_usd_by_tier"]={k:str(estimate(rec["usage"],v)) for k,v in tiers.items()}
except ValueError:rec["estimate_error"]="Unsupported usage counters"
rows.append(rec)
emit(local_tests=tests,catalog=available,requests=rows,rates_usd_per_million=tiers,pricing_row=row,pricing_group="default",scope="Public rate arithmetic, not a ledger debit; reasoning not added twice to completion tokens; no claim of cache hit")

Sources and related guides#
Sources checked November 3, 2026: Official model or pricing reference, Crazyrouter public pricing configuration, Python Decimal, Google Gemini 3 Pro Preview lifecycle. Official descriptions and gateway observations are separate evidence.
- AI SaaS Unit Economics: Calculate Cost per Usable Output
- Lower AI API Token Use: A Paired Prompt-Compression Test in Python
- Prompt Caching in Python: Read Token Counters Before Claiming Savings
- AI API Reseller vs Official API: What a Synthetic Probe Can Verify
- Gemini 2.5 Pro API: Two Text Checks and a Documented Migration Deadline
FAQ#
Are these actual charged amounts?#
No. They are calculations from public configuration and returned usage; no account ledger was queried.
Which account group is used?#
The default group and its published discount configuration.
Were both model requests successful?#
Both returned the expected complete JSON in this run; the result table preserves their usage.
Was a cache hit measured?#
No cache hit is established by these small requests. The cached-rate row is configuration evidence.
Should I add reasoning tokens to completion tokens?#
Not for these envelopes, where reasoning is already represented within the reported completion total.
What happens when pricing rules change?#
Fetch and review the new configuration, rerun the calculation checks and verify the applicable route before relying on old estimates.
Last actually tested: November 3, 2026. This API-dependent article is due for review December 3, 2026.
Implementation Guides
Podcast
AI Dev Tools: The Crazyrouter Podcast
Short episodes for developers on AI APIs, gateways, cost control and coding tools.
Latest episodes
EP196 · Oct 29, 2026 · 6:53
AI API Security Posture — Turn Controls Into Continuous Evidence
A practical guide to AI API security posture: inventory exposure, verify controls continuously, protect keys and data, constrain tools, and turn security assumptions into evidence that operators can act on.
EP195 · Oct 28, 2026 · 7:21
AI API Policy Drift — Detect When Production Rules Stop Matching Intent
A practical guide to policy drift in AI APIs: version routing and safety rules, detect stale enforcement, compare intended and observed behavior, and restore control before small gaps become incidents.





