selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

ohmycaptcha logo

Self-host ohmycaptcha

YesCaptcha-style captcha solver API in FastAPI

BetaOpen SourceMIT
Updated7 months ago
LanguagePython
Setup difficultyModerate
Stars
898
Port
8000 (FastAPI HTTP API bind port (binds SERVER_HOST, default 0.0.0.0); can be overridden, e.g. 7860 on Hugging Face Spaces)
Requires
Chromium (installed via Playwright)
Install with Python
ohmycaptcha screenshot 1

What is ohmycaptcha?

Should you self-host ohmycaptcha?

ohmycaptcha scores 38/100 on selfhost.directory (how scoring works) and ranks #67 of 78 in Security. It has 898 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. It is MIT-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is pentagi (83/100, 32 629 stars). It scores higher overall, so compare the two before you pick. See ohmycaptcha vs pentagi side by side.

Features

  • Async in-memory task queueTask state is not persistent.
  • Client key authentication
  • Cloudflare Turnstile solving
  • hCaptcha solving
  • Headless browser automation
  • Health endpoint
  • Image CAPTCHA recognition
  • Image grid classificationAccuracy depends on the vision model used.
  • Local model inference support
  • reCAPTCHA v2 solving
  • reCAPTCHA v3 solving
  • YesCaptcha-compatible solving APINot full vendor parity: only the 19 task types implemented in the repo.

ohmycaptcha README

How to install ohmycaptcha

Install ohmycaptcha with Python

Environment variables
CLIENT_KEY, LOCAL_BASE_URL, LOCAL_API_KEY, LOCAL_MODEL, CLOUD_BASE_URL, CLOUD_API_KEY, CLOUD_MODEL, BROWSER_HEADLESS, SERVER_HOST, SERVER_PORT
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
playwright install --with-deps chromium
export CLIENT_KEY="your-client-key"
python main.py

Verify with curl http://localhost:8000/api/v1/health

How to configure ohmycaptcha

  • BROWSER_HEADLESStrueRun headless Chromium

    Run headless Chromium

    values: true, false

  • BROWSER_TIMEOUT30Page load timeout in seconds

    Page load timeout in seconds

  • CAPTCHA_API_KEYLegacy API key for your model provider

    Legacy API key for your model provider

  • CAPTCHA_BASE_URLLegacy OpenAI-compatible API base URL, fallback when CLOUD_BASE_URL is unset

    Legacy OpenAI-compatible API base URL, fallback when CLOUD_BASE_URL is unset

  • CAPTCHA_MODELgpt-5.4Legacy strong text model name

    Legacy strong text model name

  • CAPTCHA_MULTIMODAL_MODELqwen3.5-2bLegacy multimodal model name

    Legacy multimodal model name

  • CAPTCHA_RETRIES3Retry count

    Retry count

  • CAPTCHA_TIMEOUT30Model timeout in seconds

    Model timeout in seconds

  • CLIENT_KEYClient authentication key sent as clientKey in API requests

    Client authentication key sent as clientKey in API requests

  • CLOUD_API_KEYAPI key for the remote model provider

    API key for the remote model provider

  • CLOUD_BASE_URLBase URL of the remote (cloud) model API

    Base URL of the remote (cloud) model API

  • CLOUD_MODELgpt-5.4Remote model name used for complex reasoning

    Remote model name used for complex reasoning

  • LOCAL_API_KEYEMPTYAPI key for the local inference server

    API key for the local inference server

  • LOCAL_BASE_URLhttp://localhost:30000/v1Base URL of the local OpenAI-compatible inference server (SGLang/vLLM)

    Base URL of the local OpenAI-compatible inference server (SGLang/vLLM)

  • LOCAL_MODELQwen/Qwen3.5-2BLocal model name used for image recognition and classification

    Local model name used for image recognition and classification

  • PORTPort injected by the platform; the application also respects it

    Port injected by the platform; the application also respects it

  • SERVER_HOST0.0.0.0Bind host

    Bind host

  • SERVER_PORT8000Bind port

    Bind port

FAQ

What affects reCAPTCHA v3 results?

IP quality, browser fingerprint, the target site's behaviour, correct pageAction values and the runtime environment all influence results.

Is task state persistent?

No, tasks are kept in memory and removed once the configured TTL window passes.

Does ImageToTextTask return plain OCR text?

Not necessarily; the implementation returns structured recognition output serialized into solution.text.

Can I use local or self-hosted multimodal models?

Yes, provided the backend exposes an OpenAI-compatible chat-completions API that accepts image input.

Does minScore guarantee a target reCAPTCHA score?

No. The field is accepted for compatibility, but the solver does not do score targeting.

Does this fully replace YesCaptcha?

No. It only reimplements the YesCaptcha-style API surface for the task types the repository supports, and the docs warn against claiming parity with the vendor.

More in OCR

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…