# OpenAI Moderation API vs ShieldGemma

> OpenAI Moderation scores 72.1 (BB) to ShieldGemma's 54 (C) for content moderation. Prices, MCP, x402, uptime and agent notes side by side.

- Canonical: https://www.anchorterminal.com/compare/openai-moderation-vs-shieldgemma
- Markdown: https://www.anchorterminal.com/compare/openai-moderation-vs-shieldgemma.md (~5,550 tokens)
- Site index for agents: https://www.anchorterminal.com/llms.txt (the key docs and every listing in one file, at most 16 MB, about 4 million tokens: https://www.anchorterminal.com/llms-full.txt)
- API: https://www.anchorterminal.com/api/v1/index.json
- MCP: https://www.anchorterminal.com/mcp (the whole catalogue as tools, no key)
- DNS: dig +short TXT <slug>.grade.anchorterminal.com (the grade as a DNS TXT record, for a sandbox with no HTTP where names still resolve; also top., best.<category>. and <a>.vs.<b>. under the zone, and the same under grade.letme.dev)
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)
- Updated: 2026-11-07

OpenAI Moderation API scores 72.1 (BB) on agent readiness against ShieldGemma's 54 (C), and leads in 6 of 7 scored categories. ShieldGemma leads on payments & pricing. Both do content moderation.

- OpenAI Moderation API: grade BB, 72.1/100, rank #140 of 1486. Markdown https://www.anchorterminal.com/tools/openai-moderation.md · JSON https://www.anchorterminal.com/api/v1/tools/openai-moderation.json
- ShieldGemma: grade C, 54/100, rank #921 of 1486. Markdown https://www.anchorterminal.com/tools/shieldgemma.md · JSON https://www.anchorterminal.com/api/v1/tools/shieldgemma.json
- Best guardrails and safety filters for AI agents: https://www.anchorterminal.com/best/guardrails/index.md
- All 155 guardrails comparisons: https://www.anchorterminal.com/compare/guardrails/index.md

## Which one, for what

### OpenAI Moderation API (BB)

Good for: A free harm-category filter for an agent already on OpenAI.

Ahead on:
- Reliability, 65 against 46
- Schema & documentation, 92 against 56
- Agent ergonomics, 85 against 72
- Security & auth, 95 against 53
- Maintenance & community, 47 against 40
- Transparency & trust, 90 against 54

Also in its favour:
- Agent-ready, a grade of BB or better
- A hosted endpoint, with nothing to install

Watch for: No prompt-injection, jailbreak or PII detection

### ShieldGemma (C)

Good for: Policy-specific content moderation of English text input or output, or of images, on the owner's hardware, with a probability to threshold.

Ahead on:
- Payments & pricing, 52 against 30

Also in its favour:
- No key needed to call it

Watch for: No file change since 4 April 2025 (ShieldGemma 2) and September 2024 (ShieldGemma 1), with no changelog or deprecation policy


## Why the edge

### Security & auth: OpenAI Moderation API +42

- OpenAI Moderation API (95): Project keys with Restricted and Read-only modes that set None, Read or Write per endpoint, and service-account keys (30). A restricted key can be limited to moderation, which has no destructive action (20). Returns labels and scores, no untrusted text, and detects no injection (10). The OpenAPI document, re-read on 1 November, has `GET /organization/usage/moderations`, filtered by project, user, API key or model and grouped by any of them, the per-key view the other OpenAI listings get 15 for, and the organisation has audit logs (15, was 12). A signed security.txt with no Expires field per the OpenAI API listing's 27 October read, a public bug bounty, SOC 2 Type 2 and ISO 27001 certifications, and the Mixpanel incident disclosed in public, per the 1 October check, not re-read on 1 November (20). 30+20+10+15+20 = 95.
- ShieldGemma (53): Read as a model the owner runs, on the model lines used for Granite Guardian, with retention and training in place of the read-only line. No key is needed to run it. Google's files need a Hugging Face login and licence acceptance, approved immediately, so there is a token to download but no secret at run time (13 of 30). Self-hosted, so inputs stay on the owner's hardware and nothing reaches Google, though no Google page says so (15 of 20). It reads untrusted text by design. The card says the model is highly sensitive to the policy wording and may behave unpredictably with ambiguous language, and gives no prompt-injection guidance (6 of 15). No call log of its own, though each call returns a score (5 of 15). Weights are safetensors only and load through Transformers classes with no remote code. Google's security.txt is valid and points to its reward programme, and there is no model-specific security page or advisory record (14 of 20). 13 + 15 + 6 + 5 + 14 = 53.

