Reference

CaptchaAI Emulator: Drop-In Replacement for 2Captcha and AntiCaptcha

CaptchaAI's API follows the same request/response format used by 2Captcha. If your code already integrates with 2Captcha, you can switch to CaptchaAI by changing the base URL and API key — no other code changes needed.


2Captcha compatibility

CaptchaAI uses the same endpoint structure and parameter names as 2Captcha:

Endpoint 2Captcha CaptchaAI
Submit https://2captcha.com/in.php https://ocr.captchaai.com/in.php
Result https://2captcha.com/res.php https://ocr.captchaai.com/res.php
API key param key key
Response format status + request status + request

Parameters like method, googlekey, pageurl, json, proxy, proxytype, action are identical.


Switch from 2Captcha: One-line change

Python

# Before
BASE_URL = "https://2captcha.com"

# After
BASE_URL = "https://ocr.captchaai.com"

Your existing submit and poll code works without any other changes:

import requests
import time

API_KEY = "YOUR_CAPTCHAAI_KEY"
BASE_URL = "https://ocr.captchaai.com"  # changed from 2captcha.com

# Submit — identical parameters
resp = requests.post(f"{BASE_URL}/in.php", data={
    "key": API_KEY,
    "method": "userrecaptcha",
    "googlekey": "6Le-SITEKEY",
    "pageurl": "https://example.com",
    "json": "1",
}).json()
task_id = resp["request"]

# Poll — identical parameters
for _ in range(24):
    time.sleep(5)
    result = requests.get(f"{BASE_URL}/res.php", params={
        "key": API_KEY, "action": "get", "id": task_id, "json": "1"
    }).json()
    if result["status"] == 1:
        print(f"Token: {result['request'][:50]}...")
        break

JavaScript

// Before
const BASE_URL = 'https://2captcha.com';

// After
const BASE_URL = 'https://ocr.captchaai.com';

// Everything else stays the same

AntiCaptcha adapter

AntiCaptcha uses a different API format (JSON-based). Build an adapter that translates AntiCaptcha calls to CaptchaAI:

import requests
import time

API_KEY = "YOUR_CAPTCHAAI_KEY"

class AntiCaptchaAdapter:
    """Translates AntiCaptcha-style calls to CaptchaAI API."""

    def __init__(self, api_key):
        self.api_key = api_key
        self.base = "https://ocr.captchaai.com"

    def createTask(self, task):
        """AntiCaptcha-compatible createTask."""
        task_type = task.get("type", "")
        data = {"key": self.api_key, "json": "1"}

        if "Recaptcha" in task_type:
            data["method"] = "userrecaptcha"
            data["googlekey"] = task.get("websiteKey", "")
            data["pageurl"] = task.get("websiteURL", "")
            if task.get("isInvisible"):
                data["invisible"] = "1"
        elif "Image" in task_type:
            data["method"] = "base64"
            data["body"] = task.get("body", "")
        elif "Turnstile" in task_type:
            data["method"] = "turnstile"
            data["sitekey"] = task.get("websiteKey", "")
            data["pageurl"] = task.get("websiteURL", "")

        resp = requests.post(f"{self.base}/in.php", data=data).json()
        if resp["status"] != 1:
            return {"errorId": 1, "errorDescription": resp["request"]}
        return {"errorId": 0, "taskId": resp["request"]}

    def getTaskResult(self, task_id):
        """AntiCaptcha-compatible getTaskResult."""
        resp = requests.get(f"{self.base}/res.php", params={
            "key": self.api_key,
            "action": "get",
            "id": task_id,
            "json": "1",
        }).json()

        if resp["request"] == "CAPCHA_NOT_READY":
            return {"status": "processing"}
        if resp["status"] == 1:
            return {
                "status": "ready",
                "solution": {"gRecaptchaResponse": resp["request"]}
            }
        return {"errorId": 1, "errorDescription": resp["request"]}

    def getBalance(self):
        """AntiCaptcha-compatible getBalance."""
        resp = requests.get(f"{self.base}/res.php", params={
            "key": self.api_key,
            "action": "getbalance",
            "json": "1",
        }).json()
        return {"balance": float(resp["request"])}


# Usage — same interface as AntiCaptcha
adapter = AntiCaptchaAdapter("YOUR_CAPTCHAAI_KEY")

result = adapter.createTask({
    "type": "RecaptchaV2TaskProxyless",
    "websiteURL": "https://example.com",
    "websiteKey": "6Le-SITEKEY",
})
task_id = result["taskId"]

while True:
    time.sleep(5)
    status = adapter.getTaskResult(task_id)
    if status["status"] == "ready":
        token = status["solution"]["gRecaptchaResponse"]
        print(f"Token: {token[:50]}...")
        break

Using existing 2Captcha SDK libraries

Many 2Captcha SDK libraries let you configure the base URL:

Python (2captcha-python)

from twocaptcha import TwoCaptcha

solver = TwoCaptcha(
    "YOUR_CAPTCHAAI_KEY",
    server="ocr.captchaai.com"  # redirect to CaptchaAI
)

result = solver.recaptcha(
    sitekey="6Le-SITEKEY",
    url="https://example.com"
)
print(result["code"][:50] + "...")

JavaScript (2captcha-javascript)

const Captcha = require('2captcha');

const solver = new Captcha.Solver('YOUR_CAPTCHAAI_KEY');
solver.apiBaseUrl = 'https://ocr.captchaai.com';

const result = await solver.recaptcha('6Le-SITEKEY', 'https://example.com');
console.log(result.data.substring(0, 50) + '...');

Compatibility checklist

