n8n-nodes-openrouter-tchik
v0.3.0
Published
OpenRouter Chat Model community node for n8n with reasoning.effort, service_tier and app attribution headers.
Maintainers
Readme
n8n-nodes-openrouter-tchik
Private fork of n8n-nodes-openrouter-reasoning
v0.2.1 (MIT), customised for the Strat Calculator n8n instance.
Node display name: OpenRouter Chat Model (Custom).
What this fork adds
1. App attribution
A single App option (fixedCollection) under Options, grouping the two headers
public_html/api/ai_proxy.php already sends for the AI Engineer:
| Field | Header sent | Example |
|---|---|---|
| App URL | HTTP-Referer | https://strat-calculator.online/push-to-talk |
| App Name | X-Title | SC - Push To Talk |
App URL is mandatory once the App option is added — the node throws otherwise. This is not
arbitrary strictness: per OpenRouter's App Attribution doc,
HTTP-Referer is the app identity ("required for app attribution", without it "no app page
will be created and your usage will not appear in rankings"), while X-Title only renames an
app that already exists ("This header alone does not create an app page"). Letting App Name
through on its own would send a header that provably does nothing.
App Name stays optional. Not adding the App option at all sends no header, as before.
Headers are injected through configuration.defaultHeaders, so they apply to every request the
model makes — including the ones the LangChain agent fires on its own.
There is deliberately no generic "extra headers" field: attribution is the only real use case here, and a free-form header input is an easy way to ship a malformed request.
2. Service Tier dropdown
Options → Service Tier: Provider Default / Auto / Flex / Priority, merged into the
request body as service_tier. Replaces having to hand-write {"service_tier": "priority"} in
Extra OpenRouter Body JSON — that field still exists and still works.
Everything else is upstream
Reasoning effort, provider routing, ZDR, model capability validation, the tool-call arguments fix
in createOpenRouterFetch — all unchanged from v0.2.1. See the upstream README for the full
option list.
Build
npm install --include=dev # NODE_ENV=production in the shell would otherwise skip devDeps
npm run build
npm run lint
n8n-workflowis pinned to2.28.4(upstream uses^2.16.0) because@n8n/ai-utilitiespins that exact version. With two different copies in the tree, TypeScript sees two incompatibleINodeProperties/ISupplyDataFunctionstypes and the build fails. Runtime was never affected — this is a compile-time-only pin.
Install on the VPS
Deployed as a custom extension, not as an npm community package — nothing is published.
Drop the built folder in /opt/n8n-strat/data/custom/ (mounted as /home/node/.n8n/custom) and
restart the container.
⚠️ n8n registers custom-directory nodes under the fixed package name CUSTOM
(CUSTOM_NODES_PACKAGE_NAME in n8n-core), so the node type is
CUSTOM.lmChatOpenRouterCustom — the folder name here has no effect on it. Workflows using
the old n8n-nodes-openrouter-reasoning.lmChatOpenRouterReasoning type must have the node
re-added by hand.
Licence
MIT, inherited from upstream. See LICENSE.md.
