NexusClearance API

A self-hosted HTTP microservice for solving Cloudflare challenges, AWS WAF, and CAPTCHAs via a real patched Chromium browser.

Quick Start

Docker

docker run -d \
  -p 3000:3000 \
  --shm-size=2g \
  --cap-add=SYS_ADMIN \
  nexustechpro/clearance:latest

First Request

curl -X POST http://localhost:3000/bypass \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","mode":"cloudflare"}'

Response

{
  "success": true,
  "data": {
    "cf_clearance": "abc123...",
    "userAgent": "Mozilla/5.0 ...",
    "cookies": [ { "name": "cf_clearance", "value": "abc123...", ... } ],
    "title": "Example Domain",
    "finalUrl": "https://example.com/",
    "solveMs": 4200,
    "mode": "cloudflare"
  }
}

FlareSolverr Migration

NexusClearance is a drop-in replacement for FlareSolverr v3.x. Change one setting in your tool (Prowlarr, Jackett, etc.):

# Before
FlareSolverr URL: http://flaresolverr:8191

# After — that's it
FlareSolverr URL: http://nexus-clearance:3000

The /v1 endpoint accepts identical request/response shapes including session management.

POST /bypass

Universal solver endpoint. Supports all 10 solver modes.

POST/bypass
FieldTypeRequiredDescription
urlstringrequiredTarget URL to solve
modestringoptionalSolver mode (default: cloudflare)
siteKeystringoptionalRequired for turnstile-min
waitFornumberoptionalms to wait after solve (max 10000)
getPageSourcebooleanoptionalInclude full HTML in response
useProxybooleanoptionalUse auto proxy from pool
proxyobjectoptionalManual proxy: {host, port, protocol, username, password}
countrystringoptionalProxy country filter: HK, KH, TW, KR, VN
setCookiesarrayoptionalInject cookies before navigation
interceptarrayoptionalCapture in-flight responses: [{url, type}]
actionsarrayoptionalActions pipeline executed sequentially after page load (see below)
sessionIdstringoptionalReuses a dedicated persistent browser context & open tab for up to 5 minutes (auto-destroyed after 5 mins TTL). DOM and cookies persist across multiple /bypass requests.
asyncbooleanoptionalFire-and-forget, returns jobId
webhookobjectoptionalPOST result to URL when done: {url, method, headers}

Actions Pipeline

15 action types executed sequentially: click, type, scroll, hover, select, keypress, wait, navigate, waitForSelector, waitForText, waitForURL, evaluate, evaluateAndReturn, screenshot, and resolve.

"actions": [
  { "type": "waitForSelector", "selector": "#login-btn" },
  { "type": "click", "selector": "#login-btn" },
  { "type": "type", "selector": "#email", "value": "user@example.com" },
  { "type": "wait", "ms": 500 },
  { "type": "evaluateAndReturn", "script": "return document.title", "name": "pageTitle" },
  { "type": "screenshot", "name": "after_login", "fullPage": false }
]

Visual AI & Canvas Solver: resolve

The resolve action provides universal, caller-driven visual puzzle solving. NexusClearance captures the target element, injects the base64 image into your custom HTTP request, calls your AI vision model (Google Gemini, OpenAI GPT-4o, Anthropic Claude, or a custom solver), parses the target coordinates, and executes a human-like Bezier mouse movement and click directly on the canvas.

Available Body Placeholders:

Example 1: Google Gemini Flash Vision Solver

{
  "url": "https://example.com/login",
  "mode": "cloudflare",
  "sessionId": "user_session_1",
  "actions": [
    { "type": "waitForSelector", "selector": "canvas#captcha" },
    {
      "type": "resolve",
      "selector": "canvas#captcha",
      "request": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.6-flash:generateContent?key=YOUR_API_KEY",
        "method": "POST",
        "headers": { "Content-Type": "application/json" },
        "body": {
          "contents": [{
            "parts": [
              { "text": "Locate the target puzzle coordinates x and y within width {{w}} and height {{h}}. Output strictly JSON: {\"x\": number, \"y\": number}" },
              { "inline_data": { "mime_type": "image/png", "data": "{{image}}" } }
            ]
          }]
        }
      },
      "timeout": 25000
    },
    { "type": "wait", "ms": 1500 }
  ]
}

Example 2: OpenAI GPT-4o Vision Solver

{
  "url": "https://example.com/portal",
  "mode": "cloudflare",
  "actions": [
    {
      "type": "resolve",
      "selector": "canvas#captcha-box",
      "request": {
        "url": "https://api.openai.com/v1/chat/completions",
        "method": "POST",
        "headers": {
          "Content-Type": "application/json",
          "Authorization": "Bearer YOUR_OPENAI_KEY"
        },
        "body": {
          "model": "gpt-4o",
          "response_format": { "type": "json_object" },
          "messages": [{
            "role": "user",
            "content": [
              { "type": "text", "text": "Locate target coordinates x and y within width {{w}} and height {{h}}. Output strictly JSON: {\"x\": number, \"y\": number}" },
              { "type": "image_url", "image_url": { "url": "data:image/png;base64,{{image}}" } }
            ]
          }]
        }
      }
    }
  ]
}