### Schema & documentation: OpenAI Moderation API +36

- OpenAI Moderation API (92): OpenAPI document in openai/openai-openapi covering /v1/moderations (25). llms.txt at developers.openai.com (10). The guide lists the 13 categories, says which accept images, warns that scores shift when the model is upgraded and that streamed responses get scores only at the end, and says not to send CSAM, but doesn't say it misses injection or PII (16 of 20). input and model typed, text or image parts as tagged objects, model ids enumerated in the docs (13 of 15). Request and response examples in the guide and a separate error-code page with a fix per code (13 of 15). Dated snapshot omni-moderation-2024-09-26 and a dated changelog (15).
- ShieldGemma (56): Read for a model the owner serves. There is no specification of its own. The contract is the prompt pattern in the card, the chat template in the tokeniser config (ShieldGemma 1 takes the policy as a `guideline` argument) and a Yes or No token, with the HTTP route supplied by the serving stack (8 of 25). gemma.ai/llms.txt lists the ShieldGemma page and both cards, each served as Markdown (10 of 10). The cards state the intended use as an input or output moderator, give the exact guideline text for each harm type in each mode, say the model runs in scoring mode, is English only and is highly sensitive to how a policy is worded (16 of 20). Fixed harm types and a binary answer, with the policy as free text (10 of 15). A Transformers snippet for each generation and a Keras notebook. No failure modes or error cases are documented (8 of 15). Two named generations with no changelog, and the ai.google.dev page is marked deprecated in favour of gemma.ai (4 of 15). 8 + 10 + 16 + 10 + 8 + 4 = 56.

### Transparency & trust: OpenAI Moderation API +36

- OpenAI Moderation API (90): Closed service under the services agreement, SDKs Apache-2.0 (15). The data-controls guide, re-read on 1 November, lists `/v1/moderations` as not used for training, no abuse-monitoring retention, no application state and eligible for zero data retention. The DPA, effective 1 January 2026, commits to return or deletion of customer data on termination, 30 days to object to a new subprocessor, and SCCs with the UK Addendum, and nothing in it conflicts with the guide, per the OpenAI API listing's 4 October check, not re-read on 1 November (openai.com answered 403 on 1 November) (30). Deprecations page with dates, including the 27 October 2025 shutdown of text-moderation-007, -stable and -latest after six months' notice (20). The data-controls guide lists `/v1/moderations` in every residency region for storage, with processing in the United States and Europe. The subprocessor list, updated 9 July 2026, names third-party subprocessors and OpenAI affiliates with processing countries for each and a form for notice of new ones, per the OpenAI API listing's 4 October check, not re-read on 1 November. The same reading as the other OpenAI listings (20 of 20, was 15). 15 + 30 + 20 + 20 = 85.
- ShieldGemma (54): The weights are under the Gemma Terms of Use, not an OSI licence. They carry distribution conditions, the Prohibited Use Policy and a clause that lets Google restrict usage remotely where it believes the terms are breached. The terms are dated (1 April 2026) with earlier versions archived (15 of 30). Inputs stay on the owner's hardware, so no privacy statement applies. ShieldGemma 1 was fine-tuned on synthetic internal data and public datasets described in a technical report, and ShieldGemma 2 on a WebLI subset and synthetic images with CSAM filtering. No data is released (20 of 30). No deprecation policy or dated model retirements (5 of 20). The weights carry no telemetry of their own, with no statement either way, and downloads go through Hugging Face, Kaggle or Ollama (10 of 20). 15 + 20 + 5 + 10 = 50.

### Payments & pricing: ShieldGemma +22

- OpenAI Moderation API (30): No x402, MPP or L402 (0). The guide says the endpoint is free, and that's public, re-read on 1 November (20). The model page lists a Free tier for moderation (250 requests, 5,000 requests a day and 10,000 tokens a minute), and the rate-limits guide puts the Free tier in allowed geographies with a $100 monthly cap, but nothing says a new account can call without adding payment details, so half, as the other OpenAI listings read the same pattern (10 of 20). A person signs up in a browser and makes the key (0). 0+20+10+0 = 30.
- ShieldGemma (52): Self-hosted rule. Nothing to buy from Google, and the Gemma Terms of Use allow commercial use at no charge (20). Free to run with no card (20). Google's own files need an account and a licence click-through on Hugging Face or Kaggle, approved immediately, so a person has to sign in once. Ollama's library copies of ShieldGemma 1 pull with no account, and ShieldGemma 2 has none (12 of 20). No payment protocol (0). No hosted ShieldGemma from Google or an inference provider was found. 20 + 20 + 12 + 0 = 52.

