SDKs

// official Node + Python clients · or use plain HTTPS

The API is plain HTTPS + JSON, so any client works. We also ship official Node and Python SDKs — both dependency-free, wrapping auth, the error envelope, 429 backoff, and async polling. They're generated against the OpenAPI spec.

JS

Node / TypeScript

node ≥ 18 · zero deps (global fetch)
npm install solvegate
PY

Python

python ≥ 3.9 · zero deps (stdlib)
pip install solvegate

// usage matches the Node & Python examples above. Both clients are published — solvegate on npm and solvegate on PyPI — and both are MIT-licensed, zero-dependency, and open at github.com/SolveGate/cloudflare-turnstile-solver-api. Releases are dated in the changelog.

Zero dependencies is a deliberate constraint, not a boast. The Node client uses global fetch and the Python client uses the standard library, so neither adds anything to your lockfile and neither can break your build through something it pulled in. That matters more than usual here: a solver client tends to end up in CI images and scraping stacks where the dependency tree is already the fragile part.

Both SDKs handle the Authorization header, the typed error envelope, 429 backoff honouring Retry-After, and polling pending solves. They take the same gate, sitekey, url and optional action and cdata arguments as the raw endpoint. A synchronous request can also return pending; use its id to poll and choose a polling timeout appropriate to your workload. See the solve reference.

For the current SDKs, use meter === "sandbox" in Node or solve.meter == "sandbox" in Python to detect a test response. The Python solve object does not expose every raw API field, including mode and error_code; use the raw JSON API when you need those fields. A wait() deadline can return a still-pending solve, so always check status.

You do not need either of them. The API is HTTPS and JSON, every field is documented, and the cURL examples on this site are complete. The SDKs exist to save you writing the backoff loop twice, and there is nothing in them you could not write in an afternoon — which is why they are readable, MIT, and on GitHub rather than minified.

Ready to pour through the gate?

// free sandbox keys · no card required to start