{ "openapi": "3.1.0", "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema", "info": { "title": "2Captcha", "version": "1.0.0", "description": "2Captcha CAPTCHA solving API exposed through PaySponge with x402 billing. This bundled spec preserves the PaySponge payment metadata and documents the upstream 2Captcha request and response bodies for task creation, result polling, and solve-quality feedback. Callers do not send a separate upstream API credential field to this wrapper.", "x-agentcash-auth": { "mode": "paid" } }, "servers": [ { "url": "https://2captcha.x402.paysponge.com" } ], "paths": { "/createTask": { "post": { "summary": "Create a CAPTCHA solve task", "description": "Create a new 2Captcha recognition task for a selected captcha task type. The `task` object follows the upstream 2Captcha task schema for the specific captcha type. The PaySponge wrapper handles billing through x402, so callers do not pass a separate upstream API credential field.", "operationId": "createTask", "externalDocs": { "description": "2Captcha createTask reference", "url": "https://2captcha.com/api-docs/create-task" }, "x-agentcash-auth": { "mode": "paid" }, "x-payment-required": true, "x-payment-info": { "protocols": [ "x402" ], "pricingMode": "fixed", "price": "$0.01" }, "x402Version": 2, "resource": { "url": "https://2captcha.x402.paysponge.com/createTask", "description": "POST /createTask", "mimeType": "application/json" }, "accepts": [ { "scheme": "exact", "network": "eip155:8453", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "10000", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "eip155:43114", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "10000", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "payTo": "9hw9Py9uMGtXRNpABZjifcK1t3suwzjyri9L9QYKg6zZ", "asset": "usdc", "amount": "10000", "maxTimeoutSeconds": 300, "extra": {} } ], "extensions": { "bazaar": { "info": { "input": { "type": "http", "method": "POST", "bodyType": "json", "body": { "task": { "type": "RecaptchaV2TaskProxyless", "websiteURL": "https://2captcha.com/demo/recaptcha-v2", "websiteKey": "6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u" } } }, "output": { "type": "json", "example": { "errorId": 0, "taskId": 72345678901 } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTaskRequest" }, "examples": { "normalCaptcha": { "value": { "task": { "type": "ImageToTextTask", "body": "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==", "phrase": false, "case": true, "numeric": 0, "math": false, "minLength": 1, "maxLength": 5, "comment": "enter the text you see on the image" }, "languagePool": "en" } }, "recaptchaV2Proxyless": { "value": { "task": { "type": "RecaptchaV2TaskProxyless", "websiteURL": "https://2captcha.com/demo/recaptcha-v2", "websiteKey": "6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u", "isInvisible": false } } }, "recaptchaV2WithProxy": { "value": { "task": { "type": "RecaptchaV2Task", "websiteURL": "https://2captcha.com/demo/recaptcha-v2", "websiteKey": "6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u", "isInvisible": false, "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36", "cookies": "foo=bar; baz=1", "proxyType": "http", "proxyAddress": "1.2.3.4", "proxyPort": 8080, "proxyLogin": "user23", "proxyPassword": "p4$w0rd" } } }, "recaptchaV3Proxyless": { "value": { "task": { "type": "RecaptchaV3TaskProxyless", "websiteURL": "https://2captcha.com/demo/recaptcha-v3", "websiteKey": "6LfB5_IbAAAAAMCtsjEHEHKqcB9iQocwwxTiihJu", "minScore": 0.9, "pageAction": "test", "isEnterprise": false, "apiDomain": "www.recaptcha.net" } } }, "rotateCaptcha": { "value": { "task": { "type": "RotateTask", "body": "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==", "comment": "position the image properly", "angle": 60 }, "languagePool": "en" } } } } } }, "responses": { "200": { "description": "Task creation result. On success, returns a new task identifier. On failure, returns a 2Captcha error object.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTaskResponse" }, "examples": { "success": { "value": { "errorId": 0, "taskId": 72345678901 } } } } } }, "402": { "description": "Payment Required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/X402PaymentRequired" }, "example": { "x402Version": 2, "error": "Payment required", "resource": { "url": "https://2captcha.x402.paysponge.com/createTask", "description": "POST /createTask", "mimeType": "application/json" }, "accepts": [ { "scheme": "exact", "network": "eip155:8453", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "10000", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "eip155:43114", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "10000", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "payTo": "9hw9Py9uMGtXRNpABZjifcK1t3suwzjyri9L9QYKg6zZ", "asset": "usdc", "amount": "10000", "maxTimeoutSeconds": 300, "extra": {} } ] } } } } } } }, "/getTaskResult": { "post": { "summary": "Get the result for a CAPTCHA solve task", "description": "Fetch the current status or completed solution for a previously created task. If the task is still running, the response status is `processing`. If the task completed, the response includes `solution` and timing metadata. The PaySponge wrapper handles billing through x402, so callers do not pass a separate upstream API credential field.", "operationId": "getTaskResult", "externalDocs": { "description": "2Captcha getTaskResult reference", "url": "https://2captcha.com/api-docs/get-task-result" }, "x-agentcash-auth": { "mode": "paid" }, "x-payment-required": true, "x-payment-info": { "protocols": [ "x402" ], "pricingMode": "fixed", "price": "$0.00" }, "x402Version": 2, "resource": { "url": "https://2captcha.x402.paysponge.com/getTaskResult", "description": "POST /getTaskResult", "mimeType": "application/json" }, "accepts": [ { "scheme": "exact", "network": "eip155:8453", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "eip155:43114", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "payTo": "9hw9Py9uMGtXRNpABZjifcK1t3suwzjyri9L9QYKg6zZ", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} } ], "extensions": { "bazaar": { "info": { "input": { "type": "http", "method": "POST", "bodyType": "json", "body": { "taskId": 74372499131 } }, "output": { "type": "json", "example": { "errorId": 0, "status": "ready", "solution": {}, "cost": "0.00299", "ip": "1.2.3.4", "createTime": 1692863536, "endTime": 1692863556, "solveCount": 1 } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskStatusRequest" }, "examples": { "poll": { "value": { "taskId": 74372499131 } } } } } }, "responses": { "200": { "description": "Current task state, completed task result, or a 2Captcha error object if the task could not be completed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetTaskResultResponse" }, "examples": { "processing": { "value": { "errorId": 0, "status": "processing" } }, "readyNormalCaptcha": { "value": { "errorId": 0, "status": "ready", "solution": { "text": "hello world" }, "cost": "0.00025", "ip": "1.2.3.4", "createTime": 1692808229, "endTime": 1692808326, "solveCount": 1 } }, "readyRecaptchaV2": { "value": { "errorId": 0, "status": "ready", "solution": { "gRecaptchaResponse": "03ADUVZw...UWxTAe6ncIa", "token": "03ADUVZw...UWxTAe6ncIa" }, "cost": "0.00299", "ip": "1.2.3.4", "createTime": 1692863536, "endTime": 1692863556, "solveCount": 1 } }, "readyRecaptchaV3": { "value": { "errorId": 0, "status": "ready", "solution": { "gRecaptchaResponse": "03ADUVZwB7eLoqnBxvi5H...kA4Si3qH0rR0g", "token": "03ADUVZwB7eLoqnBxvi5H...kA4Si3qH0rR0g" }, "cost": "0.00299", "ip": "1.2.3.4", "createTime": 1692863536, "endTime": 1692863556, "solveCount": 1 } }, "readyRotateCaptcha": { "value": { "errorId": 0, "status": "ready", "solution": { "rotate": 180 }, "cost": "0.0005", "ip": "1.2.3.4", "createTime": 1692863536, "endTime": 1692863556, "solveCount": 1 } }, "error": { "value": { "errorId": 12, "errorCode": "ERROR_CAPTCHA_UNSOLVABLE", "errorDescription": "Workers could not solve the Captcha" } } } } } }, "402": { "description": "Payment Required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/X402PaymentRequired" }, "example": { "x402Version": 2, "error": "Payment required", "resource": { "url": "https://2captcha.x402.paysponge.com/getTaskResult", "description": "POST /getTaskResult", "mimeType": "application/json" }, "accepts": [ { "scheme": "exact", "network": "eip155:8453", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "eip155:43114", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "payTo": "9hw9Py9uMGtXRNpABZjifcK1t3suwzjyri9L9QYKg6zZ", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} } ] } } } } } } }, "/reportCorrect": { "post": { "summary": "Report a correct CAPTCHA solution", "description": "Send automated positive feedback for a completed task when the target website accepted the returned solution. The PaySponge wrapper handles billing through x402, so callers do not pass a separate upstream API credential field.", "operationId": "reportCorrect", "externalDocs": { "description": "2Captcha reportCorrect reference", "url": "https://2captcha.com/api-docs/report-correct" }, "x-agentcash-auth": { "mode": "paid" }, "x-payment-required": true, "x-payment-info": { "protocols": [ "x402" ], "pricingMode": "fixed", "price": "$0.00" }, "x402Version": 2, "resource": { "url": "https://2captcha.x402.paysponge.com/reportCorrect", "description": "POST /reportCorrect", "mimeType": "application/json" }, "accepts": [ { "scheme": "exact", "network": "eip155:8453", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "eip155:43114", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "payTo": "9hw9Py9uMGtXRNpABZjifcK1t3suwzjyri9L9QYKg6zZ", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} } ], "extensions": { "bazaar": { "info": { "input": { "type": "http", "method": "POST", "bodyType": "json", "body": { "taskId": 74455221488 } }, "output": { "type": "json", "example": { "errorId": 0, "status": "success" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackRequest" }, "examples": { "accepted": { "value": { "taskId": 74455221488 } } } } } }, "responses": { "200": { "description": "Feedback submission result. On success, returns `status: success`. On failure, returns a 2Captcha error object.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackResponse" }, "examples": { "success": { "value": { "errorId": 0, "status": "success" } } } } } }, "402": { "description": "Payment Required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/X402PaymentRequired" }, "example": { "x402Version": 2, "error": "Payment required", "resource": { "url": "https://2captcha.x402.paysponge.com/reportCorrect", "description": "POST /reportCorrect", "mimeType": "application/json" }, "accepts": [ { "scheme": "exact", "network": "eip155:8453", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "eip155:43114", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "payTo": "9hw9Py9uMGtXRNpABZjifcK1t3suwzjyri9L9QYKg6zZ", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} } ] } } } } } } }, "/reportIncorrect": { "post": { "summary": "Report an incorrect CAPTCHA solution", "description": "Send automated negative feedback when the target website rejected the returned solution. 2Captcha uses this feedback to review solve quality and may issue refunds after analysis. The PaySponge wrapper handles billing through x402, so callers do not pass a separate upstream API credential field.", "operationId": "reportIncorrect", "externalDocs": { "description": "2Captcha reportIncorrect reference", "url": "https://2captcha.com/api-docs/report-incorrect" }, "x-agentcash-auth": { "mode": "paid" }, "x-payment-required": true, "x-payment-info": { "protocols": [ "x402" ], "pricingMode": "fixed", "price": "$0.00" }, "x402Version": 2, "resource": { "url": "https://2captcha.x402.paysponge.com/reportIncorrect", "description": "POST /reportIncorrect", "mimeType": "application/json" }, "accepts": [ { "scheme": "exact", "network": "eip155:8453", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "eip155:43114", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "payTo": "9hw9Py9uMGtXRNpABZjifcK1t3suwzjyri9L9QYKg6zZ", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} } ], "extensions": { "bazaar": { "info": { "input": { "type": "http", "method": "POST", "bodyType": "json", "body": { "taskId": 74455221488 } }, "output": { "type": "json", "example": { "errorId": 0, "status": "success" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackRequest" }, "examples": { "rejected": { "value": { "taskId": 74455221488 } } } } } }, "responses": { "200": { "description": "Feedback submission result. On success, returns `status: success`. On failure, returns a 2Captcha error object.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackResponse" }, "examples": { "success": { "value": { "errorId": 0, "status": "success" } } } } } }, "402": { "description": "Payment Required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/X402PaymentRequired" }, "example": { "x402Version": 2, "error": "Payment required", "resource": { "url": "https://2captcha.x402.paysponge.com/reportIncorrect", "description": "POST /reportIncorrect", "mimeType": "application/json" }, "accepts": [ { "scheme": "exact", "network": "eip155:8453", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "eip155:43114", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "payTo": "9hw9Py9uMGtXRNpABZjifcK1t3suwzjyri9L9QYKg6zZ", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} } ] } } } } } } } }, "components": { "schemas": { "CaptchaTask": { "description": "2Captcha task definition. This local spec documents Normal CAPTCHA, reCAPTCHA v2, reCAPTCHA v3, and Rotate CAPTCHA task bodies explicitly, and keeps a generic fallback for other 2Captcha task types that are not modeled locally yet.", "anyOf": [ { "$ref": "#/components/schemas/ImageToTextTask" }, { "$ref": "#/components/schemas/RecaptchaV2TaskProxyless" }, { "$ref": "#/components/schemas/RecaptchaV2Task" }, { "$ref": "#/components/schemas/RecaptchaV3TaskProxyless" }, { "$ref": "#/components/schemas/RotateTask" }, { "$ref": "#/components/schemas/GenericCaptchaTask" } ] }, "GenericCaptchaTask": { "type": "object", "description": "Fallback schema for supported 2Captcha task types that are not documented in this local spec yet. Include the task-specific upstream fields required by that captcha type.", "properties": { "type": { "type": "string", "description": "2Captcha task type identifier, for example `TurnstileTaskProxyless`, `FunCaptchaTaskProxyless`, or another upstream task type." } }, "required": [ "type" ], "additionalProperties": true }, "ImageToTextTask": { "type": "object", "description": "Normal CAPTCHA task. Submit a distorted text image encoded as Base64. Supported image formats are JPEG, PNG, and GIF. Maximum file size is 100 kB and maximum image size is 1000 px on any side.", "properties": { "type": { "type": "string", "const": "ImageToTextTask" }, "body": { "type": "string", "description": "Captcha image encoded as Base64. Data URI format with a `data:content/type` prefix is also supported." }, "phrase": { "type": "boolean", "default": false, "description": "Set to `true` when the answer should contain at least two words separated by a space." }, "case": { "type": "boolean", "default": false, "description": "Set to `true` when the result is case-sensitive." }, "numeric": { "type": "integer", "enum": [ 0, 1, 2, 3, 4 ], "default": 0, "description": "Character-class hint: `0` no preference, `1` only numbers, `2` only letters, `3` either only numbers or only letters, `4` must contain both numbers and letters." }, "math": { "type": "boolean", "default": false, "description": "Set to `true` when the captcha requires a calculation." }, "minLength": { "type": "integer", "minimum": 0, "default": 0, "description": "Minimum answer length. `0` means no preference." }, "maxLength": { "type": "integer", "minimum": 0, "default": 0, "description": "Maximum answer length. `0` means no preference." }, "comment": { "type": "string", "description": "Optional text instruction shown to workers." }, "imgInstructions": { "type": "string", "description": "Optional Base64-encoded instruction image shown to workers." } }, "required": [ "type", "body" ], "additionalProperties": false }, "RecaptchaV2TaskProxyless": { "type": "object", "description": "Proxyless reCAPTCHA v2 task. Suitable for most cases because 2Captcha uses its own proxy pool to solve the challenge.", "properties": { "type": { "type": "string", "const": "RecaptchaV2TaskProxyless" }, "websiteURL": { "type": "string", "format": "uri", "description": "Full URL of the target page where the captcha is loaded. The page can require authentication because 2Captcha does not need to open it directly." }, "websiteKey": { "type": "string", "description": "reCAPTCHA site key from the page's `data-sitekey` or the `k` parameter used in reCAPTCHA network requests." }, "recaptchaDataSValue": { "type": "string", "description": "Optional `data-s` value. This can be required to bypass captchas on some Google services." }, "isInvisible": { "type": "boolean", "description": "Set to `true` for invisible reCAPTCHA v2 challenges." }, "userAgent": { "type": "string", "description": "Modern browser user agent string used to load the captcha." }, "cookies": { "type": "string", "description": "Cookies to set in the worker browser, formatted as `key1=value1; key2=value2`." }, "apiDomain": { "type": "string", "description": "Domain used to load the captcha, typically `google.com` or `recaptcha.net`." } }, "required": [ "type", "websiteURL", "websiteKey" ], "additionalProperties": false }, "RecaptchaV2Task": { "type": "object", "description": "reCAPTCHA v2 task with a caller-supplied proxy. Use this when Google service IP matching matters, such as Google Search or YouTube.", "properties": { "type": { "type": "string", "const": "RecaptchaV2Task" }, "websiteURL": { "type": "string", "format": "uri", "description": "Full URL of the target page where the captcha is loaded." }, "websiteKey": { "type": "string", "description": "reCAPTCHA site key from the page's `data-sitekey` or the `k` parameter used in reCAPTCHA network requests." }, "recaptchaDataSValue": { "type": "string", "description": "Optional `data-s` value. This can be required to bypass captchas on some Google services." }, "isInvisible": { "type": "boolean", "description": "Set to `true` for invisible reCAPTCHA v2 challenges." }, "userAgent": { "type": "string", "description": "Modern browser user agent string used to load the captcha." }, "cookies": { "type": "string", "description": "Cookies to set in the worker browser, formatted as `key1=value1; key2=value2`." }, "apiDomain": { "type": "string", "description": "Domain used to load the captcha, typically `google.com` or `recaptcha.net`." }, "proxyType": { "type": "string", "enum": [ "http", "socks4", "socks5" ], "description": "Proxy protocol." }, "proxyAddress": { "type": "string", "description": "Proxy IP address or hostname." }, "proxyPort": { "type": "integer", "description": "Proxy port number." }, "proxyLogin": { "type": "string", "description": "Optional username for proxy basic authentication." }, "proxyPassword": { "type": "string", "description": "Optional password for proxy basic authentication." } }, "required": [ "type", "websiteURL", "websiteKey", "proxyType", "proxyAddress", "proxyPort" ], "additionalProperties": false }, "RecaptchaV3TaskProxyless": { "type": "object", "description": "Proxyless reCAPTCHA v3 task. Returns a token that can be sent in `g-recaptcha-response` or passed to a callback.", "properties": { "type": { "type": "string", "const": "RecaptchaV3TaskProxyless" }, "websiteURL": { "type": "string", "format": "uri", "description": "Full URL of the target page where the captcha is loaded." }, "websiteKey": { "type": "string", "description": "reCAPTCHA site key from the page's `data-sitekey` or the `k` parameter used in reCAPTCHA network requests." }, "minScore": { "type": "number", "enum": [ 0.3, 0.7, 0.9 ], "description": "Required score threshold." }, "pageAction": { "type": "string", "description": "Optional reCAPTCHA action value, often taken from the page's `data-action` or the `grecaptcha.execute(..., { action })` call." }, "isEnterprise": { "type": "boolean", "description": "Set to `true` for reCAPTCHA Enterprise." }, "apiDomain": { "type": "string", "description": "Domain used to load the captcha, typically `google.com` or `recaptcha.net`." } }, "required": [ "type", "websiteURL", "websiteKey", "minScore" ], "additionalProperties": false }, "RotateTask": { "type": "object", "description": "Rotate CAPTCHA task. Submit an image encoded as Base64 and receive the angle required to place the object properly. Supported image formats are JPEG, PNG, and GIF. Maximum file size is 600 kB and maximum image size is 1000 px on any side.", "properties": { "type": { "type": "string", "const": "RotateTask" }, "body": { "type": "string", "description": "Captcha image encoded as Base64. Data URI format with a `data:content/type` prefix is also supported." }, "angle": { "type": "integer", "description": "Optional one-step rotation angle. If the UI rotates in fixed steps, divide 360 by the number of steps to compute this value." }, "comment": { "type": "string", "description": "Optional text instruction shown to workers." }, "imgInstructions": { "type": "string", "description": "Optional Base64-encoded instruction image shown to workers. Maximum file size is 100 kB." } }, "required": [ "type", "body" ], "additionalProperties": false }, "CreateTaskRequest": { "type": "object", "description": "Task creation payload for the PaySponge wrapper. This mirrors the upstream 2Captcha request body except that the separate upstream API credential field is intentionally omitted because billing happens through x402.", "properties": { "task": { "$ref": "#/components/schemas/CaptchaTask" }, "languagePool": { "type": "string", "enum": [ "en", "rn" ], "description": "Optional worker language pool. Applicable to image-based and text-based captchas. `en` selects English-speaking workers and `rn` selects Russian-speaking workers." }, "callbackUrl": { "type": "string", "format": "uri", "description": "Optional registered webhook URL that receives the captcha resolution result asynchronously." }, "softId": { "type": "integer", "description": "Optional software identifier from the 2Captcha software catalog." } }, "required": [ "task" ], "additionalProperties": false }, "CreateTaskSuccessResponse": { "type": "object", "description": "Successful task creation response.", "properties": { "errorId": { "type": "integer", "const": 0 }, "taskId": { "type": "integer", "description": "Identifier of the created task." } }, "required": [ "errorId", "taskId" ], "additionalProperties": false }, "TaskStatusRequest": { "type": "object", "description": "Result-polling payload for an existing task. This mirrors the upstream 2Captcha request body except that the separate upstream API credential field is intentionally omitted because billing happens through x402.", "properties": { "taskId": { "type": "integer", "description": "Identifier of the task returned by `POST /createTask`." } }, "required": [ "taskId" ], "additionalProperties": false }, "TaskProcessingResponse": { "type": "object", "description": "Task is still being processed. Wait at least 5 seconds before polling again.", "properties": { "errorId": { "type": "integer", "const": 0 }, "status": { "type": "string", "const": "processing" } }, "required": [ "errorId", "status" ], "additionalProperties": false }, "TaskReadyResponse": { "type": "object", "description": "Completed task result. This local spec documents solution objects for Normal CAPTCHA, reCAPTCHA v2, reCAPTCHA v3, and Rotate CAPTCHA, and keeps a generic fallback for other task types.", "properties": { "errorId": { "type": "integer", "const": 0 }, "status": { "type": "string", "const": "ready" }, "solution": { "$ref": "#/components/schemas/TaskSolution" }, "cost": { "type": "string", "description": "Task price charged from the upstream 2Captcha balance representation." }, "ip": { "type": "string", "description": "IP address that submitted the original task request." }, "createTime": { "type": "integer", "description": "Unix timestamp for task submission." }, "endTime": { "type": "integer", "description": "Unix timestamp for task completion." }, "solveCount": { "type": "integer", "description": "Number of workers that attempted the task." } }, "required": [ "errorId", "status", "solution", "cost", "ip", "createTime", "endTime", "solveCount" ], "additionalProperties": false }, "TaskSolution": { "description": "Task-specific solution object returned by 2Captcha.", "anyOf": [ { "$ref": "#/components/schemas/ImageToTextTaskSolution" }, { "$ref": "#/components/schemas/RecaptchaTokenSolution" }, { "$ref": "#/components/schemas/RotateTaskSolution" }, { "$ref": "#/components/schemas/GenericTaskSolution" } ] }, "ImageToTextTaskSolution": { "type": "object", "description": "Solved text returned for a Normal CAPTCHA.", "properties": { "text": { "type": "string", "description": "Text extracted from the captcha image." } }, "required": [ "text" ], "additionalProperties": false }, "RecaptchaTokenSolution": { "type": "object", "description": "Token solution returned for reCAPTCHA v2 or reCAPTCHA v3.", "properties": { "gRecaptchaResponse": { "type": "string", "description": "Token value to submit in the `g-recaptcha-response` field." }, "token": { "type": "string", "description": "Duplicate token field returned by 2Captcha." } }, "required": [ "gRecaptchaResponse", "token" ], "additionalProperties": false }, "RotateTaskSolution": { "type": "object", "description": "Rotation answer returned for a Rotate CAPTCHA.", "properties": { "rotate": { "type": "integer", "description": "Angle required to rotate the image into the correct position." } }, "required": [ "rotate" ], "additionalProperties": false }, "GenericTaskSolution": { "type": "object", "description": "Fallback solution schema for task types that are not documented in this local spec yet.", "additionalProperties": true }, "FeedbackRequest": { "type": "object", "description": "Feedback payload for a previously solved task. This mirrors the upstream 2Captcha request body except that the separate upstream API credential field is intentionally omitted because billing happens through x402.", "properties": { "taskId": { "type": "integer", "description": "Identifier of the task being reported." } }, "required": [ "taskId" ], "additionalProperties": false }, "FeedbackSuccessResponse": { "type": "object", "description": "Successful solve-quality feedback response.", "properties": { "errorId": { "type": "integer", "const": 0 }, "status": { "type": "string", "const": "success" } }, "required": [ "errorId", "status" ], "additionalProperties": false }, "ApiErrorResponse": { "type": "object", "description": "2Captcha error response shape used when the upstream API cannot complete the requested operation.", "properties": { "errorId": { "type": "integer", "description": "Non-zero numeric error identifier." }, "errorCode": { "type": "string", "description": "Stable upstream error code string." }, "errorDescription": { "type": "string", "description": "Human-readable upstream error description." } }, "required": [ "errorId", "errorCode", "errorDescription" ], "additionalProperties": false }, "CreateTaskResponse": { "oneOf": [ { "$ref": "#/components/schemas/CreateTaskSuccessResponse" }, { "$ref": "#/components/schemas/ApiErrorResponse" } ] }, "GetTaskResultResponse": { "oneOf": [ { "$ref": "#/components/schemas/TaskProcessingResponse" }, { "$ref": "#/components/schemas/TaskReadyResponse" }, { "$ref": "#/components/schemas/ApiErrorResponse" } ] }, "FeedbackResponse": { "oneOf": [ { "$ref": "#/components/schemas/FeedbackSuccessResponse" }, { "$ref": "#/components/schemas/ApiErrorResponse" } ] }, "X402Accept": { "type": "object", "properties": { "scheme": { "type": "string" }, "network": { "type": "string" }, "payTo": { "type": "string" }, "asset": { "type": "string" }, "amount": { "type": "string" }, "maxTimeoutSeconds": { "type": "integer" }, "extra": { "type": "object", "additionalProperties": true } }, "required": [ "scheme", "network", "payTo", "asset", "amount", "maxTimeoutSeconds" ], "additionalProperties": true }, "X402Resource": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "url", "description", "mimeType" ], "additionalProperties": true }, "X402PaymentRequired": { "type": "object", "properties": { "x402Version": { "type": "integer", "const": 2 }, "error": { "type": "string" }, "resource": { "$ref": "#/components/schemas/X402Resource" }, "accepts": { "type": "array", "items": { "$ref": "#/components/schemas/X402Accept" }, "minItems": 1 }, "extensions": { "type": "object", "additionalProperties": true } }, "required": [ "x402Version", "error", "resource", "accepts" ], "additionalProperties": true } } }, "x402Version": 2, "resource": { "url": "https://2captcha.x402.paysponge.com/", "description": "2Captcha CAPTCHA solving API — solves reCAPTCHA v2/v3, hCaptcha, Cloudflare Turnstile, FunCaptcha, GeeTest, image captchas, and more", "mimeType": "application/json" }, "accepts": [ { "scheme": "exact", "network": "eip155:8453", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "eip155:43114", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} }, { "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "payTo": "9hw9Py9uMGtXRNpABZjifcK1t3suwzjyri9L9QYKg6zZ", "asset": "usdc", "amount": "1", "maxTimeoutSeconds": 300, "extra": {} } ], "x-payment-accepts": [ { "scheme": "exact", "network": "eip155:8453", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f" }, { "scheme": "exact", "network": "eip155:43114", "payTo": "0xD73912BA30832328a3db96BeE73ebfaB58b7429f" }, { "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "payTo": "9hw9Py9uMGtXRNpABZjifcK1t3suwzjyri9L9QYKg6zZ" } ] }