Reference

Migrate from AZCaptcha to CaptchaAI: Complete Guide

AZCaptcha and CaptchaAI both use a 2Captcha-compatible API format, making migration straightforward. You'll mostly change the base URL and API key — the request format stays the same.

Endpoint Mapping

Action AZCaptcha CaptchaAI
Submit task https://azcaptcha.com/in.php https://ocr.captchaai.com/in.php
Get result https://azcaptcha.com/res.php https://ocr.captchaai.com/res.php
Check balance res.php?action=getbalance res.php?action=getbalance
Report incorrect res.php?action=reportbad res.php?action=reportbad

Parameter Compatibility

Most parameters are identical. Key differences:

Parameter AZCaptcha CaptchaAI Notes
key API key API key Different key — get yours at captchaai.com
method userrecaptcha userrecaptcha Same
googlekey Site key Site key Same
pageurl Page URL Page URL Same
json 1 1 Same
proxy user:pass@host:port user:pass@host:port Same format
proxytype HTTP/SOCKS5 HTTP/SOCKS5 Same

Migration Steps

Step 1: Get CaptchaAI API Key

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

Step 2: Update Your Code

Python — Before (AZCaptcha)

import requests

API_KEY = "your_azcaptcha_key"

def solve_recaptcha(sitekey, pageurl):
    # Submit
    resp = requests.post("https://azcaptcha.com/in.php", data={
        "key": API_KEY,
        "method": "userrecaptcha",
        "googlekey": sitekey,
        "pageurl": pageurl,
        "json": 1
    })
    data = resp.json()
    if data["status"] != 1:
        return {"error": data["request"]}

    captcha_id = data["request"]

    # Poll
    import time
    for _ in range(60):
        time.sleep(5)
        result = requests.get("https://azcaptcha.com/res.php", params={
            "key": API_KEY, "action": "get", "id": captcha_id, "json": 1
        }).json()
        if result["status"] == 1:
            return {"solution": result["request"]}
        if result["request"] != "CAPCHA_NOT_READY":
            return {"error": result["request"]}

    return {"error": "TIMEOUT"}

Python — After (CaptchaAI)

import os
import time
import requests

API_KEY = os.environ["CAPTCHAAI_API_KEY"]  # Changed: use env var

def solve_recaptcha(sitekey, pageurl):
    # Submit — only URL changed
    resp = requests.post("https://ocr.captchaai.com/in.php", data={
        "key": API_KEY,
        "method": "userrecaptcha",
        "googlekey": sitekey,
        "pageurl": pageurl,
        "json": 1
    })
    data = resp.json()
    if data.get("status") != 1:
        return {"error": data.get("request")}

    captcha_id = data["request"]

    # Poll — only URL changed
    for _ in range(60):
        time.sleep(5)
        result = requests.get("https://ocr.captchaai.com/res.php", params={
            "key": API_KEY, "action": "get", "id": captcha_id, "json": 1
        }).json()
        if result.get("status") == 1:
            return {"solution": result["request"]}
        if result.get("request") != "CAPCHA_NOT_READY":
            return {"error": result.get("request")}

    return {"error": "TIMEOUT"}

JavaScript — Before (AZCaptcha)

const axios = require("axios");
const API_KEY = "your_azcaptcha_key";

async function solveRecaptcha(sitekey, pageurl) {
  const submit = await axios.post("https://azcaptcha.com/in.php", null, {
    params: { key: API_KEY, method: "userrecaptcha", googlekey: sitekey, pageurl, json: 1 },
  });
  if (submit.data.status !== 1) return { error: submit.data.request };

  const captchaId = submit.data.request;
  for (let i = 0; i < 60; i++) {
    await new Promise((r) => setTimeout(r, 5000));
    const poll = await axios.get("https://azcaptcha.com/res.php", {
      params: { key: API_KEY, action: "get", id: captchaId, json: 1 },
    });
    if (poll.data.status === 1) return { solution: poll.data.request };
    if (poll.data.request !== "CAPCHA_NOT_READY") return { error: poll.data.request };
  }
  return { error: "TIMEOUT" };
}

JavaScript — After (CaptchaAI)

const axios = require("axios");
const API_KEY = process.env.CAPTCHAAI_API_KEY;  // Changed: env var

