x-kpsdk-ct and x-kpsdk-cd compared
The two headers do different jobs, and most failures come from treating them the same way.
x-kpsdk-ct, the client token
- Where it comes from: the response headers of the POST to Kasada's
/tlendpoint, after the challenge has been solved. - How long it lasts: until a newer one arrives. Later responses, including responses from protected endpoints, can return a fresh
x-kpsdk-ct. Only the most recent value works. - When to send it: on requests to protected endpoints, if the browser sends it there. Some sites expect it as a header, others only check Kasada's cookies.
x-kpsdk-cd, the proof of work
- Where it comes from: it is computed for each request, using the latest
x-kpsdk-ctand thex-kpsdk-sttimestamp that/tlreturned. - How long it lasts: one request. A value that has been sent once is spent.
- When to send it: on every protected request where the browser sends it, generated immediately before the request.
Where the headers come from
On most Kasada sites the flow looks like this in a capture:
- The page loads Kasada's
p.js. The SDK version in that script becomes thex-kpsdk-vvalue. - A background GET to a path ending in
/fpanswers with status 429 and a small page that loadsips.js. The 429 here is Kasada's challenge, not a rate limit. - The browser runs the challenge and POSTs the result as a binary body to the matching
/tlpath. - The
/tlresponse sets Kasada's cookies (tkrm_alpekz_s1.3andtkrm_alpekz_s1.3-ssn) and returnsx-kpsdk-ctandx-kpsdk-stas response headers. - Requests to protected endpoints carry the cookies and, where the site expects them,
x-kpsdk-ctand a freshx-kpsdk-cd.
Some sites skip the background /fp call and serve the challenge on the first page load instead. The /tl step and the headers and cookies that come out of it are the same. The site then reloads the page with the new cookies.
The other x-kpsdk headers
You will see more x-kpsdk-* names in a capture. They are part of the same flow:
x-kpsdk-v: the SDK version, sent on the/fprequest.x-kpsdk-st: a timestamp returned by/tl. It is an input for everyx-kpsdk-cd.x-kpsdk-imandx-kpsdk-dt: sent on the/tlrequest itself, next to anx-kpsdk-ctthat the API returns with the payload.x-kpsdk-fcandx-kpsdk-h: returned by an extra/mfccall on some sites.fcfeeds the proof of work;hmay be required on protected requests.
Why copied headers fail
Copying both headers from a browser session into a script works for one request at most:
- x-kpsdk-cd is single-use. Reusing it fails immediately.
- x-kpsdk-ct goes stale. Once a response returns a newer token, the old one stops working, and every new proof of work has to use the newer token.
- The cookies expire. In the example in the Hyper Solutions docs, the Kasada cookies carry a Max-Age of 86400 seconds.
- A 429 on a protected endpoint usually means the session has to solve the challenge again.
- The client does not match. As with every anti-bot system, a TLS fingerprint or header order that is not Chrome's gets the session flagged before the headers matter. Recording a browser session in a HAR file shows exactly which of these headers the site expects.
Kasada and Vercel BotID
Applications on Vercel can use Vercel BotID, whose Deep Analysis mode is powered by Kasada. There, protected endpoints expect an x-is-human header. It comes from its own c.js script, not from /tl. A site can also run standard Kasada next to BotID, so check which headers the browser sends.
The full flow is in the Kasada fingerprint-endpoint docs. The Hyper Solutions Kasada API generates the /tl payload and every x-kpsdk-cd, so your client only has to send them in the right order.