Skip to content

Lightning Mode

Lightning Mode pre-solves CAPTCHA tokens in the background so they are ready the instant you need them. Instead of waiting 10-30 seconds for a provider to solve each request, you get a cached token in milliseconds. This is ideal for high-throughput pipelines where solve latency is the bottleneck.

  1. Configure a maintain count (1-10) — the number of pre-solved tokens to keep ready at all times.
  2. Set an idle timeout (5 minutes to 7 days) — how long uCaptcha continues solving in the background when no requests come in.
  3. uCaptcha continuously solves tokens in the background, maintaining your configured pool size.
  4. When you submit a createTask request, a pre-solved token is popped from the pool and returned immediately.
  5. The pool automatically replenishes after each token is consumed.
  6. If the pool is empty (all tokens consumed faster than they can be replenished), the request falls through to normal routing and is solved with standard latency.

Lightning Mode is configured per API key in the Telegram Mini App under the API tab.

SettingOptionsDescription
Routing ModeStandard / LightningSwitch to Lightning to enable pre-solving
Maintain Count1-10Number of pre-solved tokens to keep ready
Idle Timeout5 min, 30 min, 1 hour, 1 day, 7 daysHow long to continue solving when idle

Pre-solved CAPTCHA tokens have a limited lifetime. The TTL depends on the CAPTCHA type:

CAPTCHA TypeTypical TTL
reCAPTCHA v2~120 seconds
reCAPTCHA v3~120 seconds
hCaptcha~120 seconds
Turnstile~300 seconds
  • Expired tokens are automatically discarded and replaced with fresh solves.
  • You are not charged for tokens that expire before being consumed.
  • The pool continuously refreshes, so there is always a mix of fresh and aging tokens.

Lightning Mode introduces a cost tradeoff: you pay for pre-solved tokens that may expire before use.

Estimated hourly cost:

hourly_cost = maintain_count * cost_per_solve * refreshes_per_hour

Where refreshes_per_hour depends on the token TTL. For a token with a 120-second TTL, each slot refreshes up to 30 times per hour.

Example: Maintaining 3 reCAPTCHA v2 tokens at $0.003 per solve:

3 * $0.003 * 30 = $0.27/hour

The Telegram Mini App displays an estimated hourly cost based on your current settings and observed solve costs.

Lightning Mode is a strong fit for:

  • High-throughput pipelines that need consistent sub-second response times
  • Time-sensitive operations where 10-30 second solve latency is unacceptable
  • Burst workloads with predictable patterns where pre-solved tokens can be consumed before expiry

Lightning Mode is not recommended for:

  • Low-volume usage — token expiry waste will exceed the speed benefit
  • Unpredictable request patterns with long idle periods between bursts
  • Budget-constrained operations where every cent matters

If you connect via WebSocket, you can monitor Lightning Mode pool activity in real time:

EventDescription
lightning:pool:startedPool has begun pre-solving tokens
lightning:pool:stoppedPool stopped (idle timeout reached or manually disabled)
lightning:token:readyA new pre-solved token has been added to the pool
lightning:token:consumedA token was used to fulfill a request
lightning:token:expiredA token expired and will be replaced

These events are useful for building dashboards or monitoring systems that track pool health and utilization.