Jev Case Study: Spam Comment Detection (Full Code)

Updated Applies to Jev 1.13 Example fixture

TL;DR: This Jev example runs spam comment detection as a single judgment question on Jev 1.13. A yes above your confidence threshold auto-hides the comment; anything lower goes to the moderation queue. Full request body, example-fixture response, and a copy-paste curl command below.

Scenario

Our engineering blog accepts comments under every post. Every few weeks a spam wave hits — replica-watch ads, casino links, SEO gibberish that names the article topic once and then pivots to a discount site. Keyword filters catch the lazy ones; anything with light obfuscation (“best-deals-now dot club”) sails through, and the team wastes a morning cleaning up.

The fix is deliberately boring: one Jev judgment call per comment, at ingestion time, before the comment is ever shown.

This is exactly the shape of problem Jev is built for: a judgment question (yes / no / unclear) with a typed JSON answer and a confidence value, not a chat reply that has to be parsed out of prose. Jev is TypeSafe AI’s System One judgment model, released September 2026; this example runs it through the OpenRouter OpenAI-compatible endpoint.

One design note: we do not ask the model to write anything. The question is fixed, the answer space is fixed, and the confidence score is what the gate is built on.

Request

{
  "model": "typesafe/jev-1.13",
  "messages": [
    {
      "role": "system",
      "content": "Judgment question. Is this comment spam? Answer yes, no, or unclear. Reply with JSON only: {\"answer\": <yes|no|unclear>, \"confidence\": <0-1>, \"rationale\": <one sentence>}"
    },
    {
      "role": "user",
      "content": "Great article! Also check best-deals-now dot club for 90% off designer bags, fast shipping worldwide!!!"
    }
  ]
}

Response

Example fixture — illustrative output, not a live capture:

{
  "answer": "yes",
  "confidence": 0.97,
  "rationale": "The comment promotes an external discount site, uses urgency and punctuation patterns typical of spam, and has no substantive relation to the article topic."
}

The only fields the gate needs are answer and confidence. The rationale goes straight into the moderation audit log so a reviewer can confirm the auto-hide in one glance.

Reproduce

Set OPENROUTER_API_KEY and run:

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "typesafe/jev-1.13",
    "messages": [
      {
        "role": "system",
        "content": "Judgment question. Is this comment spam? Answer yes, no, or unclear. Reply with JSON only: {\"answer\": <yes|no|unclear>, \"confidence\": <0-1>, \"rationale\": <one sentence>}"
      },
      {
        "role": "user",
        "content": "Great article! Also check best-deals-now dot club for 90% off designer bags, fast shipping worldwide!!!"
      }
    ]
  }'

The JSON body of the response arrives inside the standard OpenAI-compatible chat completion structure; parse the message content as JSON to get the fields above.

Key parameters

FieldValueWhy it matters
modeltypesafe/jev-1.13Pin the version. Confirm the exact slug on the OpenRouter model page — slugs can change between releases.
messages[0] (system)Judgment question + answer space + JSON shapeDeclaring yes/no/unclear up front keeps the typed output stable instead of hoping the model guesses the format.
messages[1] (user)The raw commentPass the comment unmodified; pre-cleaning can strip the very signals Jev uses.
answer (response)yesThe gate decision: yes + high confidence → auto-hide.
confidence (response)0.97 (example fixture)The threshold input. Tune it on your own moderation history, not on ours.
rationale (response)One sentenceFree audit trail for every auto-hide decision.
Price$0.0462 per 1M input tokensOne short call per comment; verify current pricing on OpenRouter before budgeting.

Notes

Keep reading