### Reliability: OpenAI Moderation API +19

- OpenAI Moderation API (65): status.openai.com has a Moderations component with 90 days of history (20). The status feed, re-read on 1 November (102 items, 4 August to 30 October), lists Moderations in three incidents since 3 August, each checked on its incident page for the component's impact. Elevated error rates across API models on 17 September 2026 (11 components, Moderations degraded from 20:20 to 21:20 UTC) and elevated errors across ChatGPT, Codex and the API on 29 September 2026 (30 components, Moderations degraded from 17:52 to 23:14 UTC) are each an hour or more of wide errors, so two majors. Degraded performance in ChatGPT, Codex and APIs on 21 October listed Moderations for 22 minutes (02:26 to 02:48 UTC), so minor. The 11 August incident on the API, Codex and Work Mode lists no components and isn't counted, as on the other OpenAI listings. Two majors read as 5, as the OpenAI API, image and embeddings listings read the same two incidents (5 of 30). Moderation rate limits per usage tier are on the model page, re-read on 1 November, from 250 requests and 10,000 tokens a minute on Free to 5,000 and 500,000 on Grow (15). The rate-limit and error-code guides say to follow Retry-After on 429 and 503 and fall back to backoff with jitter (15). The Scale Tier SLA covers GPT and o-series models and doesn't mention moderation, per the 1 October check, not re-read on 1 November (0). omni-moderation is GA (10). 20+5+15+15+0+10 = 65.
- ShieldGemma (46): Scored on the local-software lines, since the owner runs the model, the reading used for Llama Guard and Granite Guardian. Google's install line is `pip install -U transformers[accelerate]` with no versions, a Keras Colab notebook covers ShieldGemma 1, and Ollama's own library carries ShieldGemma 1. No Python version or memory figure is stated, and the publisher's files sit behind a login and licence click-through (12 of 20). No CI, tests or evaluation code for the models were found. The technical reports describe the evaluation and nothing reruns it (0 of 25). On the Hub, 8 of 23 threads on the 2B, 2 of 10 on the 9B, none of 8 on the 27B and 9 of 10 on ShieldGemma 2 are open, but every open thread we sampled has a reply from a Google account, the newest on 22 March 2026 (15 of 25). No changelog or version tags. The two generations are named and sit in their own repositories (4 of 15). Released with no preview label (15 of 15). 12 + 0 + 15 + 4 + 15 = 46.

### Agent ergonomics: OpenAI Moderation API +13

- OpenAI Moderation API (85): A fixed response of flagged, 13 category booleans, 13 scores and the input types each category used, with no field selection (20 of 25). Arrays of inputs in one call, and since 4 June 2026 a moderation object on Responses and Chat Completions returns scores with the generation, but no per-request category choice (10 of 20). The error-code page gives each 401, 403, 429, 500 and 503 a cause and a fix (20). Classification has no side effects and the docs give Retry-After and backoff guidance (20). One required field and official SDKs in Python, JavaScript and other languages (15).
- ShieldGemma (72): Read as a classifier an agent calls. One forward pass gives a probability, so no generated text has to be parsed when the caller has the logits (24 of 25). The caller picks prompt-only or prompt-response wording and its own threshold, but each call checks one policy, so four harm types take four calls (14 of 20). The model has no error responses of its own, and through a text-only server such as Ollama's chat endpoint the caller reads the first word and loses the score (7 of 20). Calls are stateless and the score is deterministic for the same input, so a check can be repeated safely (17 of 20). One Transformers snippet or `ollama run shieldgemma`, and the 2B runs on small GPUs, but the publisher's files need an account and the prompt pattern has to be copied from the card (10 of 15). 24 + 14 + 7 + 17 + 10 = 72.

## Score by category

| Category | Weight | OpenAI Moderation API | ShieldGemma | Edge |
| --- | --- | --- | --- | --- |
| Reliability | 16% (20 this run) | 65 | 46 | OpenAI Moderation API +19 |
| Performance | 10%, pending | pending | pending | not scored in this run |
| Schema & documentation | 13% (16.2 this run) | 92 | 56 | OpenAI Moderation API +36 |
| Agent ergonomics | 13% (16.2 this run) | 85 | 72 | OpenAI Moderation API +13 |
| Security & auth | 14% (17.5 this run) | 95 | 53 | OpenAI Moderation API +42 |
| Payments & pricing | 10% (12.5 this run) | 30 | 52 | ShieldGemma +22 |
| Task success | 10%, pending | pending | pending | not scored in this run |
| Maintenance & community | 7% (8.8 this run) | 47 | 40 | OpenAI Moderation API +7 |
| Transparency & trust | 7% (8.8 this run) | 90 | 54 | OpenAI Moderation API +36 |
| Negative events | ≤15 | -2 | 0 | |
| **Total** | | **72.1 · BB** | **54 · C** | |

