hCaptcha solving for AI agents

An agent that cannot get past a challenge cannot finish the task. Expose one tool: sitekey and page URL in, token out. The agent submits the token and continues.

Steps

  1. When the agent sees an hCaptcha widget, have it extract the sitekey and the current URL.
  2. The tool calls POST /v1/solves and returns only the token, not the rest of the solve object.
  3. The agent writes that token into the page and submits. Mint the token immediately before submit — it expires in about two minutes.
tool
import os, requests

def solve_hcaptcha(sitekey: str, url: str) -> str:
    """Return an hCaptcha token for this sitekey and page URL."""
    res = requests.post(
        "https://api.vanishcaptcha.com/v1/solves",
        params={"wait": 90},
        headers={"Authorization": f"Bearer {os.environ['VANISHCAPTCHA_KEY']}"},
        json={"type": "hcaptcha", "sitekey": sitekey, "url": url},
        timeout=120,
    )
    res.raise_for_status()
    return res.json()["token"]

Enterprise rqdata

If the widget carries rqdata, send type: "hcaptcha_enterprise" and that value. The token that comes back is what the enterprise sitekey expects. Fields are in the API reference.

Questions

Does this solve reCAPTCHA or Turnstile?
No. These guides are hCaptcha only. reCAPTCHA and Turnstile are not live on VanishCaptcha.
How long is the token good for?
About two minutes, and it can be submitted once. Request it immediately before the form goes out.

Start solving hCaptcha in minutes.

1,400 free credits on signup. Pay per solve, credits never expire, failed solves never charged.