Gemma 4 31B API
Google·Vision· 90.0% success (7d)
Gemma 4 31B
Pricing
Cheapest live price, per 1 million tokens.
Input / 1M tokens
$0.120 OpenRouter
Output / 1M tokens
$0.360 OpenRouter
Cache read / 1M
Repeated prompt prefixes
Cache read is the discounted rate for repeated prompt prefixes (system prompts, agent context).
Capabilities · 7
Specifications
- Context window
- 256K
- Max output
- 128K
- Type
- Vision
- Creator
- Live sellers
- 53
- Requests / 24h
- 179,869
Price history · 60 days
Estimated monthly cost
30 days at the cheapest live price.
Quick start
OpenAI-compatible — change the base URL and key. Get a key from the dashboard.
from openai import OpenAI
client = OpenAI(
base_url="https://api.qubax.ai/v1",
api_key="YOUR_QUBAX_API_KEY",
)
response = client.chat.completions.create(
model="gemma-4-31b",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)About Gemma 4 31B
Gemma 4 31B is a multimodal language model developed by Google. It's particularly well-suited for analyzing images, screenshots, and visual content, orchestrating tool-using agents that call APIs and external services, producing structured outputs for reliable data extraction and handling large contexts of up to 256K tokens. Its 256K-token context window means you can pass in entire documents, codebases, or conversation histories without losing context. It can write up to 128K tokens in a single response.
As of Dec 2, 2026, Gemma 4 31B costs $0.0009 per 1M input tokens and $0.0027 per 1M output tokens on Qubax, versus $0.120 / $0.360 on OpenRouter (99% less for input and output together). A typical 1,000 chat requests (2K tokens in, 500 out) come to about $0.00. Measured availability over the last 7 days: 90.0%. 53 independent compute providers currently serve it, so requests fail over automatically. It handled 179,869 requests on Qubax in the last 24 hours. Pay with USDC, USDT, BTC, ETH or 350+ other coins — no credit card required.
Similar-priced alternatives
Frequently asked questions
How much does the Gemma 4 31B API cost?
On Qubax, Gemma 4 31B costs $0.0009 per 1M input tokens and $0.0027 per 1M output tokens. OpenRouter charges $0.120 / $0.360, so input and output together are 99% cheaper on Qubax.
Is the Gemma 4 31B API compatible with OpenAI?
Yes. Qubax provides an OpenAI-compatible API. You can use Gemma 4 31B as a drop-in replacement by changing your base URL to https://api.qubax.ai/v1 and using your Qubax API key. It works with Cline, Cursor, OpenCode, Hermes Agent, and any tool that supports OpenAI APIs.
Why is Gemma 4 31B cheaper on Qubax than OpenRouter?
Qubax sources AI inference from an open compute marketplace on the Base blockchain where GPU providers compete on price. We pass the savings to you — 99% cheaper than OpenRouter's price for Gemma 4 31B.
How do I pay for Gemma 4 31B API usage?
Qubax uses prepaid crypto credits. Top up with USDC, USDT, BTC, ETH, SOL or 350+ other coins and your balance is deducted as you use the API. No credit card or KYC required.
What is the context window of Gemma 4 31B?
Gemma 4 31B supports a context window of 256K tokens, allowing you to process large documents, codebases, or long conversations in a single request.
What can I build with Gemma 4 31B?
You can use Gemma 4 31B to analyze images and visual content, build autonomous agents that call external tools and APIs, generate structured JSON output for data pipelines and process long documents and entire codebases. Because it's served through Qubax's OpenAI-compatible API, integration into existing apps, agents, or workflows takes just a few lines of code.
How fast and reliable is Gemma 4 31B on Qubax?
Measured time to first token (p95) on Qubax is 115.7s. Its 7-day success rate is 90.0%. Responses stream token by token. 53 sellers serve it, so if one is slow or down the request moves to the next.
Gemma 4 31B vs Qwen 3 Next 80b: which should I choose?
Gemma 4 31B by Google and Qwen 3 Next 80b by Alibaba are both strong models in a similar price tier. Gemma 4 31B and supports vision/image inputs. Qwen 3 Next 80b comes from a different lab and may have different strengths depending on your workload. On Qubax, Gemma 4 31B starts at $0.0009/1M input tokens while Qwen 3 Next 80b comes in at $0.0007/1M, so Qwen 3 Next 80b may be worth considering if you need to minimize per-token cost. Both are available on Qubax with crypto payments and OpenAI-compatible APIs, so you can try each and switch freely.
Can I use Gemma 4 31B for commercial projects?
Yes. Gemma 4 31B on Qubax can be used for commercial purposes. You own the outputs you generate. Qubax provides the API infrastructure — you bring your use case.
Why use Gemma 4 31B on Qubax?
99% cheaper
Providers compete on price — you get the cheapest healthy seller.
Pay with crypto
350+ coins (BTC, ETH, SOL, USDT, USDC). No card, no KYC.
OpenAI & Anthropic compatible
Drop-in base URL. Works with Cline, Cursor, Claude Code, OpenAI and Anthropic SDKs.