API documentation
One endpoint. Send text, get a risk assessment. Auth with an API key from your dashboard.
Authentication
Pass your key as a bearer token or x-api-key header. Keys are scoped to your plan's monthly quota and rate-limited to 60 requests/minute.
Authorization: Bearer gg_live_xxxxxxxxxxxxxxxx
POST/api/v1/scan
Request body
{
"text": "We guarantee 100% returns, risk-free!", // required, ≤ 50000 chars
"brand": { // optional
"voice": "warm, concise, professional",
"facts": "We ship only in India. Refunds within 7 days.",
"context": "D2C skincare brand"
},
"rulesOnly": false // optional, skip the AI pass
}Response
{
"riskScore": 58, // 0 (safe) .. 100 (do-not-publish)
"verdict": "block", // "pass" | "review" | "block"
"findings": [
{
"category": "unsafe_advice",
"code": "unsafe.financial_guarantee",
"severity": 3, // 1 low · 2 medium · 3 high
"title": "Guaranteed return / financial promise",
"detail": "SEBI prohibits assured-return claims…",
"snippet": "guarantee 100% returns",
"start": 3, "end": 26,
"suggestion": "Remove the guarantee. State market risk.",
"source": "rule"
}
],
"counts": { "pii": 0, "hallucination": 0, "unsafe_advice": 1, "tone": 0, "compliance": 0 },
"redline": "We [[risk:unsafe.financial_guarantee|guarantee 100% returns]], risk-free!",
"quota": { "used": 142, "limit": 5000, "plan": "growth" }
}Example: gate your publish flow
const res = await fetch("https://guardrail.aiskillhub.info/api/v1/scan", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.GUARDRAIL_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ text: aiReply, brand: { facts: KNOWN_FACTS } }),
});
const report = await res.json();
if (report.verdict === "block") {
await flagForHumanReview(aiReply, report.findings);
} else {
await publish(aiReply);
}Status codes
200— scan completed.400— invalid body.401— missing or invalid API key.402— monthly quota reached; upgrade.429— rate limit (60/min) exceeded.