Repolode
shenhao-stu

shenhao-stu/ohmycaptcha

Self-hostable captcha solver with a YesCaptcha-style async API, using Playwright browser automation and OpenAI-compatible vision models.

Open-source alternative to:YesCaptcha

Stars
897
Forks
276
Open issues
10
Last commit
7 months ago

What is it?

OhMyCaptcha is a self-hosted captcha-solving service that exposes the createTask, getTaskResult and getBalance endpoints used by YesCaptcha-style clients. It is built with FastAPI and is intended as a drop-in third-party solver for systems such as flow2api that expect this protocol.

The service handles two families of work. For reCAPTCHA v2/v3 (including Enterprise variants), hCaptcha and Cloudflare Turnstile, it drives headless Chromium through Playwright to produce tokens. For image captchas and classification tasks, it sends images to a vision model, either a local server such as SGLang or vLLM or a remote OpenAI-compatible endpoint.

Tasks run asynchronously and are kept in an in-memory queue with a 10-minute TTL, so results are retrieved by polling. Configuration covers model endpoints, retry and timeout limits, headless browser mode, and a client key for authentication. Deployment is documented for local machines, Render and Hugging Face Spaces.

Key features

  • 01Implements YesCaptcha-style createTask, getTaskResult and getBalance endpoints.
  • 02Solves reCAPTCHA v2/v3, hCaptcha and Cloudflare Turnstile with Playwright and Chromium.
  • 03Classifies image captchas such as HCaptcha, reCAPTCHA v2, FunCaptcha and AWS grids with a vision model.
  • 04Supports local models through SGLang or vLLM and cloud models through OpenAI-compatible APIs.
  • 05Runs tasks asynchronously with polling and a 10-minute in-memory TTL.
  • 06Deploys locally with Docker or on Render and Hugging Face Spaces.

Use cases

  • Serving as a captcha-solving backend for flow2api or other tools that speak the YesCaptcha protocol.
  • Testing how a site's reCAPTCHA, hCaptcha or Turnstile integration behaves in an authorized security assessment.
  • Running captcha recognition on your own infrastructure instead of a paid third-party service.

Quick start

  1. 1

    Create and activate a virtual environment

    python -m venv .venv && source .venv/bin/activate
  2. 2

    Install Python dependencies

    pip install -r requirements.txt
  3. 3

    Install Playwright Chromium browser

    playwright install --with-deps chromium
  4. 4

    Set model environment variables, set CLIENT_KEY, then start the server

    python main.py

Things to know

  • Tasks are stored in memory with a 10-minute TTL, so they are lost on restart.
  • Browser-based solving depends on environment, IP reputation, and target-site behavior.
  • Image classification quality depends on the vision model used.
  • Not all commercial captcha-service features are replicated, and minScore is not enforced.

Topics

FAQ

What is ohmycaptcha?
Self-hostable captcha solver with a YesCaptcha-style async API, using Playwright browser automation and OpenAI-compatible vision models. OhMyCaptcha is a self-hosted captcha-solving service that exposes the createTask, getTaskResult and getBalance endpoints used by YesCaptcha-style clients. It is built with FastAPI and is intended as a drop-in third-party solver for systems such as flow2api that expect this protocol.
Is ohmycaptcha free to use? What license does it have?
ohmycaptcha is open source under the MIT license. Check the license terms before using it in commercial products.
Is ohmycaptcha still maintained?
No commits for 6+ months. The last commit to ohmycaptcha was on Mar 9, 2026.
What can I use ohmycaptcha for?
Serving as a captcha-solving backend for flow2api or other tools that speak the YesCaptcha protocol. Testing how a site's reCAPTCHA, hCaptcha or Turnstile integration behaves in an authorized security assessment. Running captcha recognition on your own infrastructure instead of a paid third-party service.
How do I install ohmycaptcha?
Create and activate a virtual environment: python -m venv .venv && source .venv/bin/activate Install Python dependencies: pip install -r requirements.txt Install Playwright Chromium browser: playwright install --with-deps chromium Set model environment variables, set CLIENT_KEY, then start the server: python main.py
Where can I get ohmycaptcha?
The source code and installation instructions are on GitHub: https://github.com/shenhao-stu/ohmycaptcha

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects