Open-weights chat model from Google AI Studio. One API key reaches all 14 providers, with automatic failover.
No card required. Start with 1 million free tokens.
About Gemma 4 31B
Gemma 4 31B is an open-weights chat model published by Google AI Studio, with a 262,144-token context window. It scores 101 on AI IQ, ranked #120. Through TrustedRouter it runs on 14 providers, with options in the US and EU, from $0.11 per million input tokens. Five providers offer zero data retention, and Tinfoil also runs it in a confidential enclave.
- Model ID
google/gemma-4-31b-it- Publisher
- Google AI Studio
- Modes
- chat
- Billing
- Credits or your own provider key
Set it up with your agent
Paste this into Claude Code, Cursor or any coding agent.
Use Gemma 4 31B through TrustedRouter in this project.
1. Read https://trustedrouter.com/llms.txt
2. Point the OpenAI-compatible client at
https://api.trustedrouter.com/v1 and read the key from
TRUSTEDROUTER_API_KEY.
3. Set the model to google/gemma-4-31b-it.
4. Run the tests, then show me the diff before committing.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.trustedrouter.com/v1",
api_key=os.environ["TRUSTEDROUTER_API_KEY"],
)
response = client.chat.completions.create(
model="google/gemma-4-31b-it",
messages=[{"role": "user", "content": "What is the capital of France?"}],
)
print(response.choices[0].message.content)
curl https://api.trustedrouter.com/v1/chat/completions \
-H "Authorization: Bearer $TRUSTEDROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemma-4-31b-it",
"messages": [{"role": "user", "content": "What is the capital of France?"}]
}'
Providers
Your key goes to the cheapest healthy provider and fails over on its own. Open a row for retention, location and weight format, or see how we check privacy claims and the live speed leaderboard.
| Provider | Input | Cached | Output | Cost per 1M in + out | Details |
|---|---|---|---|---|---|
|
|
$0.106 | — | $0.359 | $0.46 | |
|
Retention Verification: no verified privacy claim. W&B Serverless Inference runs on CoreWeave infrastructure. W&B does not publish a zero-retention, confidential-compute, or end-to-end-encryption commitment for this service, so these routes use the Standard privacy tier. TrustedRouter does not enable W&B Weave tracing for provider calls. Location Operator country: US Headquarters / registered office: Not verified. Inference: Inference location not verified; no country-specific residency commitment. No inference-location declaration has been verified for this provider. Region pinning through TR: No verified provider-specific location pin documented here. Weight format Unknown Price and speed Input $0.1055/1M · Cached input Not published · Output $0.3587/1M TTFT: insufficient data Speed: insufficient data |
|||||
|
|
$0.148 | $0.148 | $0.422 | $0.57 | |
|
Retention Verification: privacy unknown. No provider-ZDR claim is tracked here. Crusoe's Managed Inference docs and pricing/catalog pages are linked for model and API data-handling review. Location Operator country: US Headquarters / registered office: Not verified. Inference: Inference location not verified; no country-specific residency commitment. No inference-location declaration has been verified for this provider. Region pinning through TR: No verified provider-specific location pin documented here. Weight format Unknown Price and speed Input $0.1477/1M · Cached input $0.1477/1M · Output $0.422/1M TTFT: 0.92 s Speed: insufficient data Last sample: |
|||||
|
|
$0.148 | — | $0.422 | $0.57 | |
|
Retention Verification: privacy unknown. No provider-ZDR claim is tracked here. Friendli's legal/privacy terms are linked for users who need to review API data handling. Location Operator country: US Headquarters / registered office: Not verified. Inference: Inference location not verified; no country-specific residency commitment. No inference-location declaration has been verified for this provider. Region pinning through TR: No verified provider-specific location pin documented here. Weight format Unknown Price and speed Input $0.1477/1M · Cached input Not published · Output $0.422/1M TTFT: 1.18 s 249.8 tokens/s Last sample: |
|||||
|
|
$0.148 | — | $0.422 | $0.57 | |
|
Retention Verification: privacy unknown. No provider-ZDR claim is tracked here. Novita's privacy policy says personal information is not used for model training; customer-content processing is governed by customer agreements. Location Operator country: US Headquarters / registered office: San Francisco, California, United States. Company location source (reviewed 2026-09-27). Inference: Shared inference API; processing countries unconfirmed, no fixed-region commitment. No exhaustive inference-country list verified for the shared model API. Novita publishes worldwide GPU rental regions, but that separate product does not establish shared serverless model placement. Region pinning through TR: Not supported by the current TrustedRouter integration. Reviewed 2026-10-28. Weight format Unknown Price and speed Input $0.1477/1M · Cached input Not published · Output $0.422/1M TTFT: insufficient data 88.6 tokens/s Last sample: |
|||||
|
|
$0.158 | $0.0633 | $0.422 | $0.58 | |
|
Retention Zero data retention. Tracked as ZDR for serverless and dedicated inference. Parasail documents no storage or logging of submitted input on those service paths, retention only while generating and delivering output, and no training on input or output. Batch service is excluded from this claim; TrustedRouter does not route Parasail traffic through batch. Location Operator country: US Headquarters / registered office: Not verified. Inference: Inference location not verified; no country-specific residency commitment. No inference-location declaration has been verified for this provider. Region pinning through TR: No verified provider-specific location pin documented here. Weight format Unknown Price and speed Input $0.15825/1M · Cached input $0.0633/1M · Output $0.422/1M TTFT: 1.16 s 178.8 tokens/s Last sample: |
|||||
|
|
$0.157 | $0.0609 | $0.443 | $0.60 | |
|
Retention Zero data retention. Verification: provider E2EE not verified. Greenference SAS's DPA commits to EU-only inference, no persistent prompt/output storage and no training or secondary use. Shared prefix caches remain in volatile GPU memory until eviction or instance restart; they are not account-isolated and have no fixed maximum lifetime. Content-free operational metadata is retained. Greenference runs its own serving software on rented EU compute; this is contractual ZDR, not verified confidential compute or E2EE. Its current electricity mix is unverified, not a 100% renewable-energy commitment. Location Operator country: FR Headquarters / registered office: Not verified. Inference: EU-only inference, dynamically placed; no individual-country commitment. All inference is on Greenference-operated serving software on rented EU GPU capacity. Region pinning through TR: Select provider.only=[greenference] with allow_fallbacks=false to restrict this route. Reviewed 2026-10-09. Weight format Unknown Price and speed Input $0.156668/1M · Cached input $0.060927/1M · Output $0.4431/1M TTFT: insufficient data Speed: insufficient data Last sample: |
|||||
|
|
$0.211 | — | $0.422 | $0.63 | |
|
Retention Verification: no verified privacy claim. Tracked as no-store, not strict ZDR. DeepInfra documents memory-only handling and no training for ordinary inference, but reserves the right to log a small portion of requests for debugging or security. Google- and Anthropic-backed routes also inherit those vendors' terms. Location Operator country: US Headquarters / registered office: Palo Alto, California, United States. Company location source (reviewed 2026-09-27). Inference: US infrastructure plus announced Canadian capacity; model-specific residency unconfirmed. DeepInfra describes US infrastructure and announced its first international data center in Toronto on July 8, 2026. This is a provider footprint, not an exhaustive or model-specific placement list. DeepSeek V4.1 Flash placement has not been confirmed; do not declare this route US-only. Region pinning through TR: Not supported by the current TrustedRouter integration. Reviewed 2026-09-27. DeepInfra infrastructure statement Weight format Unknown Price and speed Input $0.211/1M · Cached input Not published · Output $0.422/1M TTFT: insufficient data 49.4 tokens/s Last sample: |
|||||
|
|
$0.368 | $0.184 | $0.667 | $1.03 | |
|
Retention Verification: privacy unknown. In its September 28, 2026 marketplace submission, io.net states that inference prompts and completions are processed only in memory, are not stored or logged, and are not used for training. Content-free operational metadata is retained for billing, capacity planning and abuse prevention. This is a provider declaration: the reviewed public privacy policy does not establish inference-specific zero-retention terms, and the applicable DPA has not been reviewed. Routes remain Standard pending that evidence. Confidential compute is offered on request, but this integration has no verified confidential-compute or provider-side E2EE guarantee. Location Operator country: US Headquarters / registered office: West Hollywood, California, United States (operating address). Company location source (reviewed 2026-09-28). Inference: United States and Canada, provider-declared; no US-only or fixed-country guarantee on this route. io.net declares US and Canadian serving locations and data residency in its September 28, 2026 marketplace submission. This is provider-wide information, not an independently verified per-model or per-request location. Region pinning through TR: Not supported by the current TrustedRouter integration. Reviewed 2026-09-28. API documentation (not a location guarantee) Weight format Unknown Price and speed Input $0.368195/1M · Cached input $0.184098/1M · Output $0.66676/1M TTFT: insufficient data Speed: insufficient data Last sample: |
|||||
|
|
$0.422 | $0.211 | $0.633 | $1.06 | |
|
Retention Zero data retention. Sail's public DPA and security documentation provide default ZDR for inference: Sail and its subprocessors process prompts and outputs ephemerally in memory, without persistent storage or training absent written consent. Files API uploads and stateful Sailboxes are excluded. This is policy-backed ZDR, not verified confidential compute or E2EE. Location Operator country: Not verified Headquarters / registered office: Not verified. Inference: Global, dynamically placed; TrustedRouter does not enforce Sail's US-only option. Sail documents multi-region processing by default, including outside the United States. Region pinning through TR: Not supported by the current TrustedRouter integration. Reviewed 2026-10-28. Weight format Unknown Price and speed Input $0.422/1M · Cached input $0.211/1M · Output $0.633/1M TTFT: insufficient data Speed: insufficient data Last sample: |
|||||
|
|
$0.443 | $0.222 | $0.886 | $1.33 | |
|
Retention Verification: privacy unknown. Boundless's October 27 terms prohibit persistent input/output storage after real-time processing, while retaining content-free request records for up to 90 days. The terms still disclaim third-party infrastructure practices; an equivalent downstream retention commitment is not verified. Routes remain outside strict ZDR, confidential compute and E2EE. Location Operator country: US Headquarters / registered office: Not verified. Inference: US, UK and/or EU infrastructure, provider-declared; no per-request residency commitment. October 27 terms, section 3.3, describe provider-wide infrastructure in the US, UK and/or EU; not an exact-model placement receipt. Region pinning through TR: Not supported by the current TrustedRouter integration. Reviewed 2026-10-28. Weight format Unknown Price and speed Input $0.4431/1M · Cached input $0.22155/1M · Output $0.8862/1M TTFT: insufficient data 105.3 tokens/s Last sample: |
|||||
|
|
$0.422 | — | $1.06 | $1.48 | |
|
Retention Confidential compute with end-to-end encryption and zero data retention. Tracked as a confidential inference provider with attested provider compute and no prompt/output logging claims. Location Operator country: US Headquarters / registered office: Not verified. Inference: Inference location not verified; no country-specific residency commitment. No inference-location declaration has been verified for this provider. Region pinning through TR: No verified provider-specific location pin documented here. Weight format BF16. Published serving configuration, reviewed 2026-09-27. Per-request precision is not verified. Pinned model configuration declares BF16, with no weight quantization override in the reviewed serving command. Draft model precision is separate. KV cache: unspecified. Price and speed Input $0.422/1M · Cached input Not published · Output $1.055/1M TTFT: 0.78 s 233.7 tokens/s Last sample: |
|||||
|
|
$0.401 | — | $1.21 | $1.61 | |
|
Retention Verification: privacy unknown. No contractual zero-retention, confidential-compute, or E2EE claim is tracked for TrustedRouter's SambaNova account. This route is Standard. Location Operator country: Not verified Headquarters / registered office: Not verified. Inference: Inference location not verified; no country-specific residency commitment. No inference-location declaration has been verified for this provider. Region pinning through TR: No verified provider-specific location pin documented here. Weight format Unknown Price and speed Input $0.4009/1M · Cached input Not published · Output $1.21325/1M TTFT: 2.50 s 221.4 tokens/s Last sample: |
|||||
|
|
$0.791 | $0.264 | $1.06 | $1.85 | |
|
Retention Verification: privacy unknown. No provider-ZDR claim is tracked here. SiliconFlow's privacy policy source is linked for retention and interaction-data terms. Location Operator country: SG Headquarters / registered office: Singapore (international API operator). Company location source (reviewed 2026-09-27). Inference: Inference countries unconfirmed; no verified country-specific residency commitment. TrustedRouter uses api.siliconflow.com. Neither its hostname nor the provider's Singapore legal jurisdiction establishes the DeepSeek V4.1 Flash GPU location. No exhaustive route-specific country list verified. Region pinning through TR: Not supported by the current TrustedRouter integration. Reviewed 2026-09-26. Weight format Unknown Price and speed Input $0.79125/1M · Cached input $0.26375/1M · Output $1.055/1M TTFT: 1.10 s 118.1 tokens/s Last sample: |
|||||
|
|
$0.471 | — | $2.48 | $2.95 | |
|
Retention Zero data retention. Regolo states that inference prompts and outputs are processed in memory and discarded, with no reuse for training. This is a provider policy, not verified confidential compute or provider-side E2EE. Location Operator country: IT Headquarters / registered office: Not verified. Inference: Inference location not verified; no country-specific residency commitment. No inference-location declaration has been verified for this provider. Region pinning through TR: No verified provider-specific location pin documented here. Weight format Unknown Price and speed Input $0.471459/1M · Cached input Not published · Output $2.475157/1M TTFT: 1.17 s 132.4 tokens/s Last sample: |
|||||
Append :nitro to the model ID, or send "provider": {"sort": "throughput"}, to route to the fastest provider instead.
Questions
What model ID should I use for Gemma 4 31B?
Use google/gemma-4-31b-it as the model field with the TrustedRouter OpenAI-compatible API. Credits routing and provider fallback happen behind that model ID.
Do you log my prompts or outputs?
No. Prompt and output content are intentionally excluded from the control plane and metadata systems. Optional content export requires explicit destination-level configuration.
Which providers serve Gemma 4 31B?
TrustedRouter currently lists Tinfoil, Parasail, Sail Research, Greenference, Regolo, Crusoe, DeepInfra, FriendliAI, Novita AI, SiliconFlow, SambaNova, IO Intelligence, Boundless, and Weights & Biases for Gemma 4 31B. Provider availability and routing eligibility can change as catalog and health data update.
How much does Gemma 4 31B cost through TrustedRouter?
The current lowest Credits input price is $0.1055/1M and the lowest Credits output price is $0.3587/1M. Prices are per one million tokens and come from the current route catalog.
How do I require zero data retention for Gemma 4 31B?
Set provider.min_privacy to zdr on the request. TrustedRouter considers only routes with a recorded zero-data-retention posture and fails closed if no eligible route remains.
Gemma 4 31B vs other models
Start building with Gemma 4 31B.
No card required. Start with 1 million free tokens.