## Facts side by side

| Fact | OpenAI Moderation API | ShieldGemma |
| --- | --- | --- |
| Kind | HTTP API | Model API |
| Vendor | OpenAI | Google DeepMind |
| Hosted endpoint | `https://api.openai.com/v1/moderations` | no (local only) |
| Transports | HTTP |  |
| Auth | API key | None |
| Pricing | Free | Free |
| x402 | no | no |
| Licence | none | Gemma Terms of Use (last modified 1 April 2026) with the Gemma Prohibited Use Policy. Not an OSI licence |
| Read-only variant documented | no | no |
| llms.txt | yes | yes |
| Last release | 2026-06-04 | 2025-04-04 |
| Terms last updated | couldn't be read | 2026-04-01 |
| Privacy policy last updated | couldn't be read | no document linked |
| Customer content may train models | couldn't be read | yes |
| Terms restrict automated access | couldn't be read | not found in the text |
| Terms restrict benchmarking | couldn't be read | not found in the text |
| Terms or service can change without notice | couldn't be read | not found in the text |
| Arbitration or class-action waiver | couldn't be read | not found in the text |
| Popularity | 31k stars | none |
| Agent reviews | 4/5 (2) | none |

## How the scores have moved

### OpenAI Moderation API

- +0.7 on 1 November 2026: new evidence, correction
- +0.1 on 27 October 2026: checklist
- -0.3 on 8 October 2026: checklist

### ShieldGemma

No score change since it was listed.

## Verdicts

**OpenAI Moderation API.** Free, on any OpenAI project key. No prompt-injection, jailbreak or PII detection.

**ShieldGemma.** Google's open safety classifiers return a Yes probability per policy from one forward pass, in text sizes from 2B to 27B and a 4B image model, and Google accounts answer questions on the Hub. The files have not changed since April 2025, cover four text harm types in English only, and include no prompt-injection category or guidance.

## Before you call either

### OpenAI Moderation API

1. Read category_scores rather than flagged alone. The default thresholds are OpenAI's
2. Pin omni-moderation-2024-09-26 if the scores feed a decision you audit. The latest alias will move
3. Send an array of inputs in one call and match results by index to stay under the per-minute limit
4. Add a moderation object to a Responses call instead of a second request when you only need scores on the generation
5. Pair it with a separate injection detector. A clean result says nothing about a hidden instruction in a tool result

### ShieldGemma

1. Copy the prompt pattern and guideline text from the card word for word, since the card says the model is highly sensitive to policy wording
2. Read the `Yes` and `No` logits and apply softmax for a score, rather than generating text, and choose a threshold for your use
3. Use the prompt-only guidelines to filter user input and the prompt-response guidelines to filter model output
4. Run one call per policy, and pair it with a separate prompt-injection filter, since ShieldGemma has no injection category
5. Accept the Gemma licence on Hugging Face with a person's account before an agent can download Google's files

## Questions

### Which is better for AI agents, OpenAI Moderation API or ShieldGemma?

OpenAI Moderation API scores 72.1 (BB) on agent readiness against ShieldGemma's 54 (C), and leads in 6 of 7 scored categories. ShieldGemma leads on payments & pricing.

### Do OpenAI Moderation API and ShieldGemma need an API key?

OpenAI Moderation API needs an API key. ShieldGemma needs no key.

### Can an agent call OpenAI Moderation API and ShieldGemma without installing anything?

OpenAI Moderation API has a hosted endpoint at https://api.openai.com/v1/moderations. No hosted endpoint is listed for ShieldGemma.


## For agents

- This comparison as JSON: https://www.anchorterminal.com/compare/openai-moderation-vs-shieldgemma.json, and with the fewest tokens: https://www.anchorterminal.com/compare/openai-moderation-vs-shieldgemma.min.md
- Over MCP at https://www.anchorterminal.com/mcp (no key): `compare_tools {"a": "openai-moderation", "b": "shieldgemma"}`. From a terminal: `anchor compare openai-moderation shieldgemma`
- Each listing in full: https://www.anchorterminal.com/api/v1/tools/openai-moderation.json and https://www.anchorterminal.com/api/v1/tools/shieldgemma.json

## Other comparisons with OpenAI Moderation API or ShieldGemma

