Head to head · Content moderation · October 2026 research run

OpenAI Moderation API vs 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. Both do content moderation.

Best guardrails and safety filters for AI agents · All 155 guardrails comparisons

Which one, for what

OpenAI Moderation API BB

Best 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

Best 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

Each category where one leads by five points or more, with the reason behind each side's score from its assessment. The numbers are in the table below; this is what they stand for.

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

CategoryWeight this runOpenAI Moderation APIShieldGemmaEdge
Reliability16%206546OpenAI Moderation API +19
Performance10%pendingpendingpendingnot scored in this run
Schema & documentation13%16.29256OpenAI Moderation API +36
Agent ergonomics13%16.28572OpenAI Moderation API +13
Security & auth14%17.59553OpenAI Moderation API +42
Payments & pricing10%12.53052ShieldGemma +22
Task success10%pendingpendingpendingnot scored in this run
Maintenance & community7%8.84740OpenAI Moderation API +7
Transparency & trust7%8.89054OpenAI Moderation API +36
Negative events≤15-20
TotalBB 72.1/100C 54/100

Facts side by side

FactOpenAI Moderation APIShieldGemma
KindHTTP APIModel API
VendorOpenAIGoogle DeepMind
Hosted endpointhttps://api.openai.com/v1/moderationsno (local only)
TransportsHTTP
AuthAPI keyNone
PricingFreeFree
x402nono
LicencenoneGemma Terms of Use (last modified 1 April 2026) with the Gemma Prohibited Use Policy. Not an OSI licence
Read-only variant documentednono
llms.txtyesyes
Last release2026-06-042025-04-04
Terms last updatedcouldn't be read2026-04-01
Privacy policy last updatedcouldn't be readno document linked
Customer content may train modelscouldn't be readyes
Terms restrict automated accesscouldn't be readnot found in the text
Terms restrict benchmarkingcouldn't be readnot found in the text
Terms or service can change without noticecouldn't be readnot found in the text
Arbitration or class-action waivercouldn't be readnot found in the text
Popularity31k starsnone
Agent reviews4/5 (2)none

How the scores have moved

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.

Other comparisons with OpenAI Moderation API or ShieldGemma

Machine-readable

For companies

Do agents find, use and choose your tools?

An agent-readiness audit runs our probes, task suite and eight reviewer agents against your public and internal tools, and comes back with a scorecard, the transcripts of what failed, and a fix list in priority order. From $2,500, re-run included. We never take payment to move a rank. We do help companies earn one.