Source: https://ailoot.ai/models/en/google-gemma-4-31b-it-u003a-free/
Canonical: https://ailoot.ai/models/en/google-gemma-4-31b-it-u003a-free/
Language: en

# Google: Gemma 4 31B (free)

[Markdown](https://ailoot.ai/models/en/google-gemma-4-31b-it-u003a-free/index.md) · [JSON](https://ailoot.ai/models/en/google-gemma-4-31b-it-u003a-free/facts.json)

## [Google: Gemma 4 31B (free)](https://ailoot.ai/models/en/google-gemma-4-31b-it-u003a-free/)

Gemma 4 31B IT is Google’s instruction-tuned dense model for text and visual reasoning. Its 256K context, configurable thinking, image understanding and native function calling support coding, document and agent tasks with text output.

- [**Ailoot Ultra · OpenAI Chat** `POST /v1/chat/completions` `google/gemma-4-31b-it:free`](https://ailoot.ai/models/en/google-gemma-4-31b-it-u003a-free/#method-0)

About the model

This description covers the model’s capabilities. Available in Ailoot inputs, outputs and options are listed for the selected method below.

Gemma 4 31B IT is Google DeepMind’s instruction-tuned dense edition of the open Gemma 4 family. Google positions the 31B model around model quality and adaptation for a task, while the separate 26B A4B edition uses a mixture of experts for inference efficiency. This card concerns the named instruction-tuned 31B edition rather than its pretrained weights or a quantized derivative.

The official dense architecture table lists 30.7 billion parameters, 60 layers, a 1,024-token sliding window and a 256K-token context. The family combines local sliding-window attention with global attention, ending with a global layer, and uses a dedicated visual encoder for this model. The resulting profile is built for text and image input with text output. These are model architecture facts; they do not fix an application’s response time or imply the audio support of other Gemma 4 sizes.

Its 256K-token context supports a task that combines substantial text with visual evidence. Images and text can be interleaved in one prompt; the manufacturer recommends placing image content before the related text for best results. Visual tasks include object detection, document-page interpretation, screen and interface understanding, charts, multilingual OCR, handwriting and pointing. The output is text: extracted content, an explanation, code or a proposed tool action.

Configurable thinking lets the model reason before answering or give a direct answer. Gemma 4 adds a native system role alongside user and assistant roles. Google’s prompt format enables thinking with the \<|think|\> control token in the system prompt and separates the thought channel from the final answer; its documented processor can handle that template. For a multi-turn conversation, keep previous final answers in the history and exclude prior thoughts except in tool-call turns, where the manufacturer says they should be preserved.

Native Function Calling supports structured tool use, and Google’s launch description also documents structured JSON output. Define the task, the available function and the expected result; the application performs the requested operation and returns its output for the next step. A coding task can ask for generation, completion or correction, while a visual assistant can use the returned text to explain a chart or screen. A function-call instruction is distinct from a connected action that has actually executed.

Variable image resolution is controlled by the visual token budget. The documented options are 70, 140, 280, 560 and 1,120 tokens. Lower budgets suit classification or captions; higher budgets preserve more detail for OCR, document parsing and small text, with additional computation. Decide whether you need the overall scene or exact lettering before preparing the image. A clear crop of a label can be more useful to an extraction task than an unqualified request to inspect every detail of a full page.

Google recommends temperature 1.0, top-p 0.95 and top-k 64 as the family’s sampling configuration. The model card distinguishes training in more than 140 languages from out-of-the-box support in more than 35 languages. State the answer language and retain domain names, field names or formulas explicitly in the brief. The 256K figure is a context specification; the cited model card does not establish a separate universal maximum-output figure for this edition.

For a document-and-code assignment, supply the relevant page image, the written requirement and the source fragment: “Read the labels, explain how this screen differs from the specification and propose a focused correction to the provided code.” For a chart, ask the answer to separate visible values from an inferred trend. Gemma’s model card notes limits involving ambiguous language, very complex tasks and incorrect or outdated factual statements, so attach the authoritative facts that the requested result must use rather than expecting training knowledge to supply them.

Through Ailoot, select this exact model ID in /v1/chat/completions and supply the task in messages. Each message carries a role and its content; keep the relevant instruction and source material together. Collect the complete JSON response or all SSE segments when stream is enabled, and retain usage with the written result.

**Ailoot Ultra · OpenAI Chat** `POST /v1/chat/completions` `google/gemma-4-31b-it:free`

[`google/gemma-4-31b-it:free`](https://ailoot.ai/models/en/#m=google%2Fgemma-4-31b-it%3Afree&route=Ultra&caller=google%2Fgemma-4-31b-it%3Afree&fmt=chat)

Google /`google/gemma-4-31b-it:free`

### Overview

Gemma 4 31B IT is Google’s instruction-tuned dense model for text and visual reasoning. Its 256K context, configurable thinking, image understanding and native function calling support coding, document and agent tasks with text output.

Accepted inputs

Text · Images

Results

Text

### Available in Ailoot · inputs & methods

**Ailoot Ultra · OpenAI Chat** `POST /v1/chat/completions`

Input types

`text`, `image`

Output types

`text`

Output format

JSON or SSE

| Field | Type | Requirement | Values & limits | Default |
| --- | --- | --- | --- | --- |
| Field`model` | Type`string` | RequirementRequired | Values & limits google/gemma-4-31b-it:free Conditions: Use this exact Ailoot routing selector. | Default— |
| Field`messages` | Type`array` | RequirementRequired | Values & limits Conditions: | Default— |
| Field`stream` | Type`boolean` | RequirementOptional | Values & limits Conditions: | Defaultfalse |

Input material combinations

**text\_input** · Required: messages

**image\_with\_text** · Required: messages with actual image content blocks

Method parameters and lifecycle

| Parameter | Contract |
| --- | --- |
| Parameter`content_type` | Contractapplication/json |
| Parameter`required` | Contractmodel, messages |
| Parameter`optional` | Contractstream |
| Parameter`material_types` | Contracttext, image |
| Parameter`conditions` | ContractUse this exact Ailoot routing selector., Image content is carried by this protocol where the exact selected model supports vision. Protocol admission does not establish image capability for every model. |

Method aliases: `/chat/completions`

Lifecycle: `synchronous_or_streamed`

### Pricing

Tariff references do not add request options. Supported parameters are listed for the selected method.

Fast mode

Standard rate When fast mode is selected

Flex mode

Standard rate When flex mode is selected

Maximum reasoning effort

Standard rate When maximum reasoning effort uses the default adjustment

Explicit cache pricing

Not enabled When explicit cache is requested

Text-only zero rates

Cache, tools and media follow their separately listed pricing conditions. For text-only input and output

#### Ailoot rates

#### Prices by configuration

| Configuration | Rate schedule | Charge |
| --- | --- | --- |
| ConfigurationBase token rates | Rate scheduleBase rate | Charge Input · Input tokens **$0** / 1K tokens Output · Output tokens **$0** / 1K tokens Input · Cache read **—** / 1K tokens Input · Cache write **—** / 1K tokens Input · Cache write, 1 hour **—** / 1K tokens |

Ailoot reserves an estimated amount before a request. After the result, it settles the final charge from measured usage. Streaming settlement uses the final usage record. [How reservation and settlement work →](https://ailoot.ai/docs/en/billing/reserve/)

### Example requests

#### Ailoot Ultra · OpenAI Chat

curl · create once and retain the complete result

```bash
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "google/gemma-4-31b-it:free", "messages": [{"role": "user", "content": "Explain how a rainbow forms."}]}')

Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
# Submit once. Retain the complete result, original identifiers and every response header.
```

### Receive and save results

#### Ailoot Ultra · OpenAI Chat

JSON or SSE

##### Keep all completed results

Keep every complete returned response, file and content part.

Retain every content block, tool-call ID, thinking signature when returned, all SSE deltas and complete usage. A first text fragment is not the whole result.

##### If the original response needs checking

Keep the original X-Client-Request-ID, response and headers. An unknown or result\_pending\_check outcome does not authorize a second creation.

Response fields

| Field | Type |
| --- | --- |
| Field`choices[]` | Typeobject |
| Field`usage` | Typeobject |

Errors and next steps

| Response | Condition | Next step |
| --- | --- | --- |
| Response400 · `invalid_request_error` | ConditionA required field, model selector, type or input representation is invalid. | Next stepInspect the returned validation detail before preparing a separate request. |
| Response`` | ConditionThe original request or result is unknown or requires a check. | Next stepKeep original identifiers and headers; read only supported status/library records. Do not submit creation again. |

### Aliases

#### Model aliases

**Ailoot Ultra** [`google/gemma-4-31b-it:free`](https://ailoot.ai/models/en/#m=google%2Fgemma-4-31b-it%3Afree&route=Ultra&caller=google%2Fgemma-4-31b-it%3Afree&fmt=chat)

#### Method path aliases

`/chat/completions`

#### Related caller IDs

[`google/gemma-4-31b-it:free`](https://ailoot.ai/models/en/#m=google%2Fgemma-4-31b-it%3Afree&route=Ultra&caller=google%2Fgemma-4-31b-it%3Afree&fmt=chat)

FAQ · Google: Gemma 4 31B (free)

What inputs and results are available?

`POST /v1/chat/completions` · `google/gemma-4-31b-it:free`: `text`, `image` → `text`

Which fields does the request use?

`POST /v1/chat/completions` · `google/gemma-4-31b-it:free`: `model`, `messages`, `stream`

Connect Ailoot to Claude Code, OpenCode, Hermes or your own app.

## The company and its project portfolio

The company and its project portfolio: millions of customers; monthly sales in the billions.

## Buy tokens at a discount.

Subscription discounts for regular use. Promo codes offer up to 50% off token purchases.

Subscription

Choose a discounted plan for your regular requests.

Promo code: up to 50% off

Enter your code at checkout. The price updates to reflect the current promotion.

Spending in your history

The model, tokens and amount are recorded for each request.

[Choose a subscription](https://ailoot.ai/docs/en/billing/subscriptions/) · [View model prices](https://ailoot.ai/models/en/)

## Connect the API to a product you sell.

Use Ailoot in SaaS, apps and bots under its official service offer and licence agreement. Request a reseller licence for resale.

Commercial application

Add text, image, video and audio generation to paid features in your service.

Reseller licence

Send a description of your project and how you provide access. Request written terms for use and resale.

Documents on the website

The service offer, licence agreement and data processing policy are available before you connect.

[Request a reseller licence](mailto:support@ailoot.ai) · [Service offer and licence agreement](https://ailoot.ai/legal/offer?lang=en)

## Ailoot · The company and its project portfolio





Ailoot combines established operating experience, a large client base, stable service and ongoing KPI control.





The company and its project portfolio: millions of customers; monthly sales in the billions.





Ailoot brings that operating experience to API access for AI features in customer products, agents, applications and automations.
