ading2210 / vercel-llm-api

A reverse engineered Python API wrapper for the Vercel AI Playground, which provides free access to many large language models without needing an account.
https://pypi.org/project/vercel-llm-api
GNU General Public License v3.0
147 stars 14 forks source link

Kasada Anti-Bot #22

Open 0x6a69616e opened 8 months ago

0x6a69616e commented 8 months ago

During a reanalysis of Vercel AI's functionality, I came across two additional headers used in the HTTP requests of its generational endpoints, namely x-kpsdk-cd, x-kpsdk-ct, x-kpsdk-im. After some research, I found that these headers are related to Kasada.

I've already done a bit of reverse engineering. Achieving the value of x-kpsdk-ct and x-kpsdk-im was relatively easy, but it seems x-kpsdk-cd is challenging to figure out.

If the headers' values aren't in any way valid, the API will respond with a 429 error.

viemccoy commented 7 months ago

Yeah my previous utilization of this tool has been broken recently, I assume by this. Even using the retry until a response trick doesn't work anymore. Bummer because this is such a great way to test different models!

sxqib commented 1 month ago

I found something: https://github.com/Pr0t0ns/Kasada-Reverse

0x6a69616e commented 1 month ago

Streamlink's Twitch plugin leverages CDP and simple script injection to bypass Kasada protections on Twitch. I suggest you have a look at the source code to see if you can get anything from it.

https://github.com/streamlink/streamlink/blob/58acbccccb03c920cc47ce17025a3ebb4bf25fb5/src/streamlink/plugins/twitch.py#L490

0x6a69616e commented 1 month ago

I've actually developed a Kasada solver myself, taking a bit of inspiration from their bypass concept.

0x6a69616e/kpsdk-solver

But kpsdk-solver is entirely written in JavaScript, which makes this pretty much a no-go.

Metimol1 commented 1 month ago

Maybe in gpt4free working?

https://github.com/xtekky/gpt4free/blob/main/g4f%2FProvider%2FVercel.py