Feature Compatible?
reCAPTCHA v2 Yes
reCAPTCHA v3 Yes
reCAPTCHA Enterprise Yes
Cloudflare Turnstile Yes
Image/OCR Yes
GeeTest v3 Yes
pingback (webhook) Yes
proxy / proxytype Yes
reportbad / reportgood Yes
getbalance Yes

FAQ

Is CaptchaAI literally the same API as 2Captcha?

CaptchaAI uses the same in.php/res.php endpoint format and parameter names. Response structure is identical. You can switch by changing the base URL.

Do I need to change error handling?

No. Error codes like ERROR_WRONG_USER_KEY, ERROR_ZERO_BALANCE, and CAPCHA_NOT_READY use the same names and format.

Can I switch back if needed?

Yes. Since the API is compatible, switching back is also a one-line URL change.


Switch to CaptchaAI with zero code changes

Get your API key at captchaai.com.


Discussions (0)

No comments yet.

Related Posts

Use Cases Automated Form Submission with CAPTCHA Handling
Complete guide to automating web form submissions that include CAPTCHA challenges — re CAPTCHA, Turnstile, and image CAPTCHAs with Captcha AI.

Complete guide to automating web form submissions that include CAPTCHA challenges — re CAPTCHA, Turnstile, and...

Python reCAPTCHA v2 Cloudflare Turnstile
Mar 21, 2026
Explainers Reducing CAPTCHA Solve Costs: 10 Strategies
Cut CAPTCHA solving costs with Captcha AI using 10 practical strategies — from skipping unnecessary solves to batching and caching tokens.

Cut CAPTCHA solving costs with Captcha AI using 10 practical strategies — from skipping unnecessary solves to...

Python reCAPTCHA v2 Cloudflare Turnstile
Mar 11, 2026
Use Cases Supply Chain Monitoring with CAPTCHA Handling
Monitor supply chain data from manufacturer sites, logistics portals, and inventory systems protected by CAPTCHAs using Captcha AI.

Monitor supply chain data from manufacturer sites, logistics portals, and inventory systems protected by CAPTC...

Python reCAPTCHA v2 Cloudflare Turnstile
Jan 15, 2026
Tutorials CAPTCHA Solving Fallback Chains
Implement fallback chains for CAPTCHA solving with Captcha AI.

Implement fallback chains for CAPTCHA solving with Captcha AI. Cascade through solver methods, proxy pools, an...

Automation Python reCAPTCHA v2
Apr 06, 2026
Use Cases Shipping and Logistics Rate Scraping with CAPTCHA Solving
Scrape shipping rates, tracking data, and logistics information from carrier websites protected by CAPTCHAs using Captcha AI.

Scrape shipping rates, tracking data, and logistics information from carrier websites protected by CAPTCHAs us...

Python reCAPTCHA v2 Cloudflare Turnstile
Jan 25, 2026
API Tutorials CaptchaAI API Latency Optimization: Faster Solves
Reduce CAPTCHA solve latency with Captcha AI by optimizing poll intervals, connection pooling, prefetching, and proxy selection.

Reduce CAPTCHA solve latency with Captcha AI by optimizing poll intervals, connection pooling, prefetching, an...

Automation Python reCAPTCHA v2
Feb 27, 2026
API Tutorials Building a Python Wrapper Library for CaptchaAI API
Build a reusable Python wrapper library for the Captcha AI API with type hints, retry logic, context managers, and support for CAPTCHA types.

Build a reusable Python wrapper library for the Captcha AI API with type hints, retry logic, context managers,...

Automation Python reCAPTCHA v2
Jan 31, 2026
Getting Started Migrate from CapMonster Cloud to CaptchaAI
Step-by-step guide to migrate from Cap Monster Cloud to Captcha AI — endpoint mapping, parameter changes, and code migration examples.

Step-by-step guide to migrate from Cap Monster Cloud to Captcha AI — endpoint mapping, parameter changes, and...

Python reCAPTCHA v2 Cloudflare Turnstile
Mar 29, 2026
Tutorials Reusable CAPTCHA Modules for Client Projects
Build reusable CAPTCHA-solving modules for client projects using Captcha AI.

Build reusable CAPTCHA-solving modules for client projects using Captcha AI. Package solving logic into import...

Python reCAPTCHA v2 Cloudflare Turnstile
Feb 20, 2026
Reference CAPTCHA Token Injection Methods Reference
Complete reference for injecting solved CAPTCHA tokens into web pages.

Complete reference for injecting solved CAPTCHA tokens into web pages. Covers re CAPTCHA, Turnstile, and Cloud...

Automation Python reCAPTCHA v2
Apr 08, 2026
Reference API Endpoint Mapping: CaptchaAI vs Competitors
Side-by-side API endpoint comparison between Captcha AI, 2 Captcha, Anti-Captcha, and Cap Monster — endpoints, parameters, and response formats.

Side-by-side API endpoint comparison between Captcha AI, 2 Captcha, Anti-Captcha, and Cap Monster — endpoints,...

All CAPTCHA Types Migration
Feb 05, 2026
Reference Browser Session Persistence for CAPTCHA Workflows
Manage browser sessions, cookies, and storage across CAPTCHA-solving runs to reduce repeat challenges and maintain authenticated state.

Manage browser sessions, cookies, and storage across CAPTCHA-solving runs to reduce repeat challenges and main...

Automation Python reCAPTCHA v2
Feb 24, 2026
Reference CaptchaAI CLI Tool: Command-Line CAPTCHA Solving and Testing
A reference for building and using a Captcha AI command-line tool — solve CAPTCHAs, check balance, test parameters, and integrate with shell scripts and CI/CD p...

A reference for building and using a Captcha AI command-line tool — solve CAPTCHAs, check balance, test parame...

Automation Python All CAPTCHA Types
Feb 26, 2026