Gemma 4 API: call Gemma 4 31B, 26B A4B, and the abliterated 26B A4B Uncensored
The Morse teamPublished Facts checked 4 min read
You can call Gemma 4 through Morse's OpenAI-compatible API: point any OpenAI SDK at https://inference.trymorse.ai/v1, use a Morse key, and name one of three Gemma 4 models. Two are Google's originals, Gemma 4 31B and Gemma 4 26B A4B. The third is Gemma 4 26B A4B Uncensored, an abliterated build of the 26B A4B that answers what the originals decline, and runs only on the TEE tier, inside attested hardware.
Every Morse number below is read from the model catalog when this page is built, and every call was sent to the live API on December 3, 2026.
The three Gemma 4 models on Morse
| Gemma 4 26B A4B Uncensored | Gemma 4 31B | Gemma 4 26B A4B | |
|---|---|---|---|
| Model id | google/gemma-4-26b-a4b-uncensored | google/gemma-4-31b-it | google/gemma-4-26b-a4b-it |
| Built | Abliterated from Gemma 4 26B A4B | Google's dense model | Google's mixture-of-experts model |
| Context | 256K tokens | 256K tokens | 256K tokens |
| Longest reply | 262,144 tokens | 16,384 tokens | 16,384 tokens |
| Reads | text and images | text and images | text and images |
| Reasoning effort | "high" | "none" or "high" | "none" or "high" |
| Privacy tiers | TEE | Private | Private |
| Price | $0.175 per million input tokens and $0.85 per million output tokens | $0.25 per million input tokens and $0.50 per million output tokens | $0.15 per million input tokens and $0.60 per million output tokens |
All three take tool calls and a JSON schema in response_format.
What Google says about the two sizes
From Google's Gemma 4 31B model card, which covers the whole family: the 31B is a dense model with 30.7 billion parameters, and the 26B A4B is a mixture-of-experts model with 25.2 billion parameters, of which 3.8 billion are active for each token (8 of 128 experts, plus one shared). Both have a 256K-token context window, read images, and come under the Apache 2.0 license. Gemma 4 also adds a native system role and native function calling.
Google's own scores put the 31B ahead, and the 26B A4B close behind for far fewer active parameters:
| Benchmark (Google's card) | Gemma 4 31B | Gemma 4 26B A4B | Gemma 3 27B (no thinking) |
|---|---|---|---|
| MMLU Pro | 85.2% | 82.6% | 67.6% |
| LiveCodeBench v6 | 80.0% | 77.1% | 29.1% |
| Codeforces Elo | 2150 | 1718 | 110 |
| GPQA Diamond | 84.3% | 82.3% | 42.4% |
| Tau2, tool use over several turns | 76.9% | 68.2% | 16.2% |
These are Google's figures for its originals. We haven't rerun them, and the uncensored build isn't in Google's table.
Which Gemma 4 to call
- Gemma 4 26B A4B Uncensored for the four kinds of work the Morse API is built for: cybersecurity (test, monitor, and defend your systems without safety filters blocking real security work), agent security (stress-test your AI agents to identify prompt injection, jailbreak, and tool misuse vulnerabilities), AI and ML research, and training data (build training sets, eval suites, and classifiers for sensitive data that other models refuse to write). One reply can run to 262,144 tokens, so a long transcription or a whole generated dataset comes back in one piece. Its full guide is Gemma 4 26B A4B Uncensored.
- Gemma 4 31B for Google's strongest Gemma 4 scores on everyday work.
- Gemma 4 26B A4B when you want Gemma 4 with few active parameters per token.
Call it with a JSON schema
Gemma 4 is often used to pull structure out of text and images, so this call asks for a security finding as JSON that must match a schema. Swap the model id to switch between the three.
import json, os
from openai import OpenAI
morse = OpenAI(api_key=os.environ["MORSE_API_KEY"], base_url="https://inference.trymorse.ai/v1")
finding = {
"type": "json_schema",
"json_schema": {
"name": "finding",
"strict": True,
"schema": {
"type": "object",
"additionalProperties": False,
"required": ["vulnerability", "cwe", "severity", "fix"],
"properties": {
"vulnerability": {"type": "string"},
"cwe": {"type": "string"},
"severity": {"type": "string", "enum": ["low", "medium", "high", "critical"]},
"fix": {"type": "string"},
},
},
},
}
route = '''@app.route("/user")
def user():
uid = request.args.get("id")
return db.execute(f"SELECT * FROM users WHERE id = {uid}").fetchall()'''
reply = morse.chat.completions.create(
model="google/gemma-4-26b-a4b-uncensored",
response_format=finding,
messages=[{"role": "user", "content": "Review this Flask route and report the finding.\n\n" + route}],
)
print(json.loads(reply.choices[0].message.content))
We sent this request to each model on December 3, 2026. All three returned JSON that matched the schema and named CWE-89, SQL injection:
| Model | Reasoning effort sent | Time | Reasoning tokens |
|---|---|---|---|
| Gemma 4 26B A4B Uncensored | high (its only effort) | 6.6 seconds | 583 |
| Gemma 4 31B | none | 1.7 seconds | 0 |
| Gemma 4 26B A4B | none | 1.7 seconds | 0 |
To add a picture, put an image_url part with a base64 data URI in the message content. Morse doesn't fetch links on your behalf. The API docs cover streaming, tools, and images.
Use it in a coding agent
Gemma 4 26B A4B Uncensored takes tool calls on the TEE tier, so it can drive Claude Code or Codex with a key held to TEE. We ran Codex with it on December 3, 2026, with model_context_window = 262144 and model_auto_compact_token_limit = 196608 in ~/.codex/config.toml, and it fixed a SQL injection in a Flask file on its own. Codex always sends parallel_tool_calls, and this model accepts it. The general guides are Claude Code and Codex, and the model's own guide is Gemma 4 26B A4B Uncensored.
Who can read what you send
It runs in attested hardware enclaves, under zero-data-retention terms. No AI provider trains on what you send through Morse (privacy policy). Google's originals run on the Private tier. For what each tier lets the provider and Morse see, read the privacy page.
Paying for it
The API runs on prepaid credits you add in the console, with no subscription, and the same key calls every model on Morse. Get an API key and send the call above.
Common questions
Is there a Gemma 4 API?
Yes. Google publishes Gemma 4's weights, and hosts serve them over an API. On Morse, three Gemma 4 models answer at https://inference.trymorse.ai/v1 with one Morse key: Gemma 4 31B, Gemma 4 26B A4B, and Gemma 4 26B A4B Uncensored.
Is there an uncensored Gemma 4?
Yes. Gemma 4 26B A4B Uncensored is an abliterated build of Gemma 4 26B A4B: the direction in the weights that makes it decline was removed, so it answers instead. Its id is google/gemma-4-26b-a4b-uncensored.
Can I turn off Gemma 4's thinking?
On Google's originals, yes: on Morse, Gemma 4 31B and Gemma 4 26B A4B take a reasoning effort of "none" or "high", so set reasoning_effort to none. Gemma 4 26B A4B Uncensored always thinks, at an effort of "high".
Does the Gemma 4 API return JSON?
Yes. All three Gemma 4 models on Morse take a response_format with a JSON schema. We sent the same schema to each on December 3, 2026, and each answered with JSON that matched it.