Bypass Solution
The Castle bypass runs in one call: GET /generate with the target (a website shortcut or the page's site_key) returns a valid token
How the solution works
To bypass Castle:
Identify the target use a supported
websiteshortcut (e.g.twitter,rockstar) or parse the site key (pk_...) from the page and pass it assite_key.Call
/generatewith that, plus your session's__cuidif you already have one.Read
tokenfrom the response and attach it where the target expects it, carrying__cuidalongside.
Endpoint
The endpoint lives on the Castle subdomain:
https://castle.takionapi.tech/generateReturns a valid x-castle-request-token and the __cuid cookie it is bound to. Identify the target with either the website shortcut (e.g. twitter, rockstar) or the page's site_key (the pk_... value). Pass your own __cuid to bind to an existing session, or omit it and one is generated for you.
Shortcut for a supported target so you don't have to parse the site key yourself. Provide this OR site_key.
{"value":"twitter"}The Castle public key (pk_...) from the page. Provide this OR website.
pk_live_XXXXXXXXXXXXXXXXYour session's __cuid. If omitted, Takion generates one and returns it — keep it on the session that sends the token.
Your API key (alternative to the x-api-key header; either is accepted).
Success returns the token + __cuid. On a bad request the API returns HTTP 200 with an error field instead — always check for error before reading token.
Authentication or quota failure — HTTP 401 with an error message.
Unexpected server error (HTTP 500).
GET /generate HTTP/1.1
Host: castle.takionapi.tech
x-api-key: YOUR_API_KEY
Accept: */*
{
"token": "<x-castle-request-token>",
"__cuid": "<cuid>"
}Sends an HTTP request from Takion with a realistic browser TLS fingerprint, through your proxy, carrying your cookie jar (including __cuid).
(Important) This endpoint is optional. If your own client already reproduces the TLS + header fingerprint matching your User-Agent, just attach the x-castle-request-token and __cuid from /generate to your own request and skip /tls. Use it only when you can't match the fingerprint yourself — it is always kept up to date.
Proxy in ip:port or ip:port:user:pass format.
1.2.3.4:8000:user:passGETPossible values: https://x.com/i/api/…Whether to verify TLS certificates upstream.
falseThe upstream response (or an error field).
Authentication or quota failure — HTTP 401 with an error message.
Unexpected server error (HTTP 500).
POST /tls HTTP/1.1
Host: castle.takionapi.tech
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 282
{
"proxy": "1.2.3.4:8000:user:pass",
"method": "GET",
"url": "https://x.com/i/api/…",
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"json": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"data": "text",
"params": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"verify": false,
"ANY_ADDITIONAL_PROPERTY": "anything"
}{
"status_code": 200,
"body": "text",
"headers": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"ANY_ADDITIONAL_PROPERTY": "anything"
}Last updated