Captcha verify
POST /api/captcha-verifyValidate a Cloudflare Turnstile, Google reCAPTCHA, or hCaptcha token server-side. Send POST /api/captcha-verify with the required fields provider, secret and token and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with provider, success, hostname and errorCodes.
You pass your OWN provider secret plus the token from the client; we relay to the provider's siteverify endpoint (never logged) and return the normalized verdict (success, hostname, action, score, error codes). The legitimate backend half of bot protection - no solving, no bypass.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
provider | string | yes | turnstile | recaptcha | hcaptcha |
secret | string | yes | your provider secret key (relayed to the provider, never stored/logged) Also accepted as key, password, passphrase. |
token | string | yes | the captcha response token from the client Also accepted as jwt, accessToken. |
remoteip | string | no | optional client IP to pass through |
Example request
curl -i -X POST https://agent402.tools/api/captcha-verify \
-H "Content-Type: application/json" \
-d '{"provider":"turnstile","secret":"1x0000000000000000000000000000000AA","token":"XXXX.DUMMY.TOKEN.XXXX"}'
Without payment this returns HTTP 402 Payment Required with the exact price for captcha-verify; any x402 v2 or MPP client pays it and retries.
Example response
{
"provider": "turnstile",
"success": true,
"hostname": "example.com",
"errorCodes": []
}
| Field | Type | Always present | In the example |
|---|---|---|---|
provider | string | yes | turnstile |
success | boolean | yes | true |
hostname | string | yes | example.com |
errorCodes | array | yes | 0 items in the example |
From an MCP client
catalog.call {
"slug": "captcha-verify",
"params": {
"provider": "turnstile",
"secret": "1x0000000000000000000000000000000AA",
"token": "XXXX.DUMMY.TOKEN.XXXX"
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for captcha-verify; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
provider,secretandtokenare required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/captcha-verify returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/captcha-verify", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"provider": "turnstile",
"secret": "1x0000000000000000000000000000000AA",
"token": "XXXX.DUMMY.TOKEN.XXXX"
}),
});
Related tools
Captcha generate
POST /api/captcha-generateMint a stateless captcha challenge to gate your OWN endpoint: returns a human prompt plus a salted sha256 answer hash yo…
Verify B20 token
GET /api/b20-verifyBoolean verdict with reasons: is this address a real factory-issued B20 on Base? Checks the 0xB200 address prefix, ERC-2…
Contract bytecode check
GET /api/contract-codeIs this address a contract, and what code does it hold? Returns isContract, deployed bytecode size, and the keccak-256 h…
JWT verify (HMAC)
POST /api/jwt-verifyVerify an HS256/384/512 JWT signature against a secret and check expiry. Returns valid + decoded payload. (HMAC algorith…
x402 seller dossier
POST /api/seller-dossierEverything Agent402 knows about one x402 seller origin, in one read: identity and crawl history, the catalog with the pr…
x402 seller payability check
POST /api/seller-payabilityBuy one call from an x402 seller endpoint right now and report exactly what happened: the unpaid call's status, the 402 …