Skip to main content
Guardway Gateway decides which provider handles each request using a combination of routing strategies and routing rules. Configure these from the dashboard’s Configuration → Routing page.

Routing strategies

StrategyBehavior
PriorityMatch rules in priority order. Default.
Lowest-latencyRoute to the fastest provider based on historical metrics.
Lowest-costRoute to the cheapest provider for the requested model.
Least-busyRoute to the provider with the lowest concurrent load.
Tag-basedRoute based on tags attached to the request.
Auto-routerAdaptive routing based on SLA requirements.

Routing rules

Rules use pattern matching against the model name in the request:
  • Pattern types: equals, startsWith, contains.
  • Priority: lower number = higher priority.
  • Budget limits: optional per-rule USD budget with a time window (hour, day, month). Windows auto-reset.
  • Token limits: optional per-rule token cap with a time window.
  • Fallback strategies: next-priority, lowest-cost, lowest-latency, fail.
Rules are evaluated top-to-bottom by priority until one matches. The first match wins; if it fails and has a fallback, the fallback chain runs.

Example

A rule that sends every gpt-4o* request to OpenAI, falls back to the cheapest available provider if OpenAI is down, and caps the team at $100/day:
FieldValue
PatternstartsWith: gpt-4o
Priority10
Target providerOpenAI
Budget$100 / day
Fallbacklowest-cost