Nous Portal decides routing centrally per model and does not accept caller-supplied provider preferences; Mibyan never sends the
provider object to Portal, so provider_routing is simply ignored there.Configuration
Add aprovider_routing section to your ~/.mibyan/config.yaml:
Provider routing only applies when using OpenRouter. It has no effect on Nous Portal or direct provider connections (e.g., connecting directly to the Anthropic API).
Options
sort
Controls how OpenRouter ranks available providers for your request.
only
Whitelist of provider slugs. When set, only these providers will be used. All others are excluded. Use the lowercase slug shown by OpenRouter for each provider.
ignore
Blacklist of provider names. These providers will never be used, even if they offer the cheapest or fastest option.
order
Explicit priority order. Providers listed first are preferred. Unlisted providers are used as fallbacks.
require_parameters
When true, OpenRouter will only route to providers that support all parameters in your request (like temperature, top_p, tools, etc.). This avoids silent parameter drops.
data_collection
Controls whether providers can use your prompts for training. Options are "allow" or "deny".
Per-model overrides (models)
Pin a different provider set per model. Keys under models are model ids; each entry takes the same
sort / only / ignore / order / require_parameters / data_collection keys and overrides the
flat value for that model only. Anything you don’t set per model falls through to the flat defaults.
agent.reasoning_overrides (claude-fable-5.1 / claude-fable-5-1,
with or without the openrouter/ prefix). The override follows the model the agent is currently on, so
/model switches, fallback activation, cron jobs, and delegated subagents on another model each get their
own pins. Edit config.yaml directly for these keys: model ids contain dots, which mibyan config set
reads as path separators.
Practical Examples
Optimize for Cost
Route to the cheapest available provider. Good for high-volume usage and development:Optimize for Speed
Prioritize low-latency providers for interactive use:Optimize for Throughput
Best for long-form generation where tokens-per-second matters:Lock to Specific Providers
Ensure all requests go through a specific provider for consistency:Avoid Specific Providers
Exclude providers you don’t want to use (e.g., for data privacy):Preferred Order with Fallbacks
Try your preferred providers first, fall back to others if unavailable:How It Works
Provider routing preferences are passed to OpenRouter on agent chat requests and iteration-limit summaries via theextra_body.provider field. (extra_body is the OpenAI Python SDK argument; it becomes the top-level provider object in the JSON request.) Auxiliary tasks such as compression and title generation are configured independently under auxiliary.<task>.extra_body.
- CLI mode — configured in
~/.mibyan/config.yaml, loaded at startup - Gateway mode — same config file, loaded when the gateway starts
config.yaml and passed as parameters when creating the AIAgent:
Default Behavior
When noprovider_routing section is configured (the default), the aggregator uses its own default routing logic, which generally balances cost and availability automatically.

