The Moderation API is required for all merchants running AI image or video
generation products on Creem. Every user-supplied prompt that will be routed
to an image or video generation model must be screened through this endpoint
before generation happens.
Why moderation matters
Running generative AI products carries real risk — for your users, for your business, and for the payments infrastructure underneath it. The Moderation API exists to protect your platform from unforeseen consequences: policy-violating content, high-risk chargebacks, processor escalations, and reputational damage that can follow a single bad generation. We are proud to offer a safe and inclusive environment for a wide range of AI products, and we want you to thrive on Creem. Correctly integrating the Moderation API is not just a compliance checkbox — it is directly for your own benefit. Merchants who route generative AI traffic without upstream screening risk:- Violation of Creem’s Terms of Service
- Permanent removal from the platform
- Frozen funds held against chargeback and risk exposure
- Loss of processor relationships that are difficult to recover
How it works
The Moderation API evaluates a text prompt against Creem’s content policies and returns a decision. Your application calls the Moderation API before sending the prompt to your image or video model, and uses the decision to route traffic:1
User submits a prompt
A user types a prompt in your application and hits Generate.
2
Your backend calls the Moderation API
Before anything else, your server sends the prompt to
POST /v1/moderation/prompt.3
Moderation returns a decision
The API responds with
allow, flag, or deny.4
You route based on the decision
On
allow, pass the prompt to your model. On deny, block the request
and surface a friendly error to the user. On flag, decide based on your
own risk policy (see below).The endpoint
Screen a prompt
POST /v1/moderation/prompt — full request and response schema.Request
Response
Decision values
The endpoint is currently marked experimental in the OpenAPI spec. The
decision values above are stable, but additional fields may be added in the
future. Design your integration to ignore unknown fields rather than fail on
them.
Integration guide
1. Add moderation to your generation handler
The rule is simple: no prompt reaches your model without a decision from the Moderation API first. Put the call at the very top of your generation handler, before any queueing, billing, or model invocation.2. Choose an environment
Moderation is available on both environments:
Use sandbox while building and testing your routing logic. Move to production
once you are confident your handler blocks on both
deny and flag.
3. Treat flag as a block
A flag decision means the prompt was not explicitly denied, but Creem is
closely monitoring it. We recommend treating flag exactly like deny —
block the request and surface an error to the user. This keeps your
integration simple and keeps your account on the safe side of the line.
4. Fail closed, not open
If the Moderation API call fails (network error, timeout, unexpected 5xx), do not fall back to generating anyway. Treat failures as a temporary block and return an error to the user. Failing open defeats the entire purpose of the control and will be treated as a policy violation.5. Screen the prompt, not the output
Moderation is designed for pre-generation prompt screening. The correct place to call it is before your model runs, on the raw user input. Do not skip screening because you plan to inspect the output afterwards — by the time the output exists, you have already spent compute on disallowed content and the risk event has already occurred.End-to-end example
A minimal Next.js API route that gates an image generation model behind the Moderation API:app/api/generate/route.ts
Verify your integration is live
Before requesting a review or re-review, confirm your Moderation API calls are reaching Creem’s production servers - not just sandbox. Working in sandbox alone does not satisfy the requirement.1
Use a production API key
Production keys start with
creem_ - not creem_test_. Check that your environment variables and deployed app are using a live key.2
Send a test call against production
Run this from your terminal to confirm calls reach production:A successful response returns a moderation decision. If you get an authentication error, your key is wrong or missing.
3
Trigger a real production call from your product
Submit a prompt through your actual product in production mode, then verify that the moderation call is made before any image or video generation call goes out.
Error: “Content moderation is not configured”
If you see this error, the most likely causes are:Sandbox and production are fully separate. A working sandbox integration does not mean your production integration is active.
Checklist before going live
1
Every generation path calls the Moderation API
Audit every code path that can reach your image or video model. There
should be no way to generate without a preceding moderation call.
2
`deny` always blocks generation
Confirm with a test prompt that a
deny decision returns an error to the
user and never reaches your model.3
`flag` also blocks generation
Confirm a
flag decision is treated the same as deny and never reaches
your model.4
Moderation failures fail closed
Simulate a moderation timeout or 5xx and confirm no generation happens.
Keep your usage efficient
Billing is proportional to the text you send, so a few integration habits can cut your bill by half or more without weakening screening:- Screen the user-supplied text, not your templates. If your product wraps user input in a reusable style or system template, screen only the part the user controls — your own static boilerplate bills units on every call.
- Screen incrementally, not cumulatively. For chat-style products, screen each new user message as it arrives. Re-submitting the entire conversation history on every turn re-bills everything you already screened.
- Don’t add instructions for the moderator. The Moderation API applies
Creem’s content policies and does not accept custom policies or
instructions embedded in the prompt. A policy preamble inflates your bill
on every call, and explicit category language inside it can itself trigger
denydecisions on otherwise harmless requests. - Avoid very large payloads. Extremely large requests cannot be screened
reliably and may return
flagrather than a real decision.
Pricing
Moderation API usage is billed at $0.30 USD per 1,000 units. A unit covers up to 1,000 characters of screened text, with a one-unit minimum per call. Theusage.units field on every response tells you exactly what a call cost.
How billing works:
- Fees are deducted from your payouts as a separate line item (“Moderation API usage fee”) covering the units you screened since your previous payout. There is no separate invoice and nothing is charged to a card.
- Repeated prompts are free. Screening results are cached — submitting a
prompt identical to a recently screened one returns the cached decision and
bills
0units. - Usage from the experimental phase (before May 1, 2026) was never billed, as promised.
Related
Screen a prompt — API Reference
Full request and response schema for
POST /v1/moderation/prompt.Account Reviews
How Creem reviews merchants and what keeps your account in good standing.