jevrecipes

Recipe catalog / age-appropriateness

Grade audience age suitability

age-appropriateness is a Jev recipe from the jev-recipes TypeScript package. What is the youngest general audience for which content is appropriate, on a five-level rubric? Use it when you need to route, filter, or label user-generated or model-generated content by audience age before publishing it.

Last updated .

Explore this recipe interactively · Source and implementation guide · Markdown version

How do I use age-appropriateness in TypeScript?

Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.

import { ageAppropriateness } from 'jev-recipes/age-appropriateness';

const result = await ageAppropriateness({
  "content": "The two friends raced their bikes down the hill, laughing as the wind whipped past. At the bottom, Maya skidded and scraped her knee, but she grinned and said it was the best ride ever.",
  "context": "Short story submitted to a reading app for young readers.",
  "minConfidence": 0.8
});
console.log(result);

What input does age-appropriateness take?

FieldTypeNeeded
contentstringRequired
contextstringOptional
minConfidencenumberOptional
Full input and result schemas
{
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "content": {
        "type": "string"
      },
      "context": {
        "type": "string"
      },
      "minConfidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "required": [
      "content"
    ]
  },
  "result": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "model": {
        "type": "string"
      },
      "usage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "output_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "input_tokens",
          "output_tokens"
        ],
        "additionalProperties": false
      },
      "status": {
        "type": "string",
        "enum": [
          "ready",
          "review"
        ]
      },
      "score": {
        "type": "number",
        "minimum": 0
      },
      "level": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "probabilities": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      },
      "rating": {
        "type": "string",
        "enum": [
          "everyone",
          "children",
          "teens",
          "mature",
          "adults"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "score",
      "level",
      "confidence",
      "probabilities",
      "rating"
    ],
    "additionalProperties": false
  }
}

What does a age-appropriateness result look like?

This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo age-appropriateness.

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "score": 0.21,
  "level": 0,
  "confidence": 0.82,
  "probabilities": {
    "0": 0.82,
    "1": 0.15,
    "2": 0.03,
    "3": 0,
    "4": 0
  },
  "rating": "everyone"
}

Input

See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas. context is optional and is omitted from the request when absent.

Result

rating is one of everyone, children, teens, mature, or adults, taken from the most likely rubric level. level is that level's index from 0 to 4. score is Jev's expected value across the rubric and can fall between levels; use it to order content for review or to pick a conservative cutoff.

A result is ready when confidence meets minConfidence. Otherwise it is review and still carries the graded values. probabilities is keyed by level index.

Reuse and calls

Uses the shared score helper. This folder owns the audience question, the rubric wording, and the review policy. A live invocation makes one logical Jev request.

Limits

This is not a legal or regulatory rating. The rubric approximates common content-rating conventions and does not replace an official classification board, a platform's published standards, or local law. It grades themes, language, and depictions as written and does not judge quality, accuracy, or whether the content breaches a specific policy; use policy-severity for that. Application code maps levels to publishing rules and decides how to treat review results.

Example input

demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo age-appropriateness shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe age-appropriateness to inspect the input and result schemas.

How accurate is age-appropriateness?

Fixture only

No verified live accuracy measurement is available. Evaluate representative cases before using this decision in your workflow.

Use the evaluation guide to measure this decision on your own labeled cases.

What are the limits of age-appropriateness?