Skip to content

Perspective API, after December 31

Google shuts Perspective down at the end of 2026. openspective answers the same requests with the same JSON, on your own server, with open models.

Terminal window
docker run -p 8080:8080 ghcr.io/aryan-tah/openspective

Point your client at openspective instead of commentanalyzer.googleapis.com. Nothing else changes.

Terminal window
curl -s localhost:8080/v1alpha1/comments:analyze \
-H 'content-type: application/json' \
-d '{"comment": {"text": "You are a pathetic idiot."},
"requestedAttributes": {"TOXICITY": {}, "INSULT": {}}}'
{
"attributeScores": {
"TOXICITY": { "summaryScore": { "value": 0.997, "type": "PROBABILITY" }, "spanScores": [ … ] },
"INSULT": { "summaryScore": { "value": 0.995, "type": "PROBABILITY" }, "spanScores": [ … ] }
},
"languages": ["en"],
"detectedLanguages": ["en"]
}

Drop-in compatible

Same paths, fields, span offsets, error types and discovery document. Google’s own Python client works against it unchanged.

Seven attributes

TOXICITY, SEVERE_TOXICITY, IDENTITY_ATTACK, INSULT, PROFANITY, THREAT and SEXUALLY_EXPLICIT in English; TOXICITY in six more languages.

Yours to run

One container, CPU only, no network access needed at runtime. Comments never leave your servers, and nothing is stored.

Open models

Detoxify’s Apache-2.0 models, which track Perspective closely in published comparisons. No usage terms beyond Apache-2.0.