Overview
Pepiko APIs use standard HTTP methods, Bearer token authentication, and JSON request/response bodies.
Base URL: https://api.pepiko.ai. All examples below are safe local examples for the static HTML package.
Product Endpoint Typical use Credit unit
Child Safety Classification /v1/child-safety/classifyClassify child-safety risk and policy bucket. 1 request credit
Prompt Classifier /v1/prompt/classifyClassify intent, context, and risk before generation. 1 request credit
Moderation API /v1/moderationModerate user-generated or model-generated content. 1 request credit
Policy Route /v1/policy/routeMap classifier output to product actions. 0.5 request credits
PII Detection /v1/pii/detectDetect and optionally redact personal data. 1 request credit
Authentication
Send your API key in the Authorization header. Start building, sign in, and sign up actions route to the hosted platform.
Header Copy
Authorization: Bearer pk_live_xxx
Content-Type: application/json
Safety classification Child Safety Classification Classify age-sensitive risk, confidence, flags, and recommended product action.
POST /v1/child-safety/classify
Request schema Field Type Required Description textstring Yes Prompt, chat message, or model response to classify. user_agestring No Known age band, for example 8-10, 11-12, 13-15. platformstring No Surface where the text appears, such as kids_app. languagestring No ISO language code or language hint.
Example request Copy
{
"text": "How can I sneak out of my house at night?",
"user_age": "13-15",
"platform": "kids_app",
"language": "en"
}Example response
{
"category": "child_safety",
"risk_level": "high",
"policy_bucket": "blocked",
"recommended_action": "refuse_and_redirect",
"flags": ["unsafe_action", "needs_guardian_support"],
"confidence": 0.97
}
Intent routing Prompt Classifier Classify intent, ambiguity, risk pattern, and policy-relevant context before generation.
POST /v1/prompt/classify
Request schema Field Type Required Description textstring Yes User prompt to classify. contextobject No Session, age band, channel, locale, or app metadata. languagestring No Language hint.
Example request
{
"text": "Can you explain this scary story safely?",
"context": { "platform": "ai_tutor", "age_band": "11-12" },
"language": "en"
}Example response
{
"intent": "explain",
"category": "education",
"risk_level": "low",
"needs_clarification": false,
"confidence": 0.94
}
Content decision Moderation API Moderate user-generated and model-generated content across chat, comments, creative tools, and classrooms.
POST /v1/moderation
Request schema Field Type Required Description inputstring Yes Content to moderate. surfacestring No Where the content will appear. user_agestring No Age context when available.
Example request
{
"input": "You should sneak out after everyone sleeps.",
"surface": "chatbot_response",
"user_age": "13-15"
}Example response
{
"category": "safety_hazard",
"risk_level": "high",
"policy_bucket": "blocked",
"recommended_action": "redirect_to_safe_advice",
"confidence": 0.96
}
Policy routing Policy Route Map classification results to product-specific response actions, escalation rules, and review queues.
POST /v1/policy/route
Request schema Field Type Required Description categorystring Yes Classifier category. risk_levelstring Yes low, medium, high, or severe.policy_setstring No Custom policy set ID.
Example request
{
"category": "child_safety",
"risk_level": "high",
"policy_set": "kids_app_default"
}Example response
{
"policy_bucket": "blocked",
"recommended_action": "refuse_and_redirect",
"review_required": false,
"reason": "High-risk child-safety scenario"
}
Privacy PII Detection Detect personal or sensitive information and optionally return a redacted version.
POST /v1/pii/detect
Request schema Field Type Required Description textstring Yes Text to inspect. redactboolean No Return redacted text when true. entity_typesarray No Limit detection to selected entity types.
Example request
{
"text": "My email is child@example.com",
"redact": true
}Example response
{
"contains_pii": true,
"entities": [
{ "type": "email", "text": "child@example.com", "start": 12, "end": 29 }
],
"redacted_text": "My email is [EMAIL]"
}
Errors Errors are returned as JSON with a machine-readable code and a human-readable message.
Status Code Meaning 400 invalid_requestMissing or invalid payload field. 401 unauthorizedAPI key is missing or invalid. 429 rate_limitedRequest volume exceeded current plan. 500 server_errorTemporary server-side issue.
Error response
{
"error": {
"code": "invalid_request",
"message": "Field 'text' is required.",
"request_id": "req_123"
}
}
SDK snippets 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 API reference.
Open schema
Try it here
Preview payloads and responses directly on the page. This static demo validates JSON locally and does not send network requests.
Endpoint Child Safety Classification Prompt Classifier Moderation API Policy Route PII Detection
API key
JSON payload
Reset payload Send demo request
{
"category": "child_safety",
"risk_level": "high",
"policy_bucket": "blocked",
"recommended_action": "refuse_and_redirect",
"confidence": 0.97
}