layahost

Perspective API alternative

53 days until Perspective shuts down

Perspective is closing.
Your code doesn’t have to.

Google shuts down the Perspective API on 31 December 2026. layahost answers the same comments:analyze call, with the same request, response and error shapes. Change the host and the key, re-check your thresholds, and keep moderating.

The change

python · googleapiclient
client = discovery.build(
    "commentanalyzer", "v1alpha1",
    developerKey=LAYAHOST_API_KEY,
    discoveryServiceUrl="https://layahost.com/$discovery/rest?version=v1alpha1",
    static_discovery=False,
)

Plain HTTP clients change commentanalyzer.googleapis.com to layahost.com and nothing else. The key can stay in ?key=.

Perspective vs layahost

Perspective APIlayahost
StatusShuts down 31 December 2026; no new projects since February 2026Available now
APIcomments:analyze, comments:suggestscoreSame methods and shapes, plus a discovery document for googleapiclient
Attributes6 production attributes plus experimental onesTOXICITY, SEVERE_TOXICITY, IDENTITY_ATTACK, INSULT, PROFANITY, THREAT, SEXUALLY_EXPLICIT
ScoresProbability that a reader finds the comment toxicThe same meaning, calibrated on the Civil Comments rater labels
PriceFree$15 per million attribute scores; $1 free credit on sign-up
HostingGoogle CloudEU (Helsinki, Finland); comment text is not stored
ModelJigsaw’s proprietary modelsLaya, open source (Apache-2.0)

Be honest with yourself about accuracy

Perspective’s models were built for exactly this job. Ours is a general decision model, prompted and calibrated for each attribute. On held-out Civil Comments data, TOXICITY reaches a ROC AUC of 0.93; all attributes are listed in the docs. The same comment will get a different number than it did on Perspective, and your best threshold will move. Score a few hundred of your own comments, compare, and pick thresholds from our scores before switching production.

We also measured layahost against OpenAI’s free moderation endpoint on the same labelled comments: OpenAI Moderation API vs layahost.

When to choose something else

What it costs

Each requested attribute is one decision. Scoring a million comments for TOXICITY is a million decisions; asking for all 7 attributes is 7 million. The Starter plan includes 1M decisions for $9 a month and Pro 10M for $49; without a plan, prepaid credit costs $15 per million. Failed requests are free. Verifying your email adds $1 to test with. See pricing.

Perspective shutdown timeline

DateWhat happens
February 2026Google stops accepting new Perspective API projects and quota increases.
31 December 2026The API shuts down. Requests to commentanalyzer.googleapis.com stop working; Google offers no migration support.
Before thenPoint your client at layahost, re-check your thresholds on a few hundred of your own comments with a test set, and switch.

Using a tool rather than your own code? Coral has a custom endpoint setting. The Discourse plugin, Stanford HELM, lm-evaluation-harness and others have Google’s address built in and need one line changed in your copy; see integrations. If yours has the Google host hard-coded, ask its maintainer to make it configurable, or write to [email protected] and we will help.

FAQ

Is layahost affiliated with Google or Jigsaw?

No. layahost is an independent service. “Perspective API” is Google’s product name, used here only to describe API compatibility.

Do you store the comments?

No. Comments are processed in memory. Logs keep the scores and metadata for 7 days, and doNotStore is honoured. Details in Data & privacy.

What about suggestscore?

It is accepted and free, so your feedback code keeps running, but nothing is stored or used for training.

Can I test before paying?

Yes. Create an account, verify your email and you get $1 of credit. No card needed.