layahost

Perspective API alternative

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$5 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.92; 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.

When to choose something else

What it costs

Each requested attribute is one decision. Scoring a million comments for TOXICITY costs $5; asking for all 7 attributes costs $35. Credit is prepaid, never expires, and failed requests are free. Verifying your email adds $1 to test with, about 200K scores.

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.