How Routing Works
Every request passes through up to two routing tiers. The gateway tries each tier in order and returns the first successful response.
The two tiers
Request → Tier 1: Operators → Tier 2: Direct Provider → ResponseTier 1: Operator routing
Operators run Blueprints: service templates like the LLM Inference Blueprint. They stake tokens, serve models, and compete on price, latency, and reputation.
- Selected by scoring algorithm: reputation (40%) + latency (30%) + price (30%)
- Discovered automatically from on-chain Blueprint Service Manager contracts
- Can be pinned by blueprint, service, or operator address
- See Operator Routing for the full Blueprint catalog
When it’s used: Default for auto routing mode, required for SpendAuth (on-chain payments).
When it’s skipped: Only in two cases. When a compliance flag is set (ZDR, no-train, or data residency), because operators can’t verify compliance. And when providerOptions.gateway.order is supplied.
Tier 2: Direct provider
The gateway calls the provider API directly using platform credentials (or BYOK credentials).
When it’s used: Default for standard requests, and the fallback when tier 1 fails. Only tier used when compliance routing is active.
Always used for: ZDR requests, no-train requests, BYOK with compliance flags.
Compliance mode
When zeroDataRetention or disallowPromptTraining is set:
Request → Tier 2: Direct Provider (verified only) → ResponseTier 1 is bypassed. The gateway routes only to providers with verified compliance agreements. See Zero Data Retention for the trust model.
Routing control
| Method | Effect |
|---|---|
routing: "auto" | Try both tiers (default) |
routing: "operator" | Operators only. Fails if no operator available. |
X-Tangle-Blueprint: <id> | Pin to operators under this Blueprint. |
X-Tangle-Operator: <slug> | Pin to a specific operator. |
providerOptions.gateway.order | Control which providers are tried and in what order. Also skips operators. |
providerOptions.gateway.only | Restrict to these providers only. |