# Payload Anomaly Scoring API > Score caller-supplied JSON and text for structural depth, type confusion, injection-shaped strings, and size inflation. The payload stays in memory for the request and is not executed or stored. Each POST has a fixed USDC price on Base, paid with the x402 exact scheme. The request is validated first, and payment settles only after a successful (2xx) result. Failed calls are not charged. 1. POST JSON matching the requestBody. Invalid input returns 400 with no payment challenge. 2. A valid unpaid call returns 402 with the exact amount and payTo. 3. Pay and retry with payment-signature. Payment settles only if the operation returns 2xx. A 4xx/5xx is not charged. - Product: https://www.brainiac.software/api/security - Docs: https://www.brainiac.software/api/security/docs - OpenAPI: https://www.brainiac.software/api/security/openapi.json - Contact: support@brainiac.software (https://www.brainiac.software/contact) ## Operations ### POST /api/v1/security/payload-anomaly-score $0.04 USDC. Score a caller-supplied JSON value or text string for nesting depth, mixed types, injection-shaped text, and size inflation. Matching is local and deterministic. The payload is not executed, fetched, or stored. Inputs: payload Docs: https://www.brainiac.software/api/security/docs#security-payload-anomaly-score Example request: ```json { "payload": { "user": "ada", "note": "admin' OR '1'='1", "profile": { "bio": "", "meta": { "a": { "b": { "c": { "d": { "e": { "f": { "g": 1 } } } } } } } }, "flags": [ 1, "1", true ], "filter": { "$gt": 0 } } } ``` Example response: ```json { "overall_safety_score": 57, "risk_breakdown": { "depth_anomaly_risk": 15, "type_confusion_risk": 35, "injection_vector_risk": 100, "size_inflation_risk": 0 }, "anomalies_detected": [ { "code": "nosql_operator", "severity": "high", "path": "$.filter[\"$gt\"]", "detail": "This key is a NoSQL operator name. It was not sent to a database." }, { "code": "mixed_array_types", "severity": "medium", "path": "$.flags", "detail": "Items in this array use more than one JSON type: boolean, number, string." }, { "code": "sql_tautology", "severity": "high", "path": "$.note", "detail": "The text matches a SQL tautology pattern. It was not sent to a database." }, { "code": "script_tag", "severity": "high", "path": "$.profile.bio", "detail": "The text contains a script tag. The tag was not executed." }, { "code": "depth_anomaly", "severity": "low", "path": "$.profile.meta.a.b.c.d.e.f.g", "detail": "The deepest value is 9 levels down. The depth check starts at 6." } ], "audit_receipt": "sha256:2bfb1c9dc51ada180dd98ab3a01a76df846bc9f42168ac2c7b0c1e5535b49b0c" } ```