Mint an x-kpsdk-cd proof of work
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://ksd.antibotapi.com/cd"), Headers = { { "x-api-key", "<x-api-key>" }, }, Content = new StringContent("{ \"st\": 1785412800000, \"ct\": \"2:AABbHF9lHkY0dHJhbnNwb3J0LXRva2Vu...tXlKQ\", \"domain\": \"gql.twitch.tv\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://ksd.antibotapi.com/cd"
payload := strings.NewReader("{ \"st\": 1785412800000, \"ct\": \"2:AABbHF9lHkY0dHJhbnNwb3J0LXRva2Vu...tXlKQ\", \"domain\": \"gql.twitch.tv\" }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://ksd.antibotapi.com/cd';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"st":1785412800000,"ct":"2:AABbHF9lHkY0dHJhbnNwb3J0LXRva2Vu...tXlKQ","domain":"gql.twitch.tv"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”A request signature. Required only when signing is on for your key. See Authentication.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The x-kpsdk-st header from the /tl response, in milliseconds.
The x-kpsdk-ct header from the /tl response (the new token, not the one you sent).
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.
Optional. When the work claims to have been done, in milliseconds on the sensor’s clock. Defaults to st.
Example
{ "st": 1785412800000, "ct": "2:AABbHF9lHkY0dHJhbnNwb3J0LXRva2Vu...tXlKQ", "domain": "gql.twitch.tv"}Responses
Section titled “Responses”The x-kpsdk-cd header value.
object
The x-kpsdk-cd header value. Send it unchanged; do not re-serialise it.
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.
object
object
What went wrong.
Example
{ "success": false}The API key is missing, unknown, revoked or out of balance, or its signature is wrong.
object
object
What went wrong.
Example
{ "success": false}The host is not approved for your account. The message names it. Request it from the dashboard.
object
object
What went wrong.
Example
{ "success": false, "error": { "type": "validation", "message": "site \"k.example.net\" is not in the whitelist" }}The body is over 32 MB.