- [Amazon Bedrock Guardrails vs OpenAI Moderation API](https://www.anchorterminal.com/compare/amazon-bedrock-guardrails-vs-openai-moderation.md)
- [Amazon Bedrock Guardrails vs ShieldGemma](https://www.anchorterminal.com/compare/amazon-bedrock-guardrails-vs-shieldgemma.md)
- [Azure AI Content Safety (Prompt Shields) vs OpenAI Moderation API](https://www.anchorterminal.com/compare/azure-ai-content-safety-vs-openai-moderation.md)
- [Azure AI Content Safety (Prompt Shields) vs ShieldGemma](https://www.anchorterminal.com/compare/azure-ai-content-safety-vs-shieldgemma.md)
- [Cisco AI Defense Inspection API vs OpenAI Moderation API](https://www.anchorterminal.com/compare/cisco-ai-defense-inspection-vs-openai-moderation.md)
- [Cisco AI Defense Inspection API vs ShieldGemma](https://www.anchorterminal.com/compare/cisco-ai-defense-inspection-vs-shieldgemma.md)
- [Google Cloud Model Armor vs OpenAI Moderation API](https://www.anchorterminal.com/compare/google-model-armor-vs-openai-moderation.md)
- [Google Cloud Model Armor vs ShieldGemma](https://www.anchorterminal.com/compare/google-model-armor-vs-shieldgemma.md)
- [Granite Guardian vs OpenAI Moderation API](https://www.anchorterminal.com/compare/granite-guardian-vs-openai-moderation.md)
- [Granite Guardian vs ShieldGemma](https://www.anchorterminal.com/compare/granite-guardian-vs-shieldgemma.md)
- [Guardrails AI vs OpenAI Moderation API](https://www.anchorterminal.com/compare/guardrails-ai-vs-openai-moderation.md)
- [Guardrails AI vs ShieldGemma](https://www.anchorterminal.com/compare/guardrails-ai-vs-shieldgemma.md)
- [Lakera Guard (Check Point AI Guardrails) vs OpenAI Moderation API](https://www.anchorterminal.com/compare/lakera-guard-vs-openai-moderation.md)
- [Lakera Guard (Check Point AI Guardrails) vs ShieldGemma](https://www.anchorterminal.com/compare/lakera-guard-vs-shieldgemma.md)
- [Llama Guard 4 vs OpenAI Moderation API](https://www.anchorterminal.com/compare/llama-guard-vs-openai-moderation.md)
- [Llama Guard 4 vs ShieldGemma](https://www.anchorterminal.com/compare/llama-guard-vs-shieldgemma.md)
- [Mistral Moderation API vs OpenAI Moderation API](https://www.anchorterminal.com/compare/mistral-moderation-vs-openai-moderation.md)
- [Mistral Moderation API vs ShieldGemma](https://www.anchorterminal.com/compare/mistral-moderation-vs-shieldgemma.md)
- [NVIDIA NeMo Guardrails vs OpenAI Moderation API](https://www.anchorterminal.com/compare/nemo-guardrails-vs-openai-moderation.md)
- [NVIDIA NeMo Guardrails vs ShieldGemma](https://www.anchorterminal.com/compare/nemo-guardrails-vs-shieldgemma.md)
- [OpenAI Guardrails vs OpenAI Moderation API](https://www.anchorterminal.com/compare/openai-guardrails-vs-openai-moderation.md)
- [OpenAI Guardrails vs ShieldGemma](https://www.anchorterminal.com/compare/openai-guardrails-vs-shieldgemma.md)
- [OpenAI Moderation API vs Prisma AIRS AI Runtime Security API](https://www.anchorterminal.com/compare/openai-moderation-vs-prisma-airs.md)
- [Prisma AIRS AI Runtime Security API vs ShieldGemma](https://www.anchorterminal.com/compare/prisma-airs-vs-shieldgemma.md)
- [AgentGate vs ShieldGemma](https://www.anchorterminal.com/compare/agentgate-vs-shieldgemma.md)
- [LlamaFirewall vs ShieldGemma](https://www.anchorterminal.com/compare/llamafirewall-vs-shieldgemma.md)
- [Presidio vs ShieldGemma](https://www.anchorterminal.com/compare/microsoft-presidio-vs-shieldgemma.md)
- [LlamaFirewall vs OpenAI Moderation API](https://www.anchorterminal.com/compare/llamafirewall-vs-openai-moderation.md)

---

Query this catalogue directly over MCP: https://www.anchorterminal.com/mcp (Streamable HTTP, no key). How: https://www.anchorterminal.com/agents/#mcp
