Overview
Verifieddit uses Sightengine for AI-generated content detection. The API determines whether an image was likely generated by AI (DALL-E, Midjourney, Stable Diffusion, etc.) and returns a confidence score.
API Credentials
| Credential | Pass Store Path |
|---|---|
| API User | pass sightengine/api-user |
| API Secret | pass sightengine/api-secret |
API Usage
Direct API Call
| |
Response Format
| |
ai_generated> 0.5: Likely AI-generatedai_generated< 0.5: Likely real photo
Via Upload (Binary)
| |
Rate Limits
Free Tier
- 500 operations/month
- No burst rate limit
- All models available
Enterprise API Key
- Higher monthly quota (check current plan)
- Priority processing
- Dedicated support
Monitoring Quota Usage
| |
Check the response for:
usage.operations_used– Operations consumed this billing periodusage.operations_limit– Total operations availableusage.reset_date– When the quota resets
Integration Points
Badges Worker (Primary)
The Cloudflare badges worker proxies AI detection requests to avoid exposing credentials to the client:
Browser -> /api/ai-detect -> Badges Worker -> api.sightengine.com
Worker secrets:
SIGHTENGINE_API_USERSIGHTENGINE_API_SECRET
Stripe Backend (Secondary)
The stripe backend can also proxy AI detection for authenticated users:
Authenticated Client -> /ai-detect -> Stripe Backend -> api.sightengine.com
Caching Strategy
To minimize API calls and stay within quota:
- Hash-based deduplication: Before calling Sightengine, check if the image hash already has a cached result in D1
- Store results: After each API call, store the result in D1 keyed by image hash
- TTL: AI detection results don’t change for a given image, so cache indefinitely
D1 Cache Query
| |
If a result exists, skip the Sightengine API call.
Upgrading to Enterprise
If the free tier quota is exhausted:
- Contact Sightengine for enterprise pricing
- Obtain new API credentials
- Update pass store:
1 2pass edit sightengine/api-user pass edit sightengine/api-secret - Update all consumers (see Secret Rotation SOP)
Troubleshooting
- Empty response: Quota may be exhausted. Check usage with the account endpoint.
- 403 Forbidden: API credentials are incorrect or expired. Verify with a direct
curltest. - Slow responses: Sightengine may have regional latency. The API is US-hosted.
- False positives: Some photos with heavy filters or editing may trigger AI detection. The
ai_generatedscore is probabilistic, not definitive.