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

Every field except the optional request context is part of a normal browser integration.
FieldTypeRequiredNotes
publicKeystringyesThe pk_… that matches the secret key.
sidstringyesThe session id from GET /api/trace/session.
manifeststringyesThe signed manifest for that session.
pagestringyesThe route or page being scored.
clientSignalsobjectnoBounded environment and aggregate counters.
eventsarraynoBounded timing events from the collector.
requestSignalsobjectnoWhat the edge observed about the visitor request.
disclosureHeadersobjectnoWeb 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.

Every field is optional and bounded. Omit what you do not have.
FieldWhat to send
visitorIpThe visitor IP string. Classified in memory; only a salted hash is persisted.
headerOrderUp to 64 lowercase header names, in order, if your edge exposes it.
proxyHeadersForwarding headers that reveal a relay, such as x-forwarded-for.
cookiePresentWhether a first-party cookie came back. Boolean, not the value.
visitorUserAgentThe visitor’s user agent, not the relay’s.
acceptLanguageThe visitor’s Accept-Language.
secChUa, secFetchSite, secFetchModeOptional Client Hints and fetch metadata.
protocolHeadersUp 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.
tlsClientThe 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

score.jsonA browser integration
{
  "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:

score-agent.jsonAn agent request
{
  "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

The fields your policy will read.
FieldMeaning
score0–100 human-likeness estimate.
band / verdictThe score range and its contract name.
actionallow, flag, or block. A recommendation.
confidenceHow strongly the model holds its classification.
classificationLabel (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).
agentDetected 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.
trustTokenOptional short-lived token for server-side verification.
requestIdThe join key to portal sessions and your logs.
ResponseMid-band example
{
  "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

Free to start. 10,000 scores a month, one project, no credit card.

Get started free