Use Prune with n8n
OpenAI-compatible credential. One base URL. Vault holds the provider key. Cache and cheaper-model routing sit on every chat node.
Quick answer
An n8n OpenAI credential with a provider sk-… travels with workflow exports, backups, and teammate copies. Vault the provider key in Prune. Put only prune_ in the n8n credential, Base URL https://api.withprune.com/v1. Cache and cheaper-model routing sit on every Chat Model call. Shield can stop a looping AI Agent before the bill.
Why raw keys in n8n are a trap
Templates get shared. Credentials get renamed and re-exported. Overnight AI Agent nodes keep calling. Without a vault you rotate everywhere. Without Shield there is no fail-closed stop on the path. Without receipts you cannot show what ran.
1. Prune setup
- Join at withprune.com.
- Connect → Providers: vault OpenAI or OpenRouter.
- Copy your
prune_…key. Do not put a providersk-…in n8n.
2. n8n OpenAI credential
Credentials → Add → OpenAI (or the OpenAI Chat Model credential your AI nodes use). Paste:
Credential type: OpenAI (or OpenAI Chat Model)
Base URL: https://api.withprune.com/v1
API Key: prune_your_key
Organization: (leave blank)Attach that credential to OpenAI Chat Model, AI Agent, or any node that speaks OpenAI chat completions. Use a model id you vaulted (for example gpt-4o-mini).
3. HTTP Request fallback
If a node cannot set a custom base URL, use an HTTP Request node against the same host.
Method: POST
URL: https://api.withprune.com/v1/chat/completions
Header: Authorization = Bearer prune_your_key
Header: Content-Type = application/json
Body (JSON):
{
"model": "gpt-4o-mini",
"messages": [
{ "role": "user", "content": "Summarize this lead in one line." }
],
"max_tokens": 64
}- Dashboard Overview should show the call and any cache or route headers.
- Check a signed receipt at /verify.
With a single line of code, Prune cuts your AI bill and protects your team from runaway spend, leaked keys and dangerous calls.