> For the complete documentation index, see [llms.txt](https://docs.takionapi.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.takionapi.tech/px-web/api.md).

# Bypass Solution

## **How the Solution Works**

To bypass PerimeterX protection:

1. **Provide our API with the website details**
2. **Parse the returned cookies and use them for requests to the protected website.**

### Endpoint <a href="#endpoint" id="endpoint"></a>

The endpoint lives on the px-web subdomain:

```
https://px-web.takionapi.tech/generate
```

## Generate a PX web session (\_px3 cookie)

> Solves PerimeterX for the given app and page and returns a session that carries the \`\_px3\` cookie plus a Takion \`x-px-session-id\`. Attach \`\_px3\` to your own requests, or keep sending through /tls with the session id.<br>

```json
{"openapi":"3.0.3","info":{"title":"Takion API — PerimeterX (Web)","version":"1.0.0"},"servers":[{"url":"https://px-web.takionapi.tech"}],"security":[{"ApiKeyHeader":[]},{"ApiKeyQuery":[]}],"components":{"securitySchemes":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key"},"ApiKeyQuery":{"type":"apiKey","in":"query","name":"api_key"}},"schemas":{"GenerateWebRequest":{"type":"object","required":["proxy","user_agent"],"properties":{"proxy":{"type":"string","description":"Proxy in `ip:port` or `ip:port:user:pass` format."},"user_agent":{"type":"string","description":"The browser User-Agent to emulate (match it on your own requests)."},"app_id":{"type":"string","description":"The PX app id (`_pxAppId`) of the target."},"page_url":{"type":"string","format":"uri","description":"The page the session is for."},"fast_mode":{"type":"boolean","description":"Quicker solve with a slightly weaker PX score."}},"additionalProperties":true},"GenerateWebResponse":{"type":"object","properties":{"cookies":{"type":"object","description":"The PX cookies to replay, including `_px3`.","properties":{"_px3":{"type":"string"}},"additionalProperties":{"type":"string"}},"extra":{"type":"object","description":"Session metadata.","properties":{},"additionalProperties":true}},"additionalProperties":true},"Error":{"type":"object","required":["error"],"description":"Every error is a JSON object with a single `error` string. Auth/quota problems return HTTP 401 and unexpected failures 500; input-validation errors return an `error` field too — always check for `error` first.\n","properties":{"error":{"type":"string"}}}},"responses":{"Unauthorized":{"description":"Authentication or quota failure — HTTP 401 with an `error` message.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ServerError":{"description":"Unexpected server error (HTTP 500).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/generate":{"post":{"operationId":"generatePxWebSession","summary":"Generate a PX web session (_px3 cookie)","description":"Solves PerimeterX for the given app and page and returns a session that carries the `_px3` cookie plus a Takion `x-px-session-id`. Attach `_px3` to your own requests, or keep sending through /tls with the session id.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateWebRequest"}}}},"responses":{"200":{"description":"The PX session. On a bad request the API returns an `error` field instead — check for `error` before reading `cookies` / `extra`.\n","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GenerateWebResponse"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Send a session-bound TLS request (optional)

> Sends an HTTP request from Takion with a realistic browser TLS\
> fingerprint, bound to the \`session\_id\` from /generate so the PX cookies\
> stay valid across the flow.\
> \
> \*\*(Important) This endpoint is optional.\*\* If your own client already\
> reproduces the TLS + header fingerprint matching your User-Agent, just\
> attach the \`\_px3\` cookie from /generate to your own requests and skip\
> /tls. Use it only when you can't match the fingerprint yourself — it is\
> always kept up to date with a large bank of fingerprints.<br>

```json
{"openapi":"3.0.3","info":{"title":"Takion API — PerimeterX (Web)","version":"1.0.0"},"servers":[{"url":"https://px-web.takionapi.tech"}],"security":[{"ApiKeyHeader":[]},{"ApiKeyQuery":[]}],"components":{"securitySchemes":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key"},"ApiKeyQuery":{"type":"apiKey","in":"query","name":"api_key"}},"schemas":{"TlsRequest":{"type":"object","required":["proxy","method","url"],"properties":{"proxy":{"type":"string"},"session_id":{"type":"string","nullable":true,"description":"The x-px-session-id from /generate (keeps PX state hot)."},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},"url":{"type":"string","format":"uri"},"headers":{"type":"object","nullable":true,"additionalProperties":{"type":"string"}},"json":{"type":"object","nullable":true,"additionalProperties":true},"data":{"type":"string","nullable":true}},"additionalProperties":true},"TlsResponse":{"type":"object","properties":{"status_code":{"type":"integer"},"body":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"additionalProperties":true},"Error":{"type":"object","required":["error"],"description":"Every error is a JSON object with a single `error` string. Auth/quota problems return HTTP 401 and unexpected failures 500; input-validation errors return an `error` field too — always check for `error` first.\n","properties":{"error":{"type":"string"}}}},"responses":{"Unauthorized":{"description":"Authentication or quota failure — HTTP 401 with an `error` message.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ServerError":{"description":"Unexpected server error (HTTP 500).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/tls":{"post":{"operationId":"pxWebTlsRequest","summary":"Send a session-bound TLS request (optional)","description":"Sends an HTTP request from Takion with a realistic browser TLS\nfingerprint, bound to the `session_id` from /generate so the PX cookies\nstay valid across the flow.\n\n**(Important) This endpoint is optional.** If your own client already\nreproduces the TLS + header fingerprint matching your User-Agent, just\nattach the `_px3` cookie from /generate to your own requests and skip\n/tls. Use it only when you can't match the fingerprint yourself — it is\nalways kept up to date with a large bank of fingerprints.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TlsRequest"}}}},"responses":{"200":{"description":"The upstream response (or an `error` field).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TlsResponse"},{"$ref":"#/components/schemas/Error"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```