POST /bypass/batch

POST/bypass/batch
{
  "requests": [
    { "url": "https://site1.com", "mode": "cloudflare" },
    { "url": "https://site2.com", "mode": "cf-clearance" }
  ]
}
// Response: { "success": true, "data": { "jobs": [{ "jobId": "uuid", "url": "..." }] } }

Shorthand Mode Endpoints

EndpointModeReturns
POST /cloudflarecloudflareFull BypassResult
POST /turnstile-minturnstile-min{token}
POST /turnstile-maxturnstile-max{token}
POST /cf-clearancecf-clearance{cf_clearance, userAgent}
POST /waf-sessionwaf-session{cookies, headers}
POST /sourcesource{source}
POST /hcaptchahcaptcha{token}
POST /recaptcha-v2recaptcha-v2{token}
POST /recaptcha-v3recaptcha-v3{token, score}
POST /aws-wafaws-waf{aws_waf_token, cookies}

Job Queue

GET/job/:id
GET/jobs
// Poll pattern
POST /bypass { "async": true } → { "jobId": "uuid", "status": "pending" }
GET /job/uuid → { "status": "done"|"failed"|"pending", "result": {...}, "error": null }

Sessions & Persistent Browser Contexts

Persistent sessions allow multiple /bypass requests or direct page interactions to share the same isolated browser context and open page tab without re-initializing browser state or losing cookies. Every persistent session has a hard 5-minute auto-destroy TTL (300,000 ms) to guarantee system memory is always reclaimed.

GET/sessions
POST/session/destroy
POST/session/get
POST/session/post

Listing Active Sessions

// GET /sessions
// Response:
{
  "success": true,
  "data": [
    {
      "sessionId": "user_session_1",
      "createdAt": "2026-09-12T18:00:00.000Z",
      "expiresInMs": 240000
    }
  ]
}

Destroying Sessions

// Destroy a specific session immediately
POST /session/destroy
{ "sessionId": "user_session_1" }

// Or terminate all active sessions at once
POST /session/destroy
{ "sessionId": "all" }

Direct Session Navigation

// Navigate or submit forms within the session's active tab
POST /session/get  { "url": "https://example.com/dashboard", "sessionId": "user_session_1" }
POST /session/post { "url": "https://example.com/settings", "sessionId": "user_session_1", "fields": { "#email": "user@example.com" } }

Proxy Endpoints

GET/get-proxy?country=HK
POST/proxies/ban
POST/proxies/refresh

Proxy pool auto-refreshes every 5 minutes from ProxyScrape v4 (HK, KH, TW, KR, VN — elite anonymity, >80% uptime, <2000ms). New proxies start at score 3/5; banned after 3 failures.

Environment Variables

VariableDefaultDescription
PORT3000HTTP server port
TIMEOUT_MS120000Global solver timeout per request (ms)
BROWSER_LIMIT20Max concurrent browser contexts
CONTEXT_POOL_SIZE1Pre-warmed context pool size (need 2GB+ RAM to increase)
BATCH_LIMIT10Max requests per /bypass/batch
JOB_TTL_MS300000Job expiry time (ms)
MEMORY_LIMIT_MB1024Heap threshold for memory manager (MB)
GEMINI_KEYSComma-separated Gemini API keys for hCaptcha fallback
HEADEDfalseRun browser in headed (visible) mode
TRANSFORMERS_CACHE/tmp/whisper-cacheXenova/Transformers model cache path

Error Codes

CodeHTTPWhen
NOT_READY503Browser not initialized yet
TOO_MANY429At BROWSER_LIMIT capacity
BAD_REQUEST400Invalid URL, missing required field, invalid mode
FAILED500Solver threw — challenge not solved, timeout, context crash
NOT_FOUND404Job ID not found, unknown route
NO_PROXY503Proxy pool empty or exhausted

Solver Comparison

ModeSpeedWhat it solvesUse when
cloudflareMediumFull CF bypassNeed full cookie set + source
cf-clearanceFastCF cookie onlyJust need the clearance cookie
turnstile-minFastestTurnstile tokenYou have the siteKey, no live page needed
turnstile-maxMediumTurnstile from live pageWidget embedded in real CF page
waf-sessionMediumCF cookies + headersNeed to replay via CycleTLS/curl
sourceMediumPage HTML after CF clearsScraping CF-protected content
hcaptchaSlowhCaptcha tokenSite uses hCaptcha (not CF)
recaptcha-v2SlowreCAPTCHA v2 tokenAudio challenge approach
recaptcha-v3MediumreCAPTCHA v3 token + scoreBehaviour-based, no visual challenge
aws-wafMediumAWS WAF token cookieAmazon/AWS-protected endpoints