Appearance
Threads model
CaptchaAI phase-1 bills active threads, not per-solve. A "thread" is one in-flight task: from createTask accepted → terminal state (ready or failed). Your thread limit sets an upper bound on how many can be in flight at once. There is no plan/credit/balance model — billing is purely the concurrent thread count.
Admission
When you call createTask:
- Atomic Lua script checks
ZCARD client:{id}:active_tasksvs your limit. Expired leases (default 300 s) are purged first. - If under the limit → task is admitted, lease is set, RabbitMQ message is published. You get
taskId. - If at the limit →
ERROR_NO_SLOT_AVAILABLE(errorId 1) with the currentactive/limitfor visibility.
Holding and releasing a thread
Your thread is held for the whole solve. The lease is sized to cover the maximum solve time, so nothing has to be refreshed client-side. The thread is released when the task reaches a terminal state (ready or failed). The task hash itself lingers for 5 min so getTaskResult can still return the answer.
Monitoring
- Dashboard: Overview → Threads in use tile.
- API: every
getBalanceresponse includesactiveThreads,threadLimit,mode, andavailable. - Webhook on
threshold_reached: planned for phase 2.