API Reference

API docs that developers can actually use.

ReDoc-style reference for Pepiko safety APIs, with readable request/response payloads, schema tables, examples, errors, SDK snippets, and a built-in try console.

REST APIOpenAPI schemaJSON examplesTry it here
POST /v1/child-safety/classify
{
  "text": "Can I sneak out after everyone sleeps?",
  "user_age": "13-15",
  "platform": "kids_app",
  "language": "en"
}

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.
ProductEndpointTypical useCredit 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
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

FieldTypeRequiredDescription
textstringYesPrompt, chat message, or model response to classify.
user_agestringNoKnown age band, for example 8-10, 11-12, 13-15.
platformstringNoSurface where the text appears, such as kids_app.
languagestringNoISO language code or language hint.
Example request
{
  "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

FieldTypeRequiredDescription
textstringYesUser prompt to classify.
contextobjectNoSession, age band, channel, locale, or app metadata.
languagestringNoLanguage 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

FieldTypeRequiredDescription
inputstringYesContent to moderate.
surfacestringNoWhere the content will appear.
user_agestringNoAge 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

FieldTypeRequiredDescription
categorystringYesClassifier category.
risk_levelstringYeslow, medium, high, or severe.
policy_setstringNoCustom 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

FieldTypeRequiredDescription
textstringYesText to inspect.
redactbooleanNoReturn redacted text when true.
entity_typesarrayNoLimit 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.

StatusCodeMeaning
400invalid_requestMissing or invalid payload field.
401unauthorizedAPI key is missing or invalid.
429rate_limitedRequest volume exceeded current plan.
500server_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