Perspective Compatibility Analyse
Accept a Google Perspective-style analyse request and return a Google-style response, while translating onto Respectify's scoring pipeline.
This endpoint is intended for easier migration from raw Perspective HTTP integrations. It preserves Google's wire shape as closely as currently supported, but it is not a claim of full behavioural parity.
Supported today: canonical Perspective attributes, preserved alias names, scoreThreshold, spanAnnotations, HTML text entries, and explicit languages when supplied.
Current limitations: only PROBABILITY score types are supported. In practice, that means 0 to 1 scores where higher values mean more of the requested attribute. Other score types are rejected. Respectify does not claim language detection when languages is omitted; compatibility responses fall back to the default English-oriented moderation context instead. doNotStore is accepted; in practice, analyse traffic is currently treated as though doNotStore were always true, because it is not retained for training. sessionId and communityId are accepted as request metadata for traceability, but they do not change scoring behaviour. dropUnsupportedAttributes is accepted, and current compat handling is already permissive in common flows.
How scores are produced: by Respectify's dedicated scoring model alone, on the comment text itself; scores are not rescaled afterwards. Span scores are one per sentence, for attributes whose summary score is 0.15 or higher, on comments of up to 20 sentences. Context entries are accepted but do not currently change the scores.
When scoring is unavailable: the endpoint returns HTTP 503 with a Google-style UNAVAILABLE error, rather than a guessed or partial result. Retry after a few seconds.
| Header Parameters |
|---|
X-User-Email email — REQUIREDAccount email address, for authentication |
X-API-Key string — REQUIREDAPI key owned by the user (email), for authentication |
| Request Body — REQUIRED | ||||
|---|---|---|---|---|
comment — REQUIREDPerspective-style comment input. String entries and | ||||
requestedAttributes objectGoogle-style requested attribute map, for example | ||||
context object
| ||||
spanAnnotations booleanWhen true, include Google-style | ||||
languages string[]Optional list of requested languages. Preserved in the response when supplied. | ||||
clientToken stringOpaque caller token echoed back in the response. | ||||
doNotStore booleanAccepted for compatibility. Respectify does not currently use analyse traffic for training, so this flag does not change today's scoring path. | ||||
sessionId stringAccepted for compatibility as request metadata for traceability. Does not affect scoring behaviour. | ||||
communityId stringAccepted for compatibility as request metadata for traceability. Does not affect scoring behaviour. | ||||
dropUnsupportedAttributes booleanAccepted for compatibility. Current compat handling is already permissive and ignores unsupported attributes in common flows. |
| Responses | |||||
|---|---|---|---|---|---|
200Google-style compatibility response
| |||||
400Invalid request, including unsupported non-PROBABILITY score types. The request must change before it is retried.
| |||||
401Missing or invalid credentials (the X-User-Email and X-API-Key headers).
| |||||
402The account's credit balance does not cover this call. Do not retry until funds have been added.
| |||||
413The request body is over the 1 MB (1,048,576 byte) limit, or was sent with chunked transfer encoding. Requests must include a Content-Length header.
| |||||
503Scoring is temporarily unavailable. Retry after a few seconds (or the
|