APIDevelopersIntegration
Adding AI Image Detection to Your App in 5 Minutes
March 30, 2026 5 min readBy TruthLens AI Team
The TruthLens REST API returns the same JSON the playground shows. Authentication is a Bearer token; the body is a base64-encoded image. Pro and Enterprise plans include API access.
1. Create an API key
Sign in, open Dashboard → API keys, and click "Create new key". Copy the key immediately — it is shown only once.
2. Make a request
curl -X POST https://truthlenai.lovable.app/api/detect \
-H "Authorization: Bearer $TRUTHLENS_KEY" \
-H "Content-Type: application/json" \
-d '{ "image_base64": "<base64-png>" }'3. Handle the response
{
"verdict": "ai_generated",
"confidence": 92,
"risk_level": "high",
"suspected_model": "Midjourney v6",
"artifacts": ["melted text in background", "asymmetric earrings"],
"reasoning": ["Frequency spectrum shows strong diffusion peaks at 8 cycles/px ..."]
}4. Recommended UX patterns
- **Moderation queues**: auto-flag any verdict with confidence > 80% and risk_level high.
- **Newsroom**: surface the artifacts list to editors so they can sanity-check the verdict.
- **Marketplaces**: block uploads when verdict is ai_generated and require user confirmation otherwise.
For pricing and rate limits, see the pricing page.
Keep reading
How AI Image Detection Actually Works in 2026
A plain-English tour of the techniques behind modern AI image detectors — from diffusion-noise fingerprinting to identity-consistency checks for deepfakes.
A 7-Point Checklist for Spotting Deepfakes
Practical, no-tools-needed checks anyone can run before sharing a suspicious photo or video frame.