Description
n8n-nodes-minirouter
n8n community nodes for minirouter.sh, an OpenAI-compatible LLM router. Plug the chat model into an AI Agent, Basic LLM Chain, or anything else that takes a model; plug the embeddings into a vector store.
Nodes
- Minirouter Chat Model
- Embeddings Minirouter
- Minirouter API credential
– Live model dropdown from /v1/models (chat models only, minirouter/auto* routers listed first).
– Options: fallback models, temperature, max tokens, top P, frequency/presence penalty, JSON mode, reasoning effort, timeout (default 2 minutes), retries.
– Tool calling and streaming use n8n’s standard OpenAI-compatible path.
– Each call’s output includes generationInfo.minirouter:
{ costUsd, balanceUsd, model, provider, ttftMs }. model is the model that actually answered, which is useful with minirouter/auto. The cost is also reported as tokenUsage.cost, so it counts toward n8n’s run totals.
– openai/text-embedding-3-small, -3-large, -ada-002.
– minirouter serves embeddings only in own-key mode: add your OpenAI key in the minirouter dashboard first.
– API key (mr-live-...) and base URL (default https://api.minirouter.sh/v1). Saving it runs a test call to /credits.
Requirements
Self-hosted n8n 2.16 or newer. @n8n/ai-node-sdk, @langchain/openai and n8n-workflow are peer dependencies that n8n provides at runtime; don’t install them alongside this package or n8n ends up with two LangChain copies.
Install
From the n8n UI: Settings → Community Nodes → Install → n8n-nodes-minirouter. n8n skips peer dependencies automatically.
Manually, in the custom folder inside your n8n user folder (usually ~/.n8n/custom):
npm install --legacy-peer-deps n8n-nodes-minirouter
Then restart n8n.
Compatibility notes
content: [], which minirouter rejects (“exceeds the bounds this billing snapshot can price”). The node rewrites those to "" before sending.minirouter/auto:cheap can return 503 when none of its candidates can serve a request. Name a model directly or enable Retry On Fail.minirouter/* routers.Development
npm install --ignore-scripts
npm run build
npm pack
License
MIT