async function solveRecaptcha(sitekey, pageurl) {
  // Only URLs changed
  const submit = await axios.post("https://ocr.captchaai.com/in.php", null, {
    params: { key: API_KEY, method: "userrecaptcha", googlekey: sitekey, pageurl, json: 1 },
  });
  if (submit.data.status !== 1) return { error: submit.data.request };

  const captchaId = submit.data.request;
  for (let i = 0; i < 60; i++) {
    await new Promise((r) => setTimeout(r, 5000));
    const poll = await axios.get("https://ocr.captchaai.com/res.php", {
      params: { key: API_KEY, action: "get", id: captchaId, json: 1 },
    });
    if (poll.data.status === 1) return { solution: poll.data.request };
    if (poll.data.request !== "CAPCHA_NOT_READY") return { error: poll.data.request };
  }
  return { error: "TIMEOUT" };
}

Step 3: Abstract the Provider

For safer migration, create a provider-agnostic wrapper:

import os
import time
import requests


class CaptchaProvider:
    def __init__(self, base_url, api_key):
        self.submit_url = f"{base_url}/in.php"
        self.result_url = f"{base_url}/res.php"
        self.api_key = api_key
        self.session = requests.Session()

    def solve(self, sitekey, pageurl, method="userrecaptcha"):
        resp = self.session.post(self.submit_url, data={
            "key": self.api_key,
            "method": method,
            "googlekey": sitekey,
            "pageurl": pageurl,
            "json": 1
        })
        data = resp.json()
        if data.get("status") != 1:
            return {"error": data.get("request")}

        captcha_id = data["request"]
        for _ in range(60):
            time.sleep(5)
            result = self.session.get(self.result_url, params={
                "key": self.api_key, "action": "get",
                "id": captcha_id, "json": 1
            }).json()
            if result.get("status") == 1:
                return {"solution": result["request"]}
            if result.get("request") != "CAPCHA_NOT_READY":
                return {"error": result.get("request")}
        return {"error": "TIMEOUT"}


# Switch by changing one line:
# provider = CaptchaProvider("https://azcaptcha.com", "old_key")
provider = CaptchaProvider(
    "https://ocr.captchaai.com",
    os.environ["CAPTCHAAI_API_KEY"]
)

Step 4: Parallel Test

Run both providers simultaneously to compare:

def parallel_test(sitekey, pageurl, runs=10):
    azcaptcha = CaptchaProvider("https://azcaptcha.com", "old_key")
    captchaai = CaptchaProvider(
        "https://ocr.captchaai.com",
        os.environ["CAPTCHAAI_API_KEY"]
    )

    results = {"azcaptcha": [], "captchaai": []}

    for i in range(runs):
        start = time.time()
        az_result = azcaptcha.solve(sitekey, pageurl)
        results["azcaptcha"].append({
            "success": "solution" in az_result,
            "time": time.time() - start
        })

        start = time.time()
        cai_result = captchaai.solve(sitekey, pageurl)
        results["captchaai"].append({
            "success": "solution" in cai_result,
            "time": time.time() - start
        })

    for provider, data in results.items():
        successes = sum(1 for r in data if r["success"])
        avg_time = sum(r["time"] for r in data) / len(data)
        print(f"{provider}: {successes}/{runs} success, {avg_time:.1f}s avg")

Migration Checklist

Step Status
Create CaptchaAI account and fund it
Replace base URL in all files
Update API key (use env var)
Run parallel test (10+ solves)
Compare success rates
Compare solve times
Update monitoring/alerting for new endpoints
Switch production traffic
Monitor for 24 hours
Decommission AZCaptcha key

Troubleshooting

Issue Cause Fix
ERROR_KEY_DOES_NOT_EXIST Wrong API key Verify CaptchaAI API key from dashboard
ERROR_ZERO_BALANCE No funds in new account Add funds at captchaai.com
Different error codes Minor error code differences Map error codes; most are identical
Solve rate differs Different solver pools Run 50+ test solves for statistically valid comparison

FAQ

Is CaptchaAI a drop-in replacement for AZCaptcha?

Nearly. Both use the 2Captcha-compatible API format. Change the base URL and API key — parameters and response format are the same.

Will my existing proxy configuration work?

Yes. CaptchaAI uses the same proxy and proxytype parameters. No changes needed for proxy-based solving.

How long does migration take?

For a single codebase, 15–30 minutes. Most of that is updating the base URL with search-and-replace, plus running a parallel test to verify.

Next Steps

Switch to faster, more reliable CAPTCHA solving — get your CaptchaAI API key and migrate in minutes.

Related guides:

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
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
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 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
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
Comparisons Migrate from 2Captcha to CaptchaAI Step by Step
Complete step-by-step migration guide from 2 Captcha to Captcha AI.

Complete step-by-step migration guide from 2 Captcha to Captcha AI. Same API format — change the URL and API k...

Automation Python All CAPTCHA Types
Feb 23, 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
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