Migration Steps
Our Perspective replacement API is as close as we can reasonably get to a drop-in replacement. For most Perspective migrations, the work is straightforward. You keep the same general request and response model: attributes etc are present. The main changes are the URL and authentication.
This page covers the practical part: what to replace, what headers to send, and what to test before you switch traffic over.
What to Replace
Perspective comment analysis becomes:
POST /v0.2/perspective-compat/analyse
Perspective score correction becomes:
POST /v0.2/perspective-compat/suggestscore
Authentication
Perspective commonly used an API key in the URL. Respectify uses headers instead:
X-User-Email: your@email.com
X-API-Key: your-api-key
Example: Comment Analysis
Before (Perspective):
curl -X POST \
"https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"comment": {"text": "Your comment here"},
"requestedAttributes": {"TOXICITY": {}, "INSULT": {}},
"spanAnnotations": true
}'
After (Respectify):
curl -X POST https://app.respectify.ai/v0.2/perspective-compat/analyse \
-H "Content-Type: application/json" \
-H "X-User-Email: your@email.com" \
-H "X-API-Key: your-api-key" \
-d '{
"comment": {"text": "Your comment here"},
"requestedAttributes": {"TOXICITY": {}, "INSULT": {}},
"spanAnnotations": true
}'
Example: Score Correction
Before (Perspective):
curl -X POST \
"https://commentanalyzer.googleapis.com/v1alpha1/comments:suggestscore?key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"comment": {"text": "Your comment here"},
"attributeScores": {
"TOXICITY": {
"summaryScore": {"value": 0.1}
}
}
}'
After (Respectify):
curl -X POST https://app.respectify.ai/v0.2/perspective-compat/suggestscore \
-H "Content-Type: application/json" \
-H "X-User-Email: your@email.com" \
-H "X-API-Key: your-api-key" \
-d '{
"comment": {"text": "Your comment here"},
"attributeScores": {
"TOXICITY": {
"summaryScore": {"value": 0.1}
}
}
}'
What To Test Before You Ship
- common attributes you already depend on, such as
TOXICITY,INSULT, andPROFANITY - span handling, if your UI uses spans directly
- language fields, if your integration sends or reads them
- any thresholds tied to rarer or approximate attributes such as
LIKELY_TO_REJECTorUNSUBSTANTIAL - score corrections, if you use
suggestscore
The language point is especially worth checking. Currently, we have no special language handling and this inital version of the API is English-based. If you send languages, Respectify preserves them, but takes no special action. If you do not send languages, Respectify does not claim language detection.
In all cases, the response falls back to an English-oriented default moderation context. While a comment that is being moderated can be in any language, the moderation guidelines do reflect Western norms.