Skip to content

Mint an x-kpsdk-cd proof of work

POST
/cd
curl --request POST \
--url https://ksd.antibotapi.com/cd \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "st": 1785412800000, "ct": "2:AABbHF9lHkY0dHJhbnNwb3J0LXRva2Vu...tXlKQ", "domain": "gql.twitch.tv" }'

Send st and ct from the /tl response and the host of the request you are about to make. Returns the x-kpsdk-cd header value. Mint a new one for every protected request. Free and unmetered.

x-signature
string

A request signature. Required only when signing is on for your key. See Authentication.

Media typeapplication/json
object
st
required

The x-kpsdk-st header from the /tl response, in milliseconds.

integer format: int64
ct
required

The x-kpsdk-ct header from the /tl response (the new token, not the one you sent).

string
domain
required

The host of the protected request you are about to make, such as gql.twitch.tv. This is often not the host that served ips.js.

string
work_time

Optional. When the work claims to have been done, in milliseconds on the sensor’s clock. Defaults to st.

integer format: int64

Example

{
"st": 1785412800000,
"ct": "2:AABbHF9lHkY0dHJhbnNwb3J0LXRva2Vu...tXlKQ",
"domain": "gql.twitch.tv"
}

The x-kpsdk-cd header value.

Media typeapplication/json
object
payload
required

The x-kpsdk-cd header value. Send it unchanged; do not re-serialise it.

string

Example

{
"payload": "{\"workTime\":1785412800000,\"id\":\"346301404f5e09223dd31225727ade59\",\"answers\":[2,6],\"duration\":31.771,\"d\":12,\"st\":1785412800000,\"rst\":1785412800012}"
}

Unreadable JSON, an empty ct, or a domain we do not support yet. The message says which.

Media typeapplication/json
object
success
required
boolean
error
required
object
type
required
string
message
required

What went wrong.

string

Example

{
"success": false
}

The API key is missing, unknown, revoked or out of balance, or its signature is wrong.

Media typeapplication/json
object
success
required
boolean
error
required
object
type
required
string
message
required

What went wrong.

string

Example

{
"success": false
}

The host is not approved for your account. The message names it. Request it from the dashboard.

Media typeapplication/json
object
success
required
boolean
error
required
object
type
required
string
message
required

What went wrong.

string

Example

{
"success": false,
"error": {
"type": "validation",
"message": "site \"k.example.net\" is not in the whitelist"
}
}

The body is over 32 MB.