Deterministic prefer & exclude Upstream Routing Overrides
Sometimes a workload needs a specific upstream first—such as a low-latency DNS node or a JS-rendered extractor—or must exclude a vendor for regional compliance. FuelRouter supports deterministic prefer and exclude overrides without ever bypassing circuit breaker or budget protections.
Caller Routing Override Precedence & Safety Rules
| Override Field | Accepted Values | Ranking Effect | Hard Safety Boundary |
|---|---|---|---|
| prefer | List of upstream_id strings | Assigns primary rank prefix 0 in listed order ahead of non-preferred (1) | Skipped automatically if OPEN, quota-exhausted, or over max_cost_micros |
| exclude | List of upstream_id or domain_id strings | Removes matching upstreams before sorting | Applied unconditionally; never routed even during failover |
| force_refresh | Boolean (default false) | Bypasses cache read path to execute preferred live route | Still runs full Anti-Fake-200 gate before cache update |
| max_cost_micros | Integer micro-USD ceiling | Filters out wholesale upstreams exceeding budget | Overrides prefer if preferred upstream exceeds budget |
Safety-Preserving Preference Pinning
Hardcoding a vendor override in application code re-introduces single points of failure. In FuelRouter, passing prefer: ["scrape_browserbase_free"] promotes that upstream to the head of the eligible list only while its circuit is CLOSED (or ready for a HALF_OPEN probe), its RPM/RPD/monthly quotas have headroom, and its unit cost fits inside max_cost_micros.
If the preferred upstream trips OPEN or encounters a CAPTCHA soft-ban, FuelRouter falls back automatically to the next ranked pool candidate within the same request.
Compliance Exclusions by Upstream ID or Domain ID
Regional data-residency or vendor-blocklist policies can pass exclude: ["domain_id_or_upstream_id"] on every quote and dispatch call. Excluded nodes are removed during Step 1 eligibility filtering and never receive traffic.
Callers can preview the exact post-override failover sequence at $0 cost via POST /v1/router/quote.
Prefer a Fast DNS Upstream While Excluding Specific Hosts
curl -fsSL -X POST "https://fuelrouter.fastmesh.dev/v1/router/dispatch" \
-H "Content-Type: application/json" \
-d '{
"pool_id": "b2b_domain_dns_enrichment",
"tenant_id": "dns_audit_bot",
"inputs": {"domain": "fastmesh.dev", "include_dns": true},
"prefer": ["enrich_cloudflare_dns_free"],
"exclude": ["enrich_alphavantage_free"],
"max_cost_micros": 80000
}'
Routing Override Operational Guidelines
- Use prefer for soft affinity (e.g., JS rendering or low-latency DNS) while retaining full automatic failover.
- Use exclude for hard compliance or regional vendor exclusions by upstream_id or domain_id.
- Test complex prefer/exclude rules with POST /v1/router/quote ($0) before pushing to production agents.
- Remember that if exclude removes every eligible candidate in a pool, FuelRouter returns unbilled HTTP 503 ($0.00).
Frequently Asked Technical Questions
Can prefer force FuelRouter to call an OPEN circuit or over-budget upstream?
No. Eligibility filters (circuit state, sliding-window quota, and max_cost_micros) always run before preference ranking.
Can I pass domain_id values inside the exclude array?
Yes. The eligibility filter matches both upstream_id and domain_id against caller exclude entries.
What happens if all non-excluded upstreams fail?
FuelRouter respects your exclude list strictly, never calls an excluded upstream, and returns HTTP 503 with charged_micros: 0.
Live Try-Now Console & Machine Discovery
Test failover routing, dry-run quotes, and circuit breaker metrics on the live gateway or connect via JSON-RPC 2.0 MCP.
Related FuelRouter Architecture Guides
- Multi-Upstream API Failover Router with Circuit Breaker — multi-upstream API failover router with circuit breaker
- Anti-Fake-200 HTTP Proxy Gateway: Blocking Silent Payload Corruption — anti-fake-200 HTTP proxy gateway
- Cross-Tenant API Response Cache & 100% Repeat-Margin Economics — cross-tenant API response cache 100% repeat margin