Gemma 4 31B IT API

Gemma 4 31B IT from Google, served on Jarvislabs GPUs behind an OpenAI-compatible API. Call it with the OpenAI SDK and pay only for the tokens you use.

Specifications

Gemma 4 31B IT specifications

Model
Model IDgemma-4-31b-it
DeveloperGoogle
FamilyGemma
Hugging Facegoogle/gemma-4-31B-it
PrecisionBF16
Context window262,144 tokens (256K)
InputText, image, video
OutputText
Capabilities
ReasoningSupported
Thinking on/offenable_thinking, on by default
Tool callingSupported
JSON Schema outputSupported
Image inputSupported
Video inputSupported
StreamingSupported
Pricing, USD per 1M tokens
Input$0.14
Cached input$0.05
Output$0.40
API
Base URLhttps://models.jarvislabs.net/v1
EndpointPOST /chat/completions
CompatibilityOpenAI Chat Completions
Responses APINot supported
AuthenticationJarvislabs API key, as a Bearer token

Pricing

Gemma 4 31B IT pricing

Example: what 10,000 requests cost at the current rates.
10,000 requests, each 2,000 input and 500 output tokens$4.80
The same, with 1,500 of each prompt’s input tokens cached$3.45
  • Usage bills per token from your Jarvislabs credit balance, the same balance your GPU instances use.
  • Cached input applies automatically when a prompt starts with tokens the model has already processed. There is no cache-write fee.
  • Reasoning tokens bill as output.
  • Rates are in USD. Signed-in customers see prices in their billing currency.

API

Gemma 4 31B IT API usage

Point the OpenAI SDK at https://models.jarvislabs.net/v1 with a Jarvislabs API key and set the model to gemma-4-31b-it.

Request parameters
FeatureParameterValues
Streamingstreamtrue; add stream_options: {"include_usage": true} for token usage in the last chunk
Thinking on/offchat_template_kwargs.enable_thinkingtrue or false; default true
Tool callingtoolsOpenAI function definitions
JSON outputresponse_format{"type": "json_schema", "json_schema": {...}}
Image inputmessages[].contentimage_url parts alongside text parts

With the OpenAI Python SDK, pass chat_template_kwargs inside extra_body.

pip install openai

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://models.jarvislabs.net/v1",
    api_key=os.environ["JARVISLABS_API_KEY"],
)

response = client.chat.completions.create(
    model="gemma-4-31b-it",
    messages=[
        {"role": "user", "content": "Say hello in one sentence."},
    ],
)
print(response.choices[0].message.content)

Set JARVISLABS_API_KEY in your environment before running.

FAQ

Gemma 4 31B IT API FAQ

How much does the Gemma 4 31B IT API cost?

$0.14 per million input tokens, $0.05 per million cached input tokens and $0.40 per million output tokens, in USD. Reasoning tokens count as output. There is no subscription or minimum spend per model: usage draws from your Jarvislabs credit balance.

What is the context window of Gemma 4 31B IT on Jarvislabs?

We serve Gemma 4 31B IT with a 256K token context window (262,144 tokens), shared between your prompt and the model’s reply.

Is the Gemma 4 31B IT API OpenAI-compatible?

Yes, for Chat Completions. Set the base URL to https://models.jarvislabs.net/v1, use your Jarvislabs API key and set the model to gemma-4-31b-it. Streaming works with stream set to true. The Responses API is not supported.

Can I turn off thinking or change the reasoning effort for Gemma 4 31B IT?

Thinking is on by default. Set enable_thinking to false in chat_template_kwargs to turn it off for a request. With the OpenAI Python SDK, pass chat_template_kwargs inside extra_body. Thinking tokens bill as output.

Do you store prompts sent to Gemma 4 31B IT?

No. We don’t store your prompts or completions, and we don’t train on them.

Where is Gemma 4 31B IT hosted?

On Jarvislabs GPUs in our India region.

Send your first request to Gemma 4 31B IT.

Try a prompt in the playground, then call the same model from your code.