Cost Model Router
Cost Model Router picks which model serves an Agent run by price. It compares each candidate’s blended token price (input plus output), the indicative price Publicus lists for that model on the AI models page, and selects the cheapest one, or the highest-priced one when you use price as a proxy for capability. The decision is deterministic and makes no extra model call. You find it on the node picker’s AI shelf.
The node has a single output handle, Model. Connect it to the Agent’s Model handle. An agent reads one model node, so this node and the other model providers are alternatives rather than a stack.
Credentials
Section titled “Credentials”Each candidate row can name its own API key secret: a secret holding the key for that row’s provider. A row takes a secret, never a saved connection; name a connection on the Agent’s own credential field instead. A row without a secret uses the workspace key for its provider (see AI models), with the server’s key as the final fallback.
Configuration
Section titled “Configuration”

| Field | Type | Default | Description |
|---|---|---|---|
Candidates (candidates) | list (required) | — | The provider+model candidates the router chooses between by price. |
Provider (candidates[].provider) | string (required) | — | |
Model (candidates[].model) | string (required) | — | |
API key (candidates[].apiKey) | string (optional) | — | |
Base URL (candidates[].baseUri) | string (optional) | — | |
Temperature (candidates[].temperature) | number (optional) | — | |
Max tokens (candidates[].maxTokens) | integer (optional) | — | |
Tier (tier) | string (optional) | cheapest |
Which candidate to pick by blended token price: cheapest selects the lowest-priced model, smartest selects the highest-priced one as a capability proxy. |
Set tier to cheapest to select the lowest-priced candidate, or smartest to select the highest-priced one. On a price tie, the earlier row wins, so the configured order breaks ties.
A candidate whose model has no listed price cannot be compared and is skipped. When no candidate is comparable, the agent falls back to the provider and model set on the Agent node itself.
Output
Section titled “Output”The node emits no output of its own and never runs as a step in the flow. It hands the agent one provider and model, the candidate its price comparison selected. The agent asks when a run starts, and once per phase when the router is attached to a phase-tracking agent.
Example
Section titled “Example”Always run the cheapest of two candidates:
- Add a Cost Model Router node and connect its Model handle to the Agent’s Model handle.
- Add candidate rows for
openai/gpt-4o-miniandanthropic/claude-sonnet-4-6. - Leave
tieroncheapest.
The router compares the two blended prices and the agent runs on the cheaper model. Flip tier to smartest and the same rows select the pricier model instead.
Limitations
Section titled “Limitations”- The prices are the published list prices Publicus reads for each model, so the choice tracks those rather than your negotiated rates or your actual token mix.
- The comparison ranks candidates relative to each other; it does not estimate or report what a run costs.
temperatureandmaxTokenson a candidate row are not applied by this router; use Rule Model Router or Fallback Chain Model when you need per-target sampling overrides.
Related
Section titled “Related”- Agent, the node this one attaches to.
- Rule Model Router routes on prompt size or phase instead of price.
- Llm Model Router routes on request content with a classifier.
- Static Model and Fallback Chain Model cover the no-routing cases.
- How to route between models is the task guide.