Skip to main content
OpenRouter’s dynamic routing supports fallback models. If the primary model fails due to rate limits, timeouts, or unavailability, OpenRouter tries fallback models in order.

Prerequisites

Set OPENROUTER_API_KEY environment variable.

Run the Example