Check a Prompt
Run a prompt or conversation through the same screen the generation endpoints use, without generating.
Use it to check your end users' prompts before you spend credits, or to power a live indicator in your own UI. Blocked prompts are never charged at generation time either; this endpoint exists so you can tell users *why* before they hit submit.
Flat price of $0.001 per call. Free when called from the SpicyAPI playground.
The screen runs three layers: a keyword blocklist, contextual pattern rules, and a semantic classifier that returns per-category probabilities. outcome is allow, review (uncertain; would be declined at generation with a request to reword) or block.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your SpicyAPI key (sk-spicy-…). Create one in the dashboard under API Keys.
Body
application/jsonProvide exactly one of input or messages.
A generation prompt (optionally with the negative prompt appended). Up to 8000 characters.
An OpenAI-style message array (system, user, assistant). The whole conversation is screened, including the system prompt.
Response
200 — application/jsonSuccessful Response
true when outcome is not allow.
allow, review or block.
The category driving the outcome: minor, real_person, non_consent, bestiality, gore, injection, keyword, or a contextual rule code.
Per-category probabilities from the semantic layer (0 to 1). Empty when a deterministic layer decided.
keyword, contextual or jev.
What this call cost.
Was this page helpful?
curl --request POST \
--url https://api.spicyapi.com/v1/moderations \
--header 'Authorization: Bearer $SPICYAPI_KEY' \
--header 'Content-Type: application/json' \
--data '{ "input": "a woman in her 30s sunbathing topless on a private beach" }'{
"object": "moderation",
"flagged": false,
"outcome": "allow",
"category": null,
"categories": {
"minor": 0.03,
"real_person": 0.01,
"non_consent": 0.02,
"bestiality": 0.0,
"gore": 0.0,
"injection": 0.01
},
"layer": "jev",
"cost_usd": 0.001
}