Your agent can call several providers for the same job, but the cheapest endpoint keeps returning records your workflow can't use. Another provider costs more per call, yet produces verified emails or correctly parsed pages more consistently. Meanwhile, retries make the bill harder to explain.
Service provider routing is the layer that decides which external provider receives a request, under what constraints, and what happens if the response isn't usable. Here, routing means selecting API and data providers for agent workflows, not choosing network paths between internet service providers. The first check is compatibility. The useful economic measure is cost per accepted result, not price per call.
Table of Contents
- The Six Criteria That Decide Each Route
- Filtering Providers by Capability Before Price
- Ranking Providers by Cost per Accepted Result
- How a Request Moves Through the Routing Layer
- Failure Types and the Fallback Each One Needs
- A Worked Example Routing One Lead Lookup
- Set Up Your First Routing Policy Today
The Six Criteria That Decide Each Route
| Criterion | Question it answers | Role in routing | How to measure |
|---|---|---|---|
| Capability | Can this provider run the operation with my inputs and output schema? | Hard filter | Operation match and schema check on each response |
| Geography and data residency | Can the data be served from the required region under the contract? | Hard filter | Provider region list and contract terms |
| Cost | What is the quoted price per call, and what does each accepted result cost? | Ranking | Quote before run and cost per accepted result |
| Reliability | How often does the provider succeed and respond within the timeout? | Ranking | Success rate and timeout rate over a recent window |
| Result quality | Is the returned data fresh, complete and usable downstream? | Ranking | Downstream acceptance rate per operation |
| Fallback | Which provider takes over if this one fails? | Policy | Ordered fallback list with cooldown and retry limits |
Hard filters remove providers that can't do the job; only the providers that remain are ordered. Two mistakes break that rule: sorting by the lowest price before checking capability, and treating HTTP 200 as proof that the result is usable.
These criteria answer different questions. Capability establishes whether a provider belongs in the candidate set. Reliability describes whether it responds successfully within your deadline. Result quality describes whether your application can use what comes back.
A provider can perform well on one measure and poorly on another. A scraping endpoint might respond promptly but return a consent page instead of the requested article. An email endpoint might return the required field while supplying an address that fails verification.
Separate eligibility from preference
Some criteria need both a minimum requirement and a ranking signal. Freshness, for example, can be a hard requirement for rank tracking, while completeness can distinguish otherwise eligible results. Write those rules explicitly rather than hiding them inside a combined score.
A live quote is an input to cost, not the final economic ranking. To compare useful output, combine that quote with the recent acceptance rate and the cost of retries or fallback attempts. Keep reliability visible alongside that calculation so a nominally economical route doesn't repeatedly miss the workflow's deadline.
looot ranks providers by live price, so your agent doesn't need to know which is cheapest. An outcome-aware policy adds your application's acceptance measurements to that price comparison; don't assume live-price ordering already measures downstream quality.
Before writing routing code: List these criteria for a single operation, mark the hard filters, and assign a measurement to every row.
A measurement needs an owner, too. Your adapter can validate schemas, your billing layer can record charges, and the downstream workflow must report whether the result was accepted.
Filtering Providers by Capability Before Price
Eligibility starts with the operation's contract, not the provider's marketing category. An endpoint described as contact enrichment might return a company and job title without returning an email address. That endpoint is ineligible for a job whose required output is a work email.
Use short, explicit checks:
- Operation compatibility: An email lookup must return the required email field, not merely identify the person.
- Geography: A provider without an EU processing option fails an EU-only request. An EU-only provider can satisfy that geographic requirement if its contract covers the required handling.
- Freshness: A cached SERP response fails a request for current rankings when its observation timestamp falls outside the job's permitted age.
- Rate limits: A provider with exhausted quota can't accept the burst, even if it supports the operation.
Keep a capability matrix in code
The following is an illustrative configuration, not a description of actual providers or their contracts. Eligibility is evaluated separately for each operation, so the same provider can qualify for a company lookup but fail a person lookup.
| Operation | Eligible providers | Contract version | Regions | Limit that removes a provider |
|---|---|---|---|---|
| Person email lookup | A and B; C dropped, no email field | v3 | EU, US | Missing required output field |
| Company lookup | A, B, and C | v2 | EU | No EU region on the contract |
| SERP rank tracking | C only | v1 | Global | Cache older than one day, or quota already full |
Store this matrix as configuration that your adapters and tests can read. Include supported inputs, required outputs, contractual regions, freshness rules, and current availability. Keep contractual eligibility separate from temporary quota state, since they change for different reasons.
When comparing agent tools, capability differences can be easy to miss behind similar names. The NotFair comparison of ads MCP servers is a useful starting point for examining alternatives, but your router still needs an explicit operation contract for each candidate.
Version the contract, not just the adapter
Before dispatch, validate arguments against the expected input schema. After dispatch, compare the returned fields and types with the output schema for the contract version used by that request.
A provider changing an email field from a string to a nested object shouldn't produce an empty value downstream. Reject the mismatch, identify the affected contract, and update the adapter deliberately.
The filtering stage produces an eligible candidate set. Once ranking selects a route, preserve a versioned decision record containing the selected provider, operation contract, and fallback policy. That snapshot lets an engineer reconstruct what the router believed was eligible without consulting today's changed configuration.
Ranking Providers by Cost per Accepted Result
The cheapest call isn't necessarily the cheapest useful answer. Consider a hypothetical comparison: Provider A charges $0.0020 per call and has a 40% acceptance rate, producing a cost per accepted result of $0.0050. Provider B charges $0.0040 and has an 85% acceptance rate, producing approximately $0.0047 per accepted result.
B costs twice as much per attempt but less per accepted outcome. Those example figures illustrate the calculation; they aren't provider prices or measured benchmarks.
Basic estimate: cost per accepted result = quoted price per call ÷ acceptance rate.

