Getting Started

CaptchaAI API Key Setup and Authentication

Every CaptchaAI API request requires an API key. This guide covers how to get your key, authenticate requests, check your balance, and keep your credentials secure.

Getting Your API Key

  1. Create an account at captchaai.com
  2. Log in to your dashboard
  3. Navigate to API Settings or Account
  4. Copy your API key — it looks like: abc123def456...
  5. Add funds to your balance (starting from $1)

Authentication

Every API call includes your key as a key parameter:

Submit a CAPTCHA

GET https://ocr.captchaai.com/in.php?key=YOUR_API_KEY&method=userrecaptcha&googlekey=SITE_KEY&pageurl=URL

Poll for Results

GET https://ocr.captchaai.com/res.php?key=YOUR_API_KEY&action=get&id=TASK_ID

Check Balance

GET https://ocr.captchaai.com/res.php?key=YOUR_API_KEY&action=getbalance

Code Examples

Python

import requests
import os

# Load from environment variable (recommended)
API_KEY = os.environ.get("CAPTCHAAI_API_KEY")

# Check balance
balance = requests.get("https://ocr.captchaai.com/res.php", params={
    "key": API_KEY,
    "action": "getbalance"
})
print(f"Balance: ${balance.text}")

# Submit a CAPTCHA
resp = requests.get("https://ocr.captchaai.com/in.php", params={
    "key": API_KEY,
    "method": "userrecaptcha",
    "googlekey": "6Le-wvkS...",
    "pageurl": "https://example.com"
})
print(f"Response: {resp.text}")

Node.js

const axios = require("axios");

const API_KEY = process.env.CAPTCHAAI_API_KEY;

// Check balance
const balance = await axios.get("https://ocr.captchaai.com/res.php", {
  params: { key: API_KEY, action: "getbalance" },
});
console.log(`Balance: $${balance.data}`);

// Submit a CAPTCHA
const resp = await axios.get("https://ocr.captchaai.com/in.php", {
  params: {
    key: API_KEY,
    method: "userrecaptcha",
    googlekey: "6Le-wvkS...",
    pageurl: "https://example.com",
  },
});
console.log(`Response: ${resp.data}`);

cURL

# Check balance
curl "https://ocr.captchaai.com/res.php?key=YOUR_API_KEY&action=getbalance"

# Submit reCAPTCHA v2
curl "https://ocr.captchaai.com/in.php?key=YOUR_API_KEY&method=userrecaptcha&googlekey=SITE_KEY&pageurl=https://example.com"

API Key Security

Use Environment Variables

Never hardcode your API key in source code:

# ❌ Bad — key in source code
API_KEY = "abc123def456"

# ✅ Good — key from environment
API_KEY = os.environ["CAPTCHAAI_API_KEY"]

Set the variable:

# Linux/macOS
export CAPTCHAAI_API_KEY="abc123def456"

# Windows PowerShell
$env:CAPTCHAAI_API_KEY = "abc123def456"

# Windows CMD
set CAPTCHAAI_API_KEY=abc123def456

Use .env Files

For development, use a .env file:

# .env
CAPTCHAAI_API_KEY=abc123def456
# Python
from dotenv import load_dotenv
load_dotenv()
API_KEY = os.environ["CAPTCHAAI_API_KEY"]
// Node.js
require("dotenv").config();
const API_KEY = process.env.CAPTCHAAI_API_KEY;

Add .env to your .gitignore to prevent committing credentials:

# .gitignore
.env

Rotate Keys Regularly

If you suspect a key is compromised:

  1. Log in to your CaptchaAI dashboard
  2. Generate a new API key
  3. Update your environment variables
  4. Revoke the old key

Error Responses

Response Meaning Action
ERROR_WRONG_USER_KEY Invalid API key Check key for typos
ERROR_KEY_DOES_NOT_EXIST Key not found Verify key from dashboard
ERROR_ZERO_BALANCE No funds Add balance
ERROR_IP_NOT_ALLOWED IP restriction active Add your IP to allowed list
IP_BANNED Too many invalid key attempts Wait 5 minutes; fix your key

FAQ

Do I need a different key for each CAPTCHA type?

No. One API key works for all CAPTCHA types and all API endpoints.

Is there a rate limit on API calls?

CaptchaAI allows high request rates. For very high volumes (100K+/day), contact support for dedicated capacity.

Can I use the same key across multiple projects?

Yes. One key works across all your projects and servers. For separate billing, create additional accounts.

Discussions (0)

No comments yet.

Related Posts

Explainers reCAPTCHA v2 Invisible: Trigger Detection and Solving
Detect and solve re CAPTCHA v 2 Invisible challenges with Captcha AI — identify triggers, extract parameters, and handle auto-invoked CAPTCHAs.

Detect and solve re CAPTCHA v 2 Invisible challenges with Captcha AI — identify triggers, extract parameters,...

Automation Python reCAPTCHA v2
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
Tutorials Pytest Fixtures for CaptchaAI API Testing
Build reusable pytest fixtures to test CAPTCHA-solving workflows with Captcha AI.

Build reusable pytest fixtures to test CAPTCHA-solving workflows with Captcha AI. Covers mocking, live integra...

Automation Python reCAPTCHA v2
Apr 08, 2026
API Tutorials How to Solve reCAPTCHA v2 Enterprise with Python
Solve re CAPTCHA v 2 Enterprise using Python and Captcha AI API.

Solve re CAPTCHA v 2 Enterprise using Python and Captcha AI API. Complete guide with sitekey extraction, task...

Automation Python reCAPTCHA v2
Apr 08, 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 Multi-Step Workflow Automation with CaptchaAI
Manage workflows across multiple accounts on CAPTCHA-protected platforms — , action, and data collection at scale.

Manage workflows across multiple accounts on CAPTCHA-protected platforms — , action, and data collection at sc...

Automation Python reCAPTCHA v2
Apr 06, 2026
Integrations Scrapy + CaptchaAI Integration Guide
Integrate Captcha AI into Scrapy spiders to automatically solve CAPTCHAs during web crawling with middleware and signal handlers.

Integrate Captcha AI into Scrapy spiders to automatically solve CAPTCHAs during web crawling with middleware a...

Automation reCAPTCHA v2 Scrapy
Jan 27, 2026
Troubleshooting ERROR_PAGEURL: URL Mismatch Troubleshooting Guide
Fix ERROR_PAGEURL when using Captcha AI.

Fix ERROR_PAGEURL when using Captcha AI. Diagnose URL mismatch issues, handle redirects, SPAs, and dynamic URL...

Automation Python reCAPTCHA v2
Mar 23, 2026
API Tutorials Solving CAPTCHAs with Kotlin and CaptchaAI API
Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Kotlin using Captcha AI's HTTP API with Ok Http, Ktor client, and coroutines.

Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Kotlin using Captcha AI's HTTP API with...

Automation reCAPTCHA v2 Cloudflare Turnstile
Mar 06, 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
Getting Started How to Choose the Right CAPTCHA Solving Method
Guide to selecting the correct Captcha AI method parameter for each CAPTCHA type — re CAPTCHA, Turnstile, Gee Test, image, and .

Guide to selecting the correct Captcha AI method parameter for each CAPTCHA type — re CAPTCHA, Turnstile, Gee...

Automation Cloudflare Turnstile
Mar 26, 2026
Getting Started CaptchaAI Proxy Configuration Guide
Complete guide to configuring proxies for Captcha AI.

Complete guide to configuring proxies for Captcha AI. Covers proxy formats, types (HTTP, SOCKS 5), authenticat...

Automation Python reCAPTCHA v2
Mar 14, 2026