Portkey (Conditional Routing)
Portkey is an AI gateway that routes each LLM request to a provider target by deterministic rules over request metadata and parameters, and falls back to another provider when one fails.
Description
Portkey's AI Gateway sits in front of many LLM providers behind one API. Its conditional routing evaluates custom conditions over request metadata, request parameters, and the URL path to pick a provider target, so a rule path runs ahead of the models. When the primary provider fails, Portkey automatically falls back to the next configured target. It also adds retries, load balancing, and guardrails.
Solution
Portkey is a gateway, not an agent loop. Each incoming request is matched against conditional-routing rules over its metadata and parameters to select a provider target; the gateway forwards the call, applies retries, and on failure falls back through an ordered list of alternative targets before returning the response to the caller.
Primary use cases
- rule-based routing of requests to provider targets
- automatic fallback across providers on failure
- load balancing across LLM deployments
- gateway-level guardrails and observability
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.