Define acceptance before calculating cost
An accepted result is one the downstream step can use: a verified email, a correctly parsed page, or a SERP response matching the required location and freshness. An HTTP 200 response only describes the transport-level outcome.
The routing paper on arXiv argues for combining technical telemetry with business outcomes such as verification success and task completion. Apply that distinction through operation-specific scorecards rather than a universal provider quality score.
The basic estimate assumes comparable calls and doesn't fully describe a fallback chain. For observed workflow economics, use total charged attempt and verification costs divided by accepted outcomes. Include paid unsuccessful responses and fallback attempts, but don't count released holds as spending.
Count every charge needed to obtain the accepted result, not just the final successful call.
Make ranking stable and region-aware
Use a rolling window or a weighted average that gives recent outcomes more influence. Require enough observations before promoting a challenger, and record the sample size beside its acceptance rate. Otherwise, an unusually good opening run can outweigh a more representative history.
For an initial policy, you could require a full window of at least 50 calls before changing the live order. That's a proposed operating threshold, not a universal evidence-based minimum. Use bounded exploratory traffic to gather comparable samples without committing the entire workload.
When estimated costs are close, break the tie with measured end-to-end latency in the required region. Google's SRE guidance on managing load describes directing traffic toward available service locations and balancing demand across capacity. Apply that principle by excluding saturated provider-region combinations rather than choosing a cheap region that can't meet the deadline.
Keep the quote separate from settlement
On our platform key, a call costs the provider's charge plus a disclosed, versioned fee shown before execution. With your own provider key, you pay the provider's cost without our markup.
A hold becomes a settlement only after the provider answers, and the uncharged portion is released. A returned answer can still fail your business acceptance rule. Track billing status and quality status separately, then switch routes only when the improved economic ranking persists across the evaluation window.
How a Request Moves Through the Routing Layer
Keep classification, selection, and failure handling separate. The IETF Service Function Chaining architecture draft describes classifying traffic before steering it through service functions, with context preserved between stages. Applied to API orchestration, that's a useful architectural pattern, not a claim that API routing is the same protocol.

Execute the policy in order
Classify the job. Extract the operation, required region, freshness, privacy rules, rate-limit needs, output schema, and maximum spend. Reject invalid arguments before contacting a provider.
Consult the capability matrix and remove every provider that fails a hard filter. Preserve the matrix and contract versions used for this decision.
Rank eligible candidates by estimated cost per accepted result. Use the quoted charge divided by the relevant acceptance estimate, incorporating expected retry costs where applicable. Record the score inputs so an engineer can explain the order.
Obtain the executable quote, reserve the necessary budget, and dispatch to the selected provider. Use an idempotency key to protect against accidental duplicate execution when the caller repeats a request.
Validate the response body. Check the schema first, then freshness, completeness, and the operation's acceptance rule. Keep a technically valid but unusable result out of the accepted count.
Handle the classified failure within the remaining retry, time, and spending limits. A transport error, malformed body, or valid-but-empty response may permit fallback; bad input never justifies sending the same arguments to another provider.
Finalize accounting and the decision record. Return the accepted result, settle applicable provider charges after responses, release unused holds, and preserve the selected providers, contracts, quotes, attempts, and outcomes. Rejected results can still carry charges when the provider returned a billable answer.
Keep execution mechanics distinct from ranking
Our agent skill uses free discovery, free inspection of price and inputs, execution with an idempotency key, and fallback to the next-cheapest provider on error or timeout. That live-price behavior is distinct from the outcome-aware ranking policy described here, which requires application acceptance telemetry.
For an adjacent implementation perspective, UberLLM's guide to how model routing works is useful when considering provider selection behind a consistent interface. Don't assume that model-selection criteria automatically fit data operations.
The operational check is simple: open a request's log and identify who received it, why that provider ranked first, and what amount settled. If those answers require guessing, the routing decision isn't sufficiently observable.
Failure Types and the Fallback Each One Needs
| Failure type | Signal | Right action | Retry or fall back |
|---|---|---|---|
| Transport failure | Connection error or timeout | Retry within the cap, then move to the next provider | Retry, then fall back |
| Provider rejection | Refused for credentials, quota or rate limit | Repair credentials or honor the limit; switch only to an authorized alternative | Fall back when allowed; don't immediately repeat the rejected call |
| Malformed output | Response fails the contract's schema check | Reject the response and log the version mismatch | Fall back |
| Semantically empty result | Valid response with no usable data | Check the input, then try the next eligible provider | Fall back only if the input is valid |
| Bad input | Validation error on the arguments sent | Correct the arguments before calling again | No retry on another provider |
A generic error handler can't safely handle all these conditions. A connection timeout suggests a delivery problem; an invalid company domain suggests a request problem. Moving both to another provider wastes attempts and can hide a defect in your application.
Credential refusal deserves particular care. Don't keep resubmitting a revoked key, and don't switch credentials to bypass an authorization boundary. Mark that provider unavailable for the affected credential scope and alert the owner.
Detect the failure that looks like success
A valid response containing empty email fields can pass a schema check if those fields are nullable. That doesn't make it useful. Your content validator needs a separate outcome such as no_match, verification_failed, or stale_result.
The JetBrains guide to agent function calling identifies malformed parameters, wrong-tool selection, and silent failures as practical risks, and recommends validation, structured errors, execution limits, and logging. Return machine-readable failure categories to the agent rather than asking it to interpret arbitrary error text.
Fallback guardrail: Stop when the next attempt would violate the request's deadline, budget, credential boundary, or residency requirement.
On looot, a call that fails at the provider costs nothing and can be retried or sent to another provider. That protection doesn't mean every answer rejected by your downstream validator is free. A provider may have successfully returned a billable response even though your application can't use it.
Set retry caps for the overall request and for each provider. Add a cooldown after repeated provider failures, and allow controlled recovery probes instead of immediately returning all traffic. Repeated free failures still consume time and execution capacity.
Before enabling an operation, answer these questions:
- Failure coverage: Which transport, authorization, schema, content, and argument failures can occur?
- Allowed action: Which conditions trigger retry, fallback, repair, or immediate termination?
- Audit evidence: Which error category, attempt history, contract version, and accounting status will the log preserve?
A Worked Example Routing One Lead Lookup
Say a sales workflow needs a verified work email for a contact at a software company. The request carries an EU residency constraint, and the application accepts an address only after verification passes. This is a hypothetical routing trace, not a provider benchmark.
The router classifies the request as a person-level email lookup. Providers A, B, and C advertise the necessary email output, but C has no contracted EU processing option. C leaves the candidate set before any price comparison.

Follow the actual attempt sequence
The eligible scorecard places B ahead of A because B's higher acceptance rate offsets its higher quoted call price. The router obtains B's executable quote, reserves budget, and sends the normalized person and company identifiers.
B returns HTTP 200 with a low-confidence email address. The body satisfies the output schema, but the verification step rejects the address. The router records verification failed, not accepted.
The request arguments are still valid, and the policy permits another attempt. The router doesn't manufacture alternate addresses from B's rejected payload. It checks A's current eligibility and quote, confirms sufficient remaining budget, and dispatches the fallback.
A returns an address that passes verification. The workflow receives that verified address, together with the provenance needed to identify its source. Stop the chain at that point; an unused alternative shouldn't run merely because it remains in the catalog.
Make the ledger explain the outcome
The trace should preserve enough detail to distinguish the successful workflow from its unsuccessful first attempt:
- Attempt sequence: B followed by A, with separate request identifiers and contract versions.
- Quality decisions: B's address failed verification; A's address passed.
- Accounting: Each quote, applicable settled charge, and released reservation.
- Final disposition: The accepted address and the operation's completion status.
If B returned a billable answer, its charge remains part of the cost of obtaining this accepted lead. Don't erase that spending from the quality scorecard because A eventually succeeded.
Store reusable company-level information separately from person-level email results. A valid company enrichment record can support later lookups without buying the same company information again, subject to freshness and permitted retention. A verified address for one contact doesn't establish an address for everyone else at the company.
This successful fallback demonstrates correct policy execution. It doesn't establish that A should replace B globally; route promotion requires representative outcomes across the evaluation window, not an anecdote from the latest request.
Set Up Your First Routing Policy Today
Start with an operation whose accepted outcome you can test automatically. Verified email lookup, schema-validated page extraction, and location-specific SERP collection are more manageable starting points than an open-ended task whose quality depends on subjective review.
Keep the first policy small enough to inspect in a planning document. Your team should be able to explain every exclusion, score, and fallback without reading the entire agent implementation.
Write an executable policy
- Record hard constraints: Put operation support, required fields, permitted regions, freshness, privacy, quota, and maximum spend into a shared configuration.
- Define the acceptance test: Specify exactly what the downstream consumer must approve, then set a cost-per-accepted-result target.
- Bound the fallback chain: Use a short list of eligible alternatives with explicit stop conditions rather than searching indefinitely.
- Control route changes: Define a minimum observation window, a cooldown after repeated failures, and a recovery-probe policy.
- Preserve the evidence: Log provider selection, quote, validation outcome, attempts, settlement, and the versions needed to reconstruct the decision.
Choose how credentials and billing work
Managed credits provide a shared key and balance across providers. If you want to retain direct provider billing, connect credentials through our catalog's Bring your own key option; that operation runs at the provider's own cost with no routing markup.
We bill per call, and nothing runs while your agent is idle. Regardless of credential mode, keep the same acceptance test so you can compare outcomes rather than mixing billing differences with quality differences.
Run a bounded pilot before expanding to another operation. Review rejected results manually, verify that failure categories are accurate, and reconcile the ledger against your cost calculation.
Make one concrete decision today: which operation will you route first, and what exact acceptance test will determine whether its spending produced a usable result?
looot offers unified access to third-party data providers, quote-before-run pricing, and a verifiable execution ledger for agent workflows. Visit looot to inspect an operation's inputs and price, choose managed credits or your own provider credentials, and connect that operation to an explicit acceptance check.



