ClarityLens AI – API Docs

A developer-friendly API for analyzing text bias, tone, emotion & clarity – powered by OpenAI + Perspective.

🔗 Base URL

All requests are POST:

https://claritylensai.com/api/

Content-Type must be application/x-www-form-urlencoded

🔑 Authentication

Free: no key (limit = 10/day)

Pro: pass your API key as key in request body.

{
  "text": "Your text here",
  "key": "paid_api_key"
}

🌟 /clarity-insight.php

Returns emotional tone + clarity score

{
  "success": true,
  "data": {
    "insight": "Core Emotion: Frustration\nClarity Score: 86/100"
  }
}

📊 /bias-graph.php

Returns toxicity, threat, insult, profanity etc using Perspective API

{
  "success": true,
  "data": {
    "TOXICITY": 26.3,
    "INSULT": 10.1
  }
}

🛠️ /rephrase.php

Returns reworded version with reduced bias or harshness

{
  "original": "You're stupid",
  "rephrased": "I think there's a misunderstanding we can clear up"
}

🧠 /ai-insight.php

Returns AI judgment on emotional tone & risk

{
  "insight": "The message contains confrontational language and passive aggression."
}

🔍 /clarify.php

Master API = Insight + Bias Score + Rewrite

{
  "success": true,
  "data": {
    "original": "You're trash",
    "rephrased": "That wasn't helpful and I expected better",
    "bias_comparison": {
      "TOXICITY": {
        "original": 92.5,
        "rephrased": 6.3
      }
    }
  }
}

Need help? Email hello@claritylensai.com