AutoRouterPlugin - TypeScript SDK
AutoRouterPlugin - TypeScript SDK
AutoRouterPlugin type definition
AutoRouterPlugin - TypeScript SDK
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
1 import { AutoRouterPlugin } from "@openrouter/sdk/models"; 2 3 let value: AutoRouterPlugin = { 4 id: "auto-router", 5 };
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
allowedModels | string[] | ➖ | List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., “anthropic/*” matches all Anthropic models). When not specified, uses the default supported models list. | [ “anthropic/”, “openai/gpt-4o”, “google/“ ] |
costQualityTradeoff | number | ➖ | Controls cost vs. quality routing tradeoff (0–10). 0 = pure quality (best model regardless of cost), 10 = maximize for cost (cheapest model wins). Intermediate values blend quality and cost signals continuously. Defaults to 7. | 7 |
enabled | boolean | ➖ | Set to false to disable the auto-router plugin for this request. Defaults to true. | |
id | ”auto-router” | ✔️ | N/A |