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.
How It Works
Section titled “How It Works”- Configure a maintain count (1-10) — the number of pre-solved tokens to keep ready at all times.
- Set an idle timeout (5 minutes to 7 days) — how long uCaptcha continues solving in the background when no requests come in.
- uCaptcha continuously solves tokens in the background, maintaining your configured pool size.
- When you submit a
createTaskrequest, a pre-solved token is popped from the pool and returned immediately. - The pool automatically replenishes after each token is consumed.
- 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.
Configuration
Section titled “Configuration”Lightning Mode is configured per API key in the Telegram Mini App under the API tab.
| Setting | Options | Description |
|---|---|---|
| Routing Mode | Standard / Lightning | Switch to Lightning to enable pre-solving |
| Maintain Count | 1-10 | Number of pre-solved tokens to keep ready |
| Idle Timeout | 5 min, 30 min, 1 hour, 1 day, 7 days | How long to continue solving when idle |
Token Expiry
Section titled “Token Expiry”Pre-solved CAPTCHA tokens have a limited lifetime. The TTL depends on the CAPTCHA type:
| CAPTCHA Type | Typical 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.
Cost Considerations
Section titled “Cost Considerations”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_hourWhere 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/hourThe Telegram Mini App displays an estimated hourly cost based on your current settings and observed solve costs.
When to Use
Section titled “When to Use”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
When NOT to Use
Section titled “When NOT to Use”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
WebSocket Events
Section titled “WebSocket Events”If you connect via WebSocket, you can monitor Lightning Mode pool activity in real time:
| Event | Description |
|---|---|
lightning:pool:started | Pool has begun pre-solving tokens |
lightning:pool:stopped | Pool stopped (idle timeout reached or manually disabled) |
lightning:token:ready | A new pre-solved token has been added to the pool |
lightning:token:consumed | A token was used to fulfill a request |
lightning:token:expired | A token expired and will be replaced |
These events are useful for building dashboards or monitoring systems that track pool health and utilization.