Perspective API Shutdown: How to Migrate Before December 31, 2026

Google's Jigsaw team is shutting down Perspective API. The official notice says the service stays active until December 31, 2026, and stops after that. Jigsaw stopped taking new usage and quota requests in February 2026, and it does not offer migration support.
If your product sends comments, chat messages or forum posts to Perspective, every call fails from January 1, 2027. This guide shows how to find each place that calls Perspective, how to choose a replacement, and how to move your code without letting toxic content through on the day of the switch.
What stops working on January 1
Perspective has one main endpoint, comments:analyze. A typical call sends the text and asks for one or more attributes, such as TOXICITY. For each attribute, Perspective answers with a probability, and your code compares that probability with a threshold such as 0.8.
When the service stops, that request fails. What happens next depends on your error handling:
- Fail open. Your code treats an error as "not toxic" and publishes the content. Nothing looks broken, but nothing is checked.
- Fail closed. Your code holds every item for review when the call fails. Your moderation queue fills up at once.
- Crash. Your code reads
attributeScoresfrom an error response and throws. Posting breaks for every user.
Find out which of these your code does before the deadline, not after it.
Step 1: Find every place that calls Perspective
Perspective calls often live outside your own code: in a plugin, a comment platform or an old script. Check all of these:
- Search your code. Look for
commentanalyzer.googleapis.com,comments:analyze,perspectiveapi,PERSPECTIVE_API_KEYand client libraries with "perspective" in their name. - Check your platform settings. Comment and forum platforms such as Coral and Discourse have Perspective integrations that are turned on in an admin page, not in your code.
- Check plugins. WordPress and forum plugins for "toxic comments" often call Perspective in the background.
- Check your Google Cloud project. The Perspective API key belongs to a Google Cloud project. The API metrics for that project show if something still sends requests, even if nobody remembers what it is.
- Check scheduled jobs. Backfill scripts, analytics notebooks and data pipelines sometimes score old comments in batches.
Write each place in a list, with an owner and the attributes it requests.
Step 2: Save data to calibrate the replacement
No replacement gives the same scores as Perspective. Before the deadline, save a sample from your own platform:
- a few thousand recent items, with the Perspective score for each attribute that you use
- the final moderator decision for each item, such as approved, removed or edited
With this sample you can test a replacement on your own content. You can see how many items it flags that your moderators approved, and how many items it misses that your moderators removed. Then you can set your rules from real data, not from guesses.
Step 3: Choose a replacement
Use these questions to compare the options:
- Categories. Perspective's production attributes are
TOXICITY,SEVERE_TOXICITY,IDENTITY_ATTACK,INSULT,PROFANITYandTHREAT. Make sure the replacement covers each attribute that you use. Many teams also need categories that Perspective never had, such as spam, self-harm or personal data. - Scores or decisions. Some tools return scores that you compare with your own thresholds. Others return a yes or no decision for each category. Scores give more control. Decisions remove the work of tuning a threshold.
- Languages. Check each language that your community writes in. Support differs a lot between tools.
- Where the text goes. A hosted API sends user text to another company. A self-hosted model keeps the text on your own servers, which can matter for privacy rules and for customer contracts.
- Failure behaviour. Read the error codes. Know which errors you can retry and which errors need a person.
- Price. Compare the cost at your real monthly volume, not at the free tier.
Check each vendor's current documentation for these details. They change often.
Step 4: Map your attributes
Write down what each attribute that you use becomes in the new tool. A typical mapping looks like this:
TOXICITYbecomes a general toxicity category.INSULTbecomes harassment or insult.IDENTITY_ATTACKbecomes hate.THREATbecomes violence or threat.PROFANITYbecomes profanity.SEVERE_TOXICITYusually has no direct match. Many teams replace it with a combination of hate, violence and harassment.
If you used experimental attributes, check each one separately. Most tools have no direct match for them.
Step 5: Run both services side by side
Do not switch all traffic on one day. First run the new tool in "shadow mode": your product still acts on the Perspective result, and it also sends the same text to the new tool and only records the answer.
async function moderate(comment) {
const perspective = await checkWithPerspective(comment.text);
// Shadow call: record the result, but never act on it yet.
checkWithNewTool(comment.text)
.then((candidate) => logComparison(comment.id, perspective, candidate))
.catch((error) => logShadowError(comment.id, error));
return perspective;
}After a week, compare the two results with your moderators' decisions. Look at two numbers for each category that you use:
- Extra flags. Items that the new tool flags and your moderators approved. Too many of these fill your review queue and annoy good users.
- Misses. Items that the new tool passes and your moderators removed. Too many of these let harmful content through.
Read a sample of the items in each group, not only the counts. A pattern, such as missed sarcasm or flagged quotes from news articles, tells you which rules to change. When the numbers are acceptable, move a small share of traffic first, such as one section of your site, then the rest.
Step 6: Plan for failures during the switch
Every moderation service fails sometimes. Decide what happens before it does:
- Set a timeout. Do not let a slow moderation call block a user who is posting. Pick a timeout that your product can accept.
- Retry only the errors that can succeed later. Retry server errors and "try again later" answers with a short backoff. Do not retry an error that says that the request is wrong or that the key is not valid. Fix those instead.
- Choose fail open or fail closed for each surface. A children's chat should usually fail closed and hold messages. A comment section on a news article can often publish and check the comment again later.
- Check again later. If a check fails, put the item in a queue and check it again when the service answers. Then nothing stays unchecked.
- Alert a person. Send an alert when the error rate goes up, so that a failure does not run for days without anyone seeing it.
Moving from Perspective to CautionLabs
CautionLabs is a text moderation API with twelve categories: toxic, profanity, hate, harassment, self-harm, adult, violence, drugs, weapons, PII, spam and minor. It returns true or false for each category and a top-level flagged field, so there are no thresholds to tune. The model is built for English text.
A typical Perspective call in JavaScript looks like this:
const url = `https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key=${process.env.PERSPECTIVE_API_KEY}`;
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
comment: { text },
languages: ['en'],
requestedAttributes: { TOXICITY: {} },
doNotStore: true,
}),
});
const data = await response.json();
if (data.attributeScores.TOXICITY.summaryScore.value >= 0.8) {
holdForReview(comment);
}The same check with CautionLabs:
const response = await fetch('https://api.cautionlabs.com/moderation', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CAUTIONLABS_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ text }),
});
if (!response.ok) {
// Decide here: fail open or fail closed. See the error codes in the docs.
throw new Error(`Moderation failed with status ${response.status}`);
}
const { categories } = await response.json();
if (categories.toxic || categories.harassment || categories.hate) {
holdForReview(comment);
}And in Python:
import os
import requests
response = requests.post(
"https://api.cautionlabs.com/moderation",
headers={"Authorization": f"Bearer {os.environ['CAUTIONLABS_API_KEY']}"},
json={"text": text},
timeout=30,
)
response.raise_for_status()
categories = response.json()["categories"]
if categories["toxic"] or categories["harassment"] or categories["hate"]:
hold_for_review(comment)Some details to know before you switch:
- Text length. One request accepts 1 to 10,000 characters. A text over 3,000 characters is checked in pieces, and a flag in any piece flags the whole text.
- Errors. Errors return a
codeand amessage. A503with the codemodel_startingmeans that the model is starting after a quiet period. Retry after the number of seconds in theRetry-Afterheader. No credits are charged for it. - Price. The cloud API costs $0.40 USD per 1,000 requests of up to 3,000 characters, paid as you go.
If user text must stay on your own servers, the same model runs on your infrastructure. It is one Docker container that answers POST /moderate on your own host, and it needs no internet connection after the download. It is a one-time purchase of $299 USD with no per-request charge. The on-premises guide explains the install, including air-gapped servers.
Your migration checklist
- List every place that calls Perspective, with an owner for each.
- Find out if each one fails open, fails closed or crashes when the call fails.
- Save a sample of recent content with its Perspective scores and moderator decisions.
- Choose a replacement and map each attribute that you use.
- Run the replacement next to Perspective for a week, and compare the results with your moderators' decisions.
- Switch the traffic, and watch your moderation queue closely for the first days.
- Remove the Perspective calls, delete the Perspective API key and turn off the API in your Google Cloud project.
Frequently asked questions
Can I keep using Perspective after December 31, 2026?
No. The official notice says that access cannot be extended past the final date. Plan to have your replacement in production before then.
Will a replacement give the same scores as Perspective?
No. Each tool is trained on different data and defines its categories in its own way. This is why Step 2 and Step 5 matter: test the replacement on your own content, and set your rules from your moderators' decisions.
What happens to my thresholds?
It depends on the tool. If the replacement returns scores, choose new thresholds from your saved sample. Do not copy your Perspective thresholds, because the same number means something different in another model. If the replacement returns a decision for each category, your threshold code becomes a check of the categories that you care about.
What about comments in other languages?
Check the language support of each tool against the languages of your community. If a tool does not support a language, do not publish that content unchecked. Send it to human review, or use a second tool for that language.
Do I need to update my privacy policy?
If your privacy policy or your data processing agreements name Google or Perspective, update them when you change vendor. If you choose a self-hosted model, the text no longer goes to a third party. Ask your legal team what to change.
Which integration should I move first?
Start with the place that handles the most content or the most sensitive content. A plugin that nobody owns is the biggest risk, because nobody will notice when it stops working. Give each one an owner in Step 1.
Start now. A side-by-side test needs a working Perspective API to compare with, and that ends on December 31, 2026.