Comparisons

Migrate from 2Captcha to CaptchaAI Step by Step

CaptchaAI uses a 2Captcha-compatible API. Migration is straightforward — change the endpoint URL and API key. Your existing request format, parameters, and error handling work unchanged.


Migration Summary

Before (2Captcha):
  URL: https://2captcha.com
  Key: YOUR_2CAPTCHA_KEY

After (CaptchaAI):
  URL: https://ocr.captchaai.com
  Key: YOUR_CAPTCHAAI_KEY

Everything else stays the same.

Step 1: Get Your CaptchaAI API Key

  1. Register at captchaai.com
  2. Add funds to your account
  3. Copy your API key from the dashboard

Step 2: Update Your Configuration

Python — Direct API

# BEFORE (2Captcha)
API_KEY = "your_2captcha_key"
API_URL = "https://2captcha.com"

# AFTER (CaptchaAI) — only these 2 lines change
API_KEY = "your_captchaai_key"
API_URL = "https://ocr.captchaai.com"

Python — Environment Variables

import os

# BEFORE
API_KEY = os.environ.get("TWOCAPTCHA_API_KEY")
API_URL = "https://2captcha.com"

# AFTER
API_KEY = os.environ.get("CAPTCHAAI_API_KEY")
API_URL = "https://ocr.captchaai.com"
# Update your .env or environment
# BEFORE
TWOCAPTCHA_API_KEY=old_key_here

# AFTER
CAPTCHAAI_API_KEY=new_key_here

Node.js

// BEFORE
const API_KEY = 'your_2captcha_key';
const API_URL = 'https://2captcha.com';

// AFTER
const API_KEY = 'your_captchaai_key';
const API_URL = 'https://ocr.captchaai.com';

Step 3: Verify API Compatibility

The request and response formats are identical:

Submit Task (in.php)

import requests

# This code works for BOTH 2Captcha and CaptchaAI
resp = requests.post(f"{API_URL}/in.php", data={
    "key": API_KEY,
    "method": "userrecaptcha",
    "googlekey": "SITE_KEY",
    "pageurl": "https://example.com",
    "json": 1,
})

result = resp.json()
# Response format: {"status": 1, "request": "TASK_ID"}
task_id = result["request"]

Poll Result (res.php)

import time

# This code works for BOTH 2Captcha and CaptchaAI
for _ in range(60):
    time.sleep(5)
    resp = requests.get(f"{API_URL}/res.php", params={
        "key": API_KEY,
        "action": "get",
        "id": task_id,
        "json": 1,
    })
    data = resp.json()
    if data["request"] != "CAPCHA_NOT_READY":
        token = data["request"]
        break

Error Codes (Same)

Error Meaning Same in Both
ERROR_WRONG_USER_KEY Invalid API key
ERROR_KEY_DOES_NOT_EXIST API key not found
ERROR_ZERO_BALANCE No funds
ERROR_CAPTCHA_UNSOLVABLE Could not solve
CAPCHA_NOT_READY Still processing

Step 4: Method Name Reference

All method names are the same:

CAPTCHA Type Method Same Format
reCAPTCHA v2 method=userrecaptcha
reCAPTCHA v3 method=userrecaptcha + version=v3
reCAPTCHA Enterprise method=userrecaptcha + enterprise=1
Invisible reCAPTCHA method=userrecaptcha + invisible=1
Cloudflare Turnstile method=turnstile
GeeTest v3 method=geetest
Image base64 method=base64
Image file method=post

CaptchaAI Exclusive Methods

CAPTCHA Type Method 2Captcha Support
Cloudflare Challenge method=cloudflare_challenge
BLS method=bls

These methods are only available after migration.


Step 5: Test the Migration

import requests
import time


def test_migration():
    """Verify CaptchaAI API is working with your key."""
    API_KEY = "your_captchaai_key"
    API_URL = "https://ocr.captchaai.com"

    # Test 1: Check balance
    resp = requests.get(f"{API_URL}/res.php", params={
        "key": API_KEY,
        "action": "getbalance",
        "json": 1,
    })
    balance = resp.json()
    print(f"Balance: ${balance['request']}")

    # Test 2: Solve a test CAPTCHA
    print("Submitting test solve...")
    resp = requests.post(f"{API_URL}/in.php", data={
        "key": API_KEY,
        "method": "userrecaptcha",
        "googlekey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
        "pageurl": "https://www.google.com/recaptcha/api2/demo",
        "json": 1,
    })
    result = resp.json()

    if result.get("status") != 1:
        print(f"Error: {result.get('request')}")
        return False

    task_id = result["request"]
    print(f"Task ID: {task_id}")

    # Poll for result
    for i in range(40):
        time.sleep(5)
        resp = requests.get(f"{API_URL}/res.php", params={
            "key": API_KEY,
            "action": "get",
            "id": task_id,
            "json": 1,
        })
        data = resp.json()
        if data["request"] != "CAPCHA_NOT_READY":
            print(f"Solved in {(i+1)*5}s")
            print(f"Token: {data['request'][:50]}...")
            return True

    print("Timeout — check API key and balance")
    return False


test_migration()

Step 6: Update Wrapper Libraries

If using 2captcha-python

# BEFORE — 2captcha official library
from twocaptcha import TwoCaptcha
solver = TwoCaptcha("your_2captcha_key")

# AFTER — use requests directly with CaptchaAI (same API format)
import requests

API_KEY = "your_captchaai_key"
API_URL = "https://ocr.captchaai.com"

