Routing
How ProxySave picks the best provider for every request.
Constraint-based routing
When a request arrives, ProxySave runs through this process:
- Collect candidates. All configured providers (your BYOK keys + managed pool) are considered.
- Apply constraints. Providers exceeding your
max-price-per-gbare eliminated. Providers with historical latency above yourmax-time-msfor this label are deprioritized. - Rank by cost. Remaining providers are sorted by effective cost per GB, cheapest first.
- Route. The request is sent to the cheapest qualifying provider.
Constraints: max $3.00/GB, max 2000ms
Label: "product-scraper"
Available providers:
brightdata → $8.40/GB → SKIP (over budget)
oxylabs → $5.50/GB → SKIP (over budget)
smartproxy → $3.20/GB → SKIP (over budget)
iproyal → $2.90/GB → candidate (avg 1400ms for this label)
netnut → $1.80/GB → candidate (avg 900ms for this label)
Selected: netnut ($1.80/GB)
Saved: $6.60/GB vs. brightdata (78%)Per-workload learning
Not all proxy traffic is the same. Scraping product pages on Amazon has different provider performance characteristics than monitoring airline prices. ProxySave learns these differences.
When you tag requests with a label header, ProxySave tracks per-label metrics for each provider:
- Success rate (percentage of requests that return a valid response)
- Median response time
- P95 response time
- Block rate (how often the target blocks this provider)
Over time, routing decisions become more accurate for your specific workload. A provider that's cheap but frequently blocked on your target will be automatically deprioritized, even if it meets your stated constraints.
# Different workloads get different routing profiles
-H "label: amazon-product-pages"
-H "label: google-serp"
-H "label: airline-pricing"
-H "label: social-media-profiles"Retry logic
When a provider fails (network error, timeout, blocked response), ProxySave automatically retries through the next cheapest qualifying provider. This happens transparently — your application receives a single response.
The retry chain works like this:
- Request sent to cheapest provider (e.g., NetNut at $1.80/GB)
- If it fails, retry through next cheapest (e.g., IPRoyal at $2.90/GB)
- Continue until a provider succeeds or all candidates are exhausted
- If all providers fail, return
ALL_PROVIDERS_FAILEDwith the last error
The X-ProxySave-Retries response header tells you how many retries occurred. A value of 0 means the first provider succeeded.
Fallback chains
The retry mechanism creates an implicit fallback chain ordered by cost. But you can also force a specific provider while still benefiting from automatic fallback:
# Try brightdata first, fall back to cheapest if it fails
-H "provider: brightdata"
-H "fallback: cheapest"This is useful when you know a specific provider works well for a target but want resilience if it goes down.
Provider exploration
ProxySave occasionally routes a small percentage of requests (<2%) through providers that aren't the current cheapest winner. This exploration ensures the router discovers when a provider improves its pricing or performance for your workload.
Exploration only happens within your stated constraints — ProxySave never sends an exploration request to a provider that exceeds your max cost or latency limits. And exploration requests still benefit from retry logic, so they don't reduce your effective success rate.
Summary
- • Routing is constraint-based: you set budget + latency, we find the cheapest path
- • Labels enable per-workload learning that improves over time
- • Automatic retries mean near-100% effective success rates
- • Exploration keeps routing optimal as provider performance shifts