Classify content and return a policy decision in a single call. Bundles risk classification and policy routing for prompts or model responses, using the same taxonomy and policy buckets as the Risk Classification API.
POST/v1/classify
Request schema
Field
Type
Required
Description
input
string
Yes
Content to moderate.
surface
string
No
Where the content will appear.
user_age
string
No
Age context when available.
Example request
{
"input": "You should sneak out after everyone sleeps.",
"surface": "chatbot_response",
"user_age": "13-15"
}
Use the REST API directly or start with JavaScript/TypeScript and Python SDK patterns.
JavaScript / TypeScript
import { Pepiko } from "pepiko-sdk";
const pepiko = new Pepiko({ apiKey: process.env.PEPIKO_API_KEY });
const result = await pepiko.childSafety.classify({
text: "Can I sneak out after everyone sleeps?",
user_age: "13-15"
});
console.log(result.policy_bucket);
Python
from pepiko import Pepiko
client = Pepiko(api_key="pk_live_xxx")
result = client.child_safety.classify(
text="Can I sneak out after everyone sleeps?",
user_age="13-15"
)
print(result["policy_bucket"])
OpenAPI schema
The static package includes an OpenAPI-style JSON file you can import into tooling.
assets/openapi.json
Endpoint paths, schemas, and example responses for the pepiko.ai API reference.