Smart Routing
Every CAPTCHA task submitted to uCaptcha is routed through a scoring algorithm that evaluates all available providers and selects the best one based on speed, cost, and reliability. The router adapts in real time using observed performance data, ensuring optimal provider selection for every request.
How It Works
Section titled “How It Works”The routing algorithm executes the following steps for each incoming task:
- Gather candidates — Identify all providers that support the requested task type.
- Collect real-time stats — For each candidate, retrieve current metrics:
- Cost: Per-task cost based on an EWMA (exponentially weighted moving average) of observed pricing
- Speed: Rolling average solve time from recent completions
- Reliability: Success rate over the recent window
- Apply Pareto filter — Remove any provider that is both slower and more expensive than another candidate. Only non-dominated providers remain.
- Score remaining candidates:
- Normalize cost and speed values to a 0-1 range across the candidate set
- Calculate
baseScore = (speedWeight / 100) * speedScore + (costWeight / 100) * priceScore - Calculate
reliabilityMultiplier = 0.3 + 0.7 * (successRate / 100) - Final score:
totalScore = baseScore * reliabilityMultiplier
- Apply recycle bias — If the user has a recycled provider API key with remaining balance, boost that provider’s score by up to 15%.
- Route — Send the task to the highest-scoring provider.
Speed/Cost Priority Slider
Section titled “Speed/Cost Priority Slider”Each API key has a speed/cost priority value from 0 to 100 that controls the tradeoff between fast and cheap:
| Value | Behavior |
|---|---|
0 | Cheapest providers preferred |
50 | Balanced (default) |
100 | Fastest providers preferred |
The slider maps directly to the speedWeight in the scoring formula. A costWeight is derived as 100 - speedWeight. At value 50, speed and cost contribute equally to the score.
Per-Key Settings
Section titled “Per-Key Settings”Each API key has independent routing configuration. This allows you to run multiple strategies simultaneously:
- One key optimized for speed (high-priority scraping)
- Another key optimized for cost (batch processing)
- A third with custom settings for a specific use case
Configure routing per key in the Telegram Mini App under the API tab.
Selection Mode Override
Section titled “Selection Mode Override”Override routing behavior on a per-request basis using the selectionMode parameter in your createTask call:
| Selection Mode | Speed Weight | Description |
|---|---|---|
autoCheapest | 10 | Strongly prefer cheapest provider |
autoFastest | 90 | Strongly prefer fastest provider |
autoMostReliable | 50 | Balanced, but reliability has standard weight |
priority | 50 | Same as autoMostReliable |
Example
Section titled “Example”{ "clientKey": "YOUR_API_KEY", "task": { "type": "ReCaptchaV2TokenProxyLess", "websiteURL": "https://example.com", "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-" }, "selectionMode": "autoFastest"}Forcing a Specific Provider
Section titled “Forcing a Specific Provider”If you need to bypass routing entirely and send a task to a specific provider, use the provider parameter:
{ "clientKey": "YOUR_API_KEY", "task": { "type": "ReCaptchaV2TokenProxyLess", "websiteURL": "https://example.com", "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-" }, "provider": "capsolver"}Valid provider identifiers: 2captcha, capsolver, anticaptcha, capmonster, multibot, ucaptcha.
Recycled Key Bias
Section titled “Recycled Key Bias”When you submit your own provider API keys through Key Recycling, the routing algorithm gives a small preference (up to 15% score boost) to providers where your recycled key has remaining balance. This maximizes utilization of your existing provider balances while still maintaining intelligent routing.
The bias is capped to prevent recycled keys from overriding a significantly better provider choice. If another provider scores substantially higher on speed, cost, or reliability, the router will still select it.
Failover
Section titled “Failover”If the selected provider fails to accept or solve a task, uCaptcha does not automatically retry with a different provider. The failure is returned to the caller. To implement retry logic with a fallback provider, resubmit the task and optionally exclude the failed provider or force a different one using the provider parameter.