Documentation / API · Score
POST /api/trace/score
Submit consented evidence and the visitor context your edge observed. Get a score, a classification, a verdict, an action, and the evidence behind them.
Last updated
Authentication
Authorization: Bearer sk_… — the secret key, server-side only. The body’s publicKey must match the key pair used to authenticate.
Request
| Field | Type | Required | Notes |
|---|---|---|---|
publicKey | string | yes | The pk_… that matches the secret key. |
sid | string | yes | The session id from GET /api/trace/session. |
manifest | string | yes | The signed manifest for that session. |
page | string | yes | The route or page being scored. |
clientSignals | object | no | Bounded environment and aggregate counters. |
events | array | no | Bounded timing events from the collector. |
requestSignals | object | no | What the edge observed about the visitor request. |
disclosureHeaders | object | no | Web Bot Auth signature headers, if present. |
requestSignals
The scoring call arrives from your backend, so its own headers describe the relay. requestSignals describes the visitor’s request instead.
| Field | What to send |
|---|---|
visitorIp | The visitor IP string. Classified in memory; only a salted hash is persisted. |
headerOrder | Up to 64 lowercase header names, in order, if your edge exposes it. |
proxyHeaders | Forwarding headers that reveal a relay, such as x-forwarded-for. |
cookiePresent | Whether a first-party cookie came back. Boolean, not the value. |
visitorUserAgent | The visitor’s user agent, not the relay’s. |
acceptLanguage | The visitor’s Accept-Language. |
secChUa, secFetchSite, secFetchMode | Optional Client Hints and fetch metadata. |
protocolHeaders | Up to 16 lowercase header names from a fixed allowlist: MCP, x402 (v2 PAYMENT-*, legacy X-PAYMENT), and Web Bot Auth. Names only, never values. Together with a browser user-agent, they identify an agent. |
tlsClient | The TLS client family your edge derived: chrome, firefox, safari, edge, go, python, curl, node, other. Never a raw JA3/JA4 hash. A family that contradicts the claimed browser is spoofing evidence. |
Example request
{
"publicKey": "pk_...",
"sid": "8f3c...",
"manifest": "signed-token...",
"page": "/checkout",
"clientSignals": {
"webdriver": false,
"prog": { "synthetic": 0, "clickCenter": 1 }
},
"events": [
{ "type": "pointerdown", "t": 120 },
{ "type": "keydown", "t": 480 }
],
"requestSignals": {
"visitorIp": "203.0.113.9",
"headerOrder": ["host", "connection", "user-agent", "accept"],
"proxyHeaders": ["x-forwarded-for"],
"cookiePresent": true,
"visitorUserAgent": "Mozilla/5.0 ...",
"acceptLanguage": "en-US,en;q=0.9"
}
}
An agent request uses the same fields plus the protocol and transport evidence your edge observed:
{
"publicKey": "pk_...",
"sid": "8f3c...",
"manifest": "signed-token...",
"page": "/articles/premium",
"requestSignals": {
"visitorUserAgent": "Mozilla/5.0 ... Chrome/120 ...",
"protocolHeaders": ["mcp-protocol-version", "payment-signature"],
"tlsClient": "python"
}
}
A request with MCP or x402 headers is classified as an agent (mcp_client or x402_client); a browser user-agent sending them is browser_agent. A TLS family that contradicts the claimed browser is evidence of spoofing. The score remains a human-likeness estimate; the classification.label and agent.type carry the identity.
Response
| Field | Meaning |
|---|---|
score | 0–100 human-likeness estimate. |
band / verdict | The score range and its contract name. |
action | allow, flag, or block. A recommendation. |
confidence | How strongly the model holds its classification. |
classification | Label (human, agent, bot), confidence, probabilities, agent type (mcp_client, x402_client, browser_agent, mobile_agent, verified_crawler, spoofed_crawler), and model (trained calibrated weights or rules for explicit overrides). |
agent | Detected type, provider, identity (signed, ip_verified, or unknown), when automation is present. |
signals[] | { id, layer, value, fired, detail? }. |
consistency[] | Cross-checks between signals. |
overrides[] | Hard findings that capped the score (including spoofed_crawler and verified_crawler). |
cascade | { needed, mode, band, suggestedTests, challenge? }. When needed is true, includes a signed pow_timing challenge verifiable via POST /api/trace/verify-stepup. |
trustToken | Optional short-lived token for server-side verification. |
requestId | The join key to portal sessions and your logs. |
{
"score": 43,
"band": "suspicious_agent",
"verdict": "suspicious_agent",
"action": "flag",
"confidence": 0.71,
"overrides": ["contradictions"],
"signals": [
{ "id": "mouse_curvature", "layer": 2, "value": 0.08, "fired": true },
{ "id": "consistency_ua_platform", "layer": 6, "value": 0, "fired": true }
],
"consistency": [
{ "id": "consistency_ua_platform", "layer": 6, "value": 0, "fired": true }
],
"cascade": {
"needed": true,
"mode": "pow_timing",
"band": "suspicious",
"suggestedTests": ["pow_sha256", "event_loop_jitter"],
"challenge": {
"mode": "pow_timing",
"challengeToken": "eyJ2Ijox...",
"salt": "9a4c...",
"difficulty": 14,
"expiresAt": "2026-11-30T18:02:00.000Z"
}
},
"trustToken": "tr_...",
"requestId": "req_..."
}
Step-up verification (POST /api/trace/verify-stepup)
When a session lands in the middle band (cascade.needed === true), the browser can solve cascade.challenge invisibly with solveStepUp(challenge) from /trace.js (SHA-256 proof-of-work plus animation-frame jitter sampling) and relay { challengeToken, nonce, timingMs, jitterSamples, requestId } to POST /api/trace/verify-stepup with your secret key. Valid challenges are single-use and return an adjusted score, verdict, and action.
Metering and errors
A successful 200 score counts against the plan. A 4xx or 429 is not billed. The plan quota is returned in each scoring response. See errors and limits for the full table.
What the endpoint does not do
It does not enforce, proxy, or prove identity. It returns an estimate with evidence; your server decides. The browser must never hold the secret key.
Related
- Scoring & verdicts — how to read the response
- Session manifest — where sid and manifest come from
- Verify a trust token — the server-side follow-up
- Errors & limits — failure paths