Routing guide

Route by policy, not provider habit.

Control how OpenWaya filters, scores, selects, and retries provider routes while preserving a complete decision trail.

01 / Eligibility

Filter before scoring.

Every request resolves an organization, model alias, and immutable configuration snapshot before a provider is considered. Hard constraints run first so a cheap or fast route can never bypass a residency, capability, plan, or safety rule.

  • Require the requested modalities, tools, context window, and structured-output support.
  • Apply organization, country, region, provider, privacy, quota, and safety constraints.
  • Exclude disabled, retired, unhealthy, or stale-price routes before scoring.

02 / Decision

Make the trade-off explicit.

Eligible routes are scored against the selected policy. Balanced routing combines health, observed latency, current cost, rate-limit headroom, and regional preference; fastest and lowest-cost policies change the weights without removing safety constraints.

Request routing fields
{
  "model": "openwaya/auto",
  "openwaya": { "routing_policy": "balanced" },
  "metadata": { "workload": "customer-support" }
}

03 / Recovery

Fail over without losing the story.

Fallbacks are ordered, bounded, and failure-aware. Retry a different route for timeouts, rate limits, and provider unavailability; do not retry validation, authentication, balance, safety, or idempotency conflicts.

  • Preserve one request ID across all provider attempts.
  • Respect the request deadline and maximum attempt count.
  • Record exclusions, scores, selected route, failure class, and final outcome.

Build against the contract

Move from guidance to implementation.