# Kasada

{% hint style="info" %}
Tip: Use one of the SDKs below instead of directly calling the API.
{% endhint %}

{% hint style="success" %}
Since the request body of the requests will be large, it is highly recommended to apply compression to your request body first. We support the following compression methods: "gzip", "br" and "deflate".<br>

Don't forget to set the `content-encoding` header. More info here: [Compression](/compression.md)
{% endhint %}

## Generate challenge token (ct)

## Generate Kasada payload

> Generates a payload to be used in the \`/tl\` POST request

```json
{"openapi":"3.0.0","info":{"title":"Kasada Payload API","version":"1.0.0"},"servers":[{"url":"https://kasada.hypersolutions.co","description":"Kasada payload generation server"}],"paths":{"/payload":{"post":{"summary":"Generate Kasada payload","description":"Generates a payload to be used in the `/tl` POST request","operationId":"generateKasadaPayload","parameters":[{"in":"header","name":"Content-Type","required":true,"schema":{"type":"string","enum":["application/json"]},"description":"The Content-Type of the request body"},{"in":"header","name":"x-api-key","required":true,"schema":{"type":"string"},"description":"Your API key for authentication"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userAgent","script","ipsLink","ip","acceptLanguage"],"properties":{"userAgent":{"type":"string","description":"The User-Agent string of the browser"},"script":{"type":"string","description":"The script content as a string."},"ipsLink":{"type":"string","description":"The IPS link obtained from the Kasada block page"},"acceptLanguage":{"type":"string","description":"Your accept-language header."},"ip":{"type":"string","description":"The IP that is used to post the sensor data to the target site. You can use /ip to get the IP from a connection. If you are not using proxies, this will be the IPv4 or IPv6 address of your pc."}}}}}},"responses":{"200":{"description":"OK Payload successfully generated","content":{"application/json":{"schema":{"type":"object","properties":{"headers":{"type":"object","properties":{}},"payload":{"type":"string","description":"The generated Kasada protection payload"}}}}}},"400":{"description":"Bad Request Error occurred","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}},"403":{"description":"Forbidden Authentication error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}}}}}}}
```

## Generate challenge data (cd)

## Get challenge POW

> Retrieves a challenge POW (\`x-kpsdk-cd\`)

```json
{"openapi":"3.0.0","info":{"title":"Kasada Payload API","version":"1.0.0"},"servers":[{"url":"https://kasada.hypersolutions.co","description":"Kasada payload generation server"}],"paths":{"/cd":{"post":{"summary":"Get challenge POW","description":"Retrieves a challenge POW (`x-kpsdk-cd`)","parameters":[{"in":"header","name":"Content-Type","required":true,"schema":{"type":"string","enum":["application/json"]},"description":"The Content-Type of the request body"},{"in":"header","name":"x-api-key","required":true,"schema":{"type":"string"},"description":"Your API key for authentication"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["st","ct","domain"],"properties":{"st":{"type":"integer","description":"Timestamp retrieved from the `x-kpsdk-st` response header of the `/tl` request"},"ct":{"type":"string","description":"Value retrieved from the `x-kpsdk-ct` response header of the `/tl` request"},"workTime":{"type":"integer","description":"Custom workTime value if you are generating POWs in advance"},"fc":{"type":"string","description":"Only used on specific sites. Inquire if your site makes a GET request to /mfc."},"domain":{"type":"string","description":"The domain of the p.js url"}}}}}},"responses":{"200":{"description":"OK POW successfully generated","content":{"application/json":{"schema":{"type":"object","properties":{"payload":{"type":"string","description":"The cd value"}}}}}},"400":{"description":"Bad Request Error occurred","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}},"403":{"description":"Forbidden Authentication error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}}}}}}}
```

## Generate Vercel BotID (x-is-human)

## Generate x-is-human header

> Generates a x-is-human header to be used on endpoints protected by Vercel BotID

```json
{"openapi":"3.0.0","info":{"title":"Kasada Payload API","version":"1.0.0"},"servers":[{"url":"https://kasada.hypersolutions.co","description":"Kasada payload generation server"}],"paths":{"/botid":{"post":{"summary":"Generate x-is-human header","description":"Generates a x-is-human header to be used on endpoints protected by Vercel BotID","parameters":[{"in":"header","name":"Content-Type","required":true,"schema":{"type":"string","enum":["application/json"]},"description":"The Content-Type of the request body"},{"in":"header","name":"x-api-key","required":true,"schema":{"type":"string"},"description":"Your API key for authentication"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userAgent","script","ip","acceptLanguage"],"properties":{"userAgent":{"type":"string","description":"The User-Agent string of the browser"},"script":{"type":"string","description":"The script content as a string."},"acceptLanguage":{"type":"string","description":"Your accept-language header."},"ip":{"type":"string","description":"The IP that is used to interact with the target site. You can use /ip to get the IP from a connection. If you are not using proxies, this will be the IPv4 or IPv6 address of your pc."}}}}}},"responses":{"200":{"description":"OK Payload successfully generated","content":{"application/json":{"schema":{"type":"object","properties":{"payload":{"type":"string","description":"The generated x-is-human header value"}}}}}},"400":{"description":"Bad Request Error occurred","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}},"403":{"description":"Forbidden Authentication error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hypersolutions.co/api-reference/kasada.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