# Or create a simple wrapper:
class CaptchaAISolver:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base = "https://ocr.captchaai.com"

    def recaptcha(self, sitekey, url, version="v2", **kwargs):
        data = {
            "key": self.api_key,
            "method": "userrecaptcha",
            "googlekey": sitekey,
            "pageurl": url,
            "json": 1,
        }
        if version == "v3":
            data["version"] = "v3"
            data.update(kwargs)

        resp = requests.post(f"{self.base}/in.php", data=data)
        task_id = resp.json()["request"]
        return self._poll(task_id)

    def turnstile(self, sitekey, url):
        resp = requests.post(f"{self.base}/in.php", data={
            "key": self.api_key,
            "method": "turnstile",
            "sitekey": sitekey,
            "pageurl": url,
            "json": 1,
        })
        task_id = resp.json()["request"]
        return self._poll(task_id)

    def _poll(self, task_id, timeout=120):
        import time
        for _ in range(timeout // 5):
            time.sleep(5)
            resp = requests.get(f"{self.base}/res.php", params={
                "key": self.api_key, "action": "get",
                "id": task_id, "json": 1,
            })
            data = resp.json()
            if data["request"] != "CAPCHA_NOT_READY":
                return data["request"]
        raise TimeoutError("Solve timeout")


# Usage
solver = CaptchaAISolver("your_captchaai_key")
token = solver.recaptcha("SITE_KEY", "https://example.com")

Migration Checklist

Step Action Status
1 Register at CaptchaAI
2 Get API key
3 Add funds
4 Update endpoint URL
5 Update API key
6 Test with balance check
7 Test with demo CAPTCHA
8 Test with production site
9 Monitor for 24 hours
10 Deploy to production

Troubleshooting

Issue Cause Fix
ERROR_WRONG_USER_KEY Using 2Captcha key Use CaptchaAI API key
ERROR_ZERO_BALANCE No funds in CaptchaAI Add funds at captchaai.com
Old endpoint still used Config not updated Search codebase for 2captcha.com
Library conflicts 2captcha-python installed Use direct requests or CaptchaAI wrapper

FAQ

How long does the migration take?

For direct API users: 5 minutes (change URL and key). For wrapper library users: 15-30 minutes to replace the library calls.

Can I run both 2Captcha and CaptchaAI simultaneously?

Yes. Route some traffic to each during a transition period. Compare performance, then fully cut over.

Will my existing error handling work?

Yes. CaptchaAI returns the same error codes and response format as 2Captcha.



Migration takes 5 minutes — start with CaptchaAI today.

Discussions (0)

No comments yet.

Related Posts

Comparisons Migrate from Anti-Captcha to CaptchaAI Step by Step
Step-by-step guide to migrate from Anti-Captcha's custom JSON API to Captcha AI's 2 Captcha-compatible format.

Step-by-step guide to migrate from Anti-Captcha's custom JSON API to Captcha AI's 2 Captcha-compatible format....

Automation Python All CAPTCHA Types
Mar 16, 2026
Comparisons Token-Based vs Cookie-Based CAPTCHA Solving
Understand the difference between token-based and cookie-based CAPTCHA solving — when to use each approach, how they work, and implementation examples.

Understand the difference between token-based and cookie-based CAPTCHA solving — when to use each approach, ho...

Automation Python All CAPTCHA Types
Jan 25, 2026
Reference Migrate from EndCaptcha to CaptchaAI: API Mapping Guide
Map End Captcha API calls to Captcha AI equivalents — endpoint changes, parameter differences, code examples, and a step-by-step migration plan.

Map End Captcha API calls to Captcha AI equivalents — endpoint changes, parameter differences, code examples,...

Automation Python All CAPTCHA Types
Jan 20, 2026
Reference Migrate from AZCaptcha to CaptchaAI: Complete Guide
Step-by-step migration from AZCaptcha to Captcha AI — endpoint mapping, parameter differences, code changes, and parallel testing for a safe transition.

Step-by-step migration from AZCaptcha to Captcha AI — endpoint mapping, parameter differences, code changes, a...

Automation Python All CAPTCHA Types
Feb 09, 2026
Comparisons Parallel vs Sequential CAPTCHA Solving: Performance Trade-offs
Compare parallel and sequential CAPTCHA solving approaches — throughput, resource usage, cost, and complexity trade-offs with Captcha AI examples.

Compare parallel and sequential CAPTCHA solving approaches — throughput, resource usage, cost, and complexity...

Automation Python All CAPTCHA Types
Feb 01, 2026
Comparisons Migrate from CapSolver to CaptchaAI Step by Step
Step-by-step guide to migrate from Cap Solver to Captcha AI.

Step-by-step guide to migrate from Cap Solver to Captcha AI. API differences, code examples, and why Captcha A...

Automation Python All CAPTCHA Types
Feb 23, 2026
Reference Migrate from NextCaptcha to CaptchaAI: Complete Guide
Migrate from Next Captcha to Captcha AI — endpoint mapping, parameter translation, code examples in Python and Java Script, and a parallel testing strategy.

Migrate from Next Captcha to Captcha AI — endpoint mapping, parameter translation, code examples in Python and...

Automation Python All CAPTCHA Types
Jan 30, 2026
Explainers CaptchaAI JSON API vs Form API: Which Format to Use
Compare Captcha AI's JSON and form-encoded API formats.

Compare Captcha AI's JSON and form-encoded API formats. Learn when to use each, with code examples in Python a...

Automation Python All CAPTCHA Types
Feb 20, 2026
DevOps & Scaling Ansible Playbooks for CaptchaAI Worker Deployment
Deploy and manage Captcha AI workers with Ansible — playbooks for provisioning, configuration, rolling updates, and health checks across your server fleet.

Deploy and manage Captcha AI workers with Ansible — playbooks for provisioning, configuration, rolling updates...

Automation Python All CAPTCHA Types
Apr 07, 2026
DevOps & Scaling Blue-Green Deployment for CAPTCHA Solving Infrastructure
Implement blue-green deployments for CAPTCHA solving infrastructure — zero-downtime upgrades, traffic switching, and rollback strategies with Captcha AI.

Implement blue-green deployments for CAPTCHA solving infrastructure — zero-downtime upgrades, traffic switchin...

Automation Python All CAPTCHA Types
Apr 07, 2026
Comparisons ISP Proxies vs Datacenter Proxies for CAPTCHA Solving
Compare ISP and datacenter proxies for CAPTCHA solving — detection rates, speed, cost, and which works best with Captcha AI.

Compare ISP and datacenter proxies for CAPTCHA solving — detection rates, speed, cost, and which works best wi...

reCAPTCHA v2 Cloudflare Turnstile reCAPTCHA v3
Apr 05, 2026
Comparisons WebDriver vs Chrome DevTools Protocol for CAPTCHA Automation
Compare Web Driver and Chrome Dev Tools Protocol (CDP) for CAPTCHA automation — detection, performance, capabilities, and when to use each with Captcha AI.

Compare Web Driver and Chrome Dev Tools Protocol (CDP) for CAPTCHA automation — detection, performance, capabi...

Automation Python reCAPTCHA v2
Mar 27, 2026
Comparisons Free vs Paid CAPTCHA Solvers: What You Need to Know
Compare free and paid CAPTCHA solving tools — browser extensions, open-source solvers, and API services — covering reliability, speed, type support, and cost.

Compare free and paid CAPTCHA solving tools — browser extensions, open-source solvers, and API services — cove...

Automation All CAPTCHA Types Migration
Jan 23, 2026