Create a provider API key and set the local environment variable OPENROUTER_API_KEY, then run the example below.
Request URL
https://openrouter.ai/api/v1/chat/completions
Connection settings
Base URL: https://openrouter.ai/api/v1
Catalog model: google/gemma-4-31b-it:free
Request API model: google/gemma-4-31b-it:free
Protocol: openai
Provider routing: google-ai-studio
API key env: OPENROUTER_API_KEY
Docs: https://openrouter.ai/docs
curl
curl "https://openrouter.ai/api/v1/chat/completions" -H "Authorization: Bearer $OPENROUTER_API_KEY" -H "Content-Type: application/json" -d '{
"model": "google/gemma-4-31b-it:free",
"messages": [
{
"role": "user",
"content": "Read this support ticket and return a JSON object with \"summary\", \"urgency\" (low, medium, or high), and \"next_step\". Use null for missing details.\n\nTicket: I paid for the Pro plan yesterday, but my account still shows Free. My team needs access before tomorrow’s demo."
}
],
"provider": {
"order": [
"google-ai-studio"
],
"only": [
"google-ai-studio"
],
"allow_fallbacks": false
}
}'
Prompt for your coding agent
Use the OpenAI-compatible API at https://openrouter.ai/api/v1 with model "google/gemma-4-31b-it:free". Set provider.only to ["google-ai-studio"] and allow_fallbacks to false. Apply the recorded quantization filter. A base slug can match multiple endpoints, so confirm the served route before using the reference price. Read the API key from the OPENROUTER_API_KEY environment variable; never hardcode it. Pricing observed on 2026-11-22: $0.00 / 1M input tokens, $0.00 / 1M output tokens. API integration docs: https://openrouter.ai/docs. Billing scope and conditions: Served by Google AI Studio through OpenRouter, not a direct-provider contract. Published rates for route google-ai-studio; unknown quantization. Other fees, tier conditions and regional access must be checked before use.. Source: https://openrouter.ai/api/v1/models/google/gemma-4-31b-it%3Afree/endpoints.
Task test prompt
Read this support ticket and return a JSON object with "summary", "urgency" (low, medium, or high), and "next_step". Use null for missing details.
Ticket: I paid for the Pro plan yesterday, but my account still shows Free. My team needs access before tomorrow’s demo.
Price facts
Input: $0.00 / 1M tokens
Output: $0.00 / 1M tokens
Currency: USD
Regions: global
Unit source: api
Checked: 2026-11-22T09:20:23.706Z
Source: https://openrouter.ai/api/v1/models/google/gemma-4-31b-it%3Afree/endpoints
Source check: 2026-11-22 · valid no later than 2026-11-23 09:21 UTC
Billing evidence and sources
google/gemma-4-31b-it:free · google-ai-studio
Billing conditions
Served by Google AI Studio through OpenRouter, not a direct-provider contract. Published rates for route google-ai-studio; unknown quantization. Other fees, tier conditions and regional access must be checked before use.
Gemma 4 31B API pricing: official and providers: 16 current published quote records across 2 exact API IDs and 14 providers. Compare API versions, currencies, regions and billing conditions separately; prices do not prove task quality or account access.
Latest recorded source check: 2026-11-22
Recorded changes
Latest 100 recorded price and availability changes
Showing up to 100 recent events. Prices for unavailable endpoints are retained for reference. Failed source checks do not establish that a price stayed unchanged.
Open a quote’s billing details for cache reads/writes, request fees and endpoint instructions. Batch, free, promotional and off-peak tiers are selected separately. Context-tier, storage, search, tax and platform fees may be excluded.
Find lower-cost alternatives
Find lower-cost alternatives
Choose your existing model to find lower reference costs with matching declared technical constraints. Output quality remains unverified.
Loading verified quotes…
Users’ choices · Gemma 4 31B
Describe your work to find related tasks.
Public scores by use
The same model scores differently by use. Once you pick a use, the site applies that use’s quality gate before comparing cost.
Text
Answer from sources14496118 votes · 2026-11-19
Chinese1479521 votes · 2026-11-19
Classify14531797 votes · 2026-11-19
Extract fields14531797 votes · 2026-11-19
General text14526121 votes · 2026-11-19
Multi-turn14651121 votes · 2026-11-19
Summarize14691798 votes · 2026-11-19
Translate & rewrite14383798 votes · 2026-11-19
Write1418974 votes · 2026-11-19
Code & tools
Code15021408 votes · 2026-11-19
Web & frontend137016567 votes · 2026-11-20
Industry
Business & finance14491176 votes · 2026-11-19
Legal & government1455451 votes · 2026-11-19
Medical & health1471421 votes · 2026-11-19
Vision & research
Image understanding127942217 votes · 2026-11-19
Scores come from Arena public-preference leaderboards (CC BY 4.0), latest published 2026-11-20. They describe the model, not your task’s success rate or a quantized channel. Arena ↗
Declared fields from the OpenRouter model catalog, bound to exact API IDs; not our tests, price approval or account availability.
Input
Image · Text · Video
Output
Text
Context
262K
Reasoning parameter
Supported
Knowledge cutoff
Not declared
Open-weights clue
google/gemma-4-31B-it
Per-API facts · 2 versions
google/gemma-4-31b-it · image / text / video → text · 262K · reasoning
google/gemma-4-31b-it:free · image / text / video → text · 262K · reasoning
Source: https://openrouter.ai/api/v1/models, captured 2026-11-21T09:20:20.905Z, raw SHA-256: 19214ba490361282… . Unstated facts stay unknown and are not inferred from names or sibling models.
Classification sources
Source declarations for registered versions; not task quality, current account availability or price approval. Unknown versions do not inherit sibling classifications.
Snapshots and routing variants remain distinct. Choose an exact ID in the comparison before deciding; model quality and access conditions